com.bbn.openmap.util.coordFormatter
Class BasicCoordInfoFormatter
java.lang.Object
com.bbn.openmap.MapHandlerChild
com.bbn.openmap.OMComponent
com.bbn.openmap.util.coordFormatter.BasicCoordInfoFormatter
- All Implemented Interfaces:
- LightMapHandlerChild, PropertyConsumer, CoordInfoFormatter, java.beans.beancontext.BeanContextChild, java.beans.beancontext.BeanContextMembershipListener, java.util.EventListener
- Direct Known Subclasses:
- DMSCoordInfoFormatter, MGRSCoordInfoFormatter
public class BasicCoordInfoFormatter
- extends OMComponent
- implements CoordInfoFormatter
A CoordInfoFormatter that creates the default OpenMap string:
Lat, Lon (latitude, longitude) - x, y (x pixel loc, y pixel loc)
- Author:
- dietrick
Field Summary |
static java.lang.String |
DEGREE_SIGN
|
protected java.text.DecimalFormat |
df
|
protected java.lang.String |
prettyName
|
Method Summary |
java.lang.String |
createCoordinateInformationLine(int x,
int y,
java.awt.geom.Point2D llp,
java.lang.Object source)
The main function of this class |
java.lang.String |
getPrettyName()
A name, suitable for GUI display, of this formatter. |
java.util.Properties |
getProperties(java.util.Properties props)
PropertyConsumer method, to fill in a Properties object, reflecting the
current values of the OMComponent. |
java.util.Properties |
getPropertyInfo(java.util.Properties props)
Method to fill in a Properties object with values reflecting the
properties able to be set on this PropertyConsumer. |
void |
setProperties(java.lang.String prefix,
java.util.Properties props)
Sets the properties for the OMComponent. |
Methods inherited from class com.bbn.openmap.MapHandlerChild |
addPropertyChangeListener, addVetoableChangeListener, childrenAdded, childrenRemoved, findAndInit, findAndInit, findAndUndo, firePropertyChange, fireVetoableChange, getBeanContext, isIsolated, removePropertyChangeListener, removeVetoableChangeListener, setBeanContext, setIsolated |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
prettyName
protected java.lang.String prettyName
DEGREE_SIGN
public static final java.lang.String DEGREE_SIGN
- See Also:
- Constant Field Values
df
protected java.text.DecimalFormat df
BasicCoordInfoFormatter
public BasicCoordInfoFormatter()
createCoordinateInformationLine
public java.lang.String createCoordinateInformationLine(int x,
int y,
java.awt.geom.Point2D llp,
java.lang.Object source)
- Description copied from interface:
CoordInfoFormatter
- The main function of this class
- Specified by:
createCoordinateInformationLine
in interface CoordInfoFormatter
- Parameters:
x
- the x pixel coordinate of the map, 0 is left side.y
- the y pixel coordinate of the map, 0 is top.llp
- the LatLonPoint represented by the pixel location.source
- the object calling this method.
- Returns:
- String with coordinate info on it.
getPrettyName
public java.lang.String getPrettyName()
- Description copied from interface:
CoordInfoFormatter
- A name, suitable for GUI display, of this formatter.
- Specified by:
getPrettyName
in interface CoordInfoFormatter
- Returns:
- String for pretty name for formatter
setProperties
public void setProperties(java.lang.String prefix,
java.util.Properties props)
- Description copied from class:
OMComponent
- Sets the properties for the OMComponent.
- Specified by:
setProperties
in interface PropertyConsumer
- Overrides:
setProperties
in class OMComponent
- Parameters:
prefix
- the token to prefix the property namesprops
- the Properties
object
getProperties
public java.util.Properties getProperties(java.util.Properties props)
- Description copied from class:
OMComponent
- PropertyConsumer method, to fill in a Properties object, reflecting the
current values of the OMComponent. If the component has a propertyPrefix
set, the property keys should have that prefix plus a separating '.'
prepended to each property key it uses for configuration.
- Specified by:
getProperties
in interface PropertyConsumer
- Overrides:
getProperties
in class OMComponent
- Parameters:
props
- a Properties object to load the PropertyConsumer properties
into. If props equals null, then a new Properties object should be
created.
- Returns:
- Properties object containing PropertyConsumer property values. If
getList was not null, this should equal getList. Otherwise, it
should be the Properties object created by the PropertyConsumer.
getPropertyInfo
public java.util.Properties getPropertyInfo(java.util.Properties props)
- Description copied from class:
OMComponent
- Method to fill in a Properties object with values reflecting the
properties able to be set on this PropertyConsumer. The key for each
property should be the raw property name (without a prefix) with a value
that is a String that describes what the property key represents, along
with any other information about the property that would be helpful
(range, default value, etc.). For Layer, this method should at least
return the 'prettyName' property.
- Specified by:
getPropertyInfo
in interface PropertyConsumer
- Overrides:
getPropertyInfo
in class OMComponent
- Parameters:
props
- a Properties object to load the PropertyConsumer properties
into. If getList equals null, then a new Properties object should
be created.
- Returns:
- Properties object containing PropertyConsumer property values. If
getList was not null, this should equal getList. Otherwise, it
should be the Properties object created by the PropertyConsumer.
Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details