public class RangeRingsMouseMode extends CoordMouseMode
AbstractMouseMode.MouseWheelTimerListener
Modifier and Type | Field and Description |
---|---|
protected LatLonPoint |
destination
Destination point of the range rings to be drawn.
|
java.text.DecimalFormat |
df |
protected java.text.Format |
distanceFormat
Format used to draw distances.
|
protected LatLonPoint |
intermediateDest
Temporary destination point of the range rings to be drawn.
|
protected MapBean |
mapBean
Active MapBean.
|
static java.lang.String |
modeID |
static java.lang.String |
NUM_RINGS_PROPERTY
The property string used to set the numRings member variable.
|
protected int |
numRings
Number of rings to draw.
|
protected LatLonPoint |
origin
Origin point of the range rings to be drawn.
|
coordFormatter, coordFormatterHandler, CoordFormatterProperty, infoDelegator
cursor, CursorIDProperty, guiIcon, iconName, IconProperty, ID, IDProperty, logger, mouseSupport, mouseTimer, mouseWheelListener, MouseWheelListenerProperty, mouseWheelTimerInterval, MouseWheelTimerIntervalProperty, mouseWheelTimerListener, MouseWheelZoomProperty, noMouseWheelListenerTimer, NoMouseWheelListenerTimerProperty, prettyName, PrettyNameProperty, propertyChangeSupport, visible, ZOOM_IN, ZOOM_OUT, zoomWhenMouseWheelUp
i18n, propertyPrefix
beanContextChildSupport, isolated
EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty
Constructor and Description |
---|
RangeRingsMouseMode() |
RangeRingsMouseMode(boolean shouldConsumeEvents) |
RangeRingsMouseMode(java.lang.String name,
boolean shouldConsumeEvents) |
Modifier and Type | Method and Description |
---|---|
protected void |
cleanUp()
Called when the range rings must be cleared, before repainting a clean
map.
|
protected void |
finished()
Called when the end point of the range rings has been selected, before
painting on the map.
|
java.text.Format |
getDistanceFormat()
Give the Format object used to display distances.
|
protected java.lang.String |
getLabelFor(LatLonPoint dest)
Returns the String to be used as a labeler for the circle drawn using
dest . |
MapBean |
getMapBean()
Return the map bean.
|
int |
getNumRings()
Returns the number of rings to display.
|
protected java.lang.String |
getOriginLabel()
Returns the String to be used as a labeler for the origin point of the
range rings.
|
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 list)
Method to fill in a Properties object with values reflecting the
properties able to be set on this PropertyConsumer.
|
protected void |
init() |
void |
listenerPaint(java.awt.Graphics g)
PaintListener interface, notifying the MouseMode that the MapBean has
repainted itself.
|
void |
mouseClicked(java.awt.event.MouseEvent e)
Invoked when the mouse has been clicked on a component.
|
void |
mouseEntered(java.awt.event.MouseEvent e)
Invoked when the mouse enters a component.
|
void |
mouseMoved(java.awt.event.MouseEvent e)
Fires a mouse location to the InformationDelegator, and then calls the
super class method which calls the MouseSupport method.
|
void |
mousePressed(java.awt.event.MouseEvent e)
Invoked when a mouse button has been pressed on a component.
|
void |
mouseReleased(java.awt.event.MouseEvent e)
Invoked when a mouse button has been released on a component.
|
protected void |
paintCircle(LatLonPoint dest)
Paints a unique circle centered on
origin and which crosses
dest on the map bean. |
protected void |
paintCircle(LatLonPoint dest,
java.awt.Graphics graphics)
Paints a unique circle centered on
origin and which crosses
dest on the given Graphics. |
protected void |
paintLabel(LatLonPoint dest)
Paints a label for the circle drawn using
dest on the map
bean. |
protected void |
paintLabel(LatLonPoint dest,
java.awt.Graphics graphics)
Paints a label for the circle drawn using
dest on the given
Graphics. |
protected void |
paintOrigin()
Paints the origin point of the range rings and its label on the map bean.
|
protected void |
paintOrigin(java.awt.Graphics graphics)
Paints the origin point of the range rings and its label on the given
Graphics.
|
protected void |
paintOriginLabel(java.awt.Graphics graphics)
Paints the origin label of the range rings on the given Graphics.
|
protected void |
paintOriginPoint(java.awt.Graphics graphics)
Paints the origin point of the range rings on the given Graphics.
|
protected void |
paintRangeRings(LatLonPoint dest)
Paints the circles and their labels on the map bean.
|
protected void |
paintRangeRings(LatLonPoint dest,
java.awt.Graphics graphics)
Paints the circles and their labels on the given Graphics.
|
protected void |
prepareCircle(OMCircle circle)
Customizes the given OMCicle before it is rendered.
|
protected void |
prepareLabel(OMText text)
Customizes the given OMText before it is rendered.
|
protected void |
preparePoint(OMPoint point)
Customizes the given OMPoint before it is rendered.
|
void |
redraw()
Repaints the map bean.
|
void |
setDistanceFormat(java.text.Format distanceFormat)
Sets the Format object used to display distances.
|
void |
setMapBean(MapBean aMap)
Set the map bean.
|
void |
setNumRings(int numRings)
Sets the number of rings to display.
|
void |
setProperties(java.lang.String prefix,
java.util.Properties props)
Sets the properties for the OMComponent.
|
protected void |
startUp()
Called when the origin point of the range rings has been selected, before
painting on the map.
|
protected void |
update()
Called when the origin point of the range is is known, and the mouse is
moving on the map, but before painting on the map.
|
findAndInit, findAndUndo, fireMouseLocation, getCoordFormatter, getCoordFormatterHandler, getInfoDelegator, mouseDragged, propertyChange, setActive, setCoordFormatter, setCoordFormatterHandler, setInfoDelegator
actAsProxyFor, actAsProxyFor, addMapMouseListener, addPropertyChangeListener, getClassToUseForIconRetrieval, getGUIIcon, getIconName, getID, getModeCursor, getMouseSupport, getMouseWheelTimerInterval, getNoMouseWheelListener, getPrettyName, getProxied, getProxyDistributionMask, isConsumeEvents, isMouseWheelListener, isNoMouseWheelListenerTimer, isProxyFor, isVisible, isZoomWhenMouseWheelUp, mouseExited, mouseWheelMoved, releaseProxy, removeAllMapMouseListeners, removeMapMouseListener, removePropertyChangeListener, setConsumeEvents, setGUIIcon, setIconName, setID, setModeCursor, setModeCursor, setMouseSupport, setMouseWheelListener, setMouseWheelTimerInterval, setNoMouseWheelListener, setNoMouseWheelListenerTimer, setPrettyName, setProxyDistributionMask, setVisible, setZoomWhenMouseWheelUp, updateMouseWheelMoved
getPropertyPrefix, setProperties, setPropertyPrefix
addPropertyChangeListener, addVetoableChangeListener, childrenAdded, childrenRemoved, findAndInit, firePropertyChange, fireVetoableChange, getBeanContext, isIsolated, removePropertyChangeListener, removeVetoableChangeListener, setBeanContext, setIsolated
public static final transient java.lang.String modeID
public static final java.lang.String NUM_RINGS_PROPERTY
public transient java.text.DecimalFormat df
protected java.text.Format distanceFormat
protected int numRings
protected LatLonPoint origin
protected LatLonPoint intermediateDest
protected LatLonPoint destination
protected MapBean mapBean
public RangeRingsMouseMode()
public RangeRingsMouseMode(boolean shouldConsumeEvents)
public RangeRingsMouseMode(java.lang.String name, boolean shouldConsumeEvents)
protected void init()
public MapBean getMapBean()
public void setMapBean(MapBean aMap)
aMap
- a map beanpublic java.text.Format getDistanceFormat()
public void setDistanceFormat(java.text.Format distanceFormat)
distanceFormat
- Format.public int getNumRings()
public void setNumRings(int numRings)
numRings
- the number of rings to display.public void mouseClicked(java.awt.event.MouseEvent e)
AbstractMouseMode
mouseClicked
in interface java.awt.event.MouseListener
mouseClicked
in class AbstractMouseMode
e
- MouseEventpublic void mousePressed(java.awt.event.MouseEvent e)
AbstractMouseMode
mousePressed
in interface java.awt.event.MouseListener
mousePressed
in class AbstractMouseMode
e
- MouseEventpublic void mouseReleased(java.awt.event.MouseEvent e)
AbstractMouseMode
mouseReleased
in interface java.awt.event.MouseListener
mouseReleased
in class AbstractMouseMode
e
- MouseEventpublic void mouseMoved(java.awt.event.MouseEvent e)
CoordMouseMode
mouseMoved
in interface java.awt.event.MouseMotionListener
mouseMoved
in class CoordMouseMode
e
- MouseEvent to be handledpublic void mouseEntered(java.awt.event.MouseEvent e)
AbstractMouseMode
mouseEntered
in interface java.awt.event.MouseListener
mouseEntered
in class AbstractMouseMode
e
- MouseEventpublic void redraw()
paintListener
for the mapBean by the mouseDelegator, so
the listenerPaint
method can draw the range rings on the map
bean.public void listenerPaint(java.awt.Graphics g)
AbstractMouseMode
listenerPaint
in interface PaintListener
listenerPaint
in class AbstractMouseMode
protected void paintOrigin()
protected void paintOrigin(java.awt.Graphics graphics)
graphics
- The Graphics to paint on.protected void paintOriginPoint(java.awt.Graphics graphics)
graphics
- The Graphics to paint on.protected void paintOriginLabel(java.awt.Graphics graphics)
graphics
- The Graphics to paint on.protected void paintRangeRings(LatLonPoint dest)
dest
- The destination point, used with the origin
member variable to compute the rings.protected void paintRangeRings(LatLonPoint dest, java.awt.Graphics graphics)
dest
- The destination point, used with the origin
member variable to compute the rings.graphics
- The Graphics to paint on.protected void paintCircle(LatLonPoint dest)
origin
and which crosses
dest
on the map bean.dest
- A point on the circle.protected void paintCircle(LatLonPoint dest, java.awt.Graphics graphics)
origin
and which crosses
dest
on the given Graphics.dest
- A point on the circle.graphics
- The Graphics to paint on.protected void paintLabel(LatLonPoint dest)
dest
on the map
bean.dest
- A point on the circle.protected void paintLabel(LatLonPoint dest, java.awt.Graphics graphics)
dest
on the given
Graphics.dest
- A point on the circle.graphics
- The Graphics to paint on.protected void preparePoint(OMPoint point)
point
- OMPoint.protected void prepareCircle(OMCircle circle)
circle
- OMCircle.protected void prepareLabel(OMText text)
text
- OMText.protected java.lang.String getOriginLabel()
protected java.lang.String getLabelFor(LatLonPoint dest)
dest
.dest
- A point on a circle.protected void startUp()
protected void update()
protected void finished()
protected void cleanUp()
public void setProperties(java.lang.String prefix, java.util.Properties props)
OMComponent
setProperties
in interface PropertyConsumer
setProperties
in class CoordMouseMode
prefix
- the token to prefix the property namesprops
- the Properties
objectpublic java.util.Properties getProperties(java.util.Properties props)
OMComponent
getProperties
in interface PropertyConsumer
getProperties
in class CoordMouseMode
props
- a Properties object to load the PropertyConsumer properties
into. If props equals null, then a new Properties object should be
created.public java.util.Properties getPropertyInfo(java.util.Properties list)
OMComponent
getPropertyInfo
in interface PropertyConsumer
getPropertyInfo
in class CoordMouseMode
list
- a Properties object to load the PropertyConsumer properties
into. If getList equals null, then a new Properties object should
be created.Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details