|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bbn.openmap.MapHandlerChild
com.bbn.openmap.OMComponent
com.bbn.openmap.event.AbstractMouseMode
com.bbn.openmap.event.CoordMouseMode
com.bbn.openmap.event.RangeRingsMouseMode
public class RangeRingsMouseMode
Mouse mode for drawing temporary range rings on a map bean.
The whole map bean is repainted each time the range rings needs to be
repainted. The map bean needs to use a mouseDelegator to repaint properly.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.bbn.openmap.event.AbstractMouseMode |
|---|
AbstractMouseMode.MouseWheelTimerListener |
| Field Summary | |
|---|---|
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. |
| Fields inherited from class com.bbn.openmap.event.CoordMouseMode |
|---|
coordFormatter, coordFormatterHandler, CoordFormatterProperty, infoDelegator |
| Fields inherited from class com.bbn.openmap.OMComponent |
|---|
i18n, propertyPrefix |
| Fields inherited from class com.bbn.openmap.MapHandlerChild |
|---|
beanContextChildSupport, isolated |
| Fields inherited from interface com.bbn.openmap.PropertyConsumer |
|---|
EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty |
| Constructor Summary | |
|---|---|
RangeRingsMouseMode()
|
|
RangeRingsMouseMode(boolean shouldConsumeEvents)
|
|
RangeRingsMouseMode(java.lang.String name,
boolean shouldConsumeEvents)
|
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class com.bbn.openmap.event.CoordMouseMode |
|---|
findAndInit, findAndUndo, fireMouseLocation, getCoordFormatter, getCoordFormatterHandler, getInfoDelegator, mouseDragged, propertyChange, setActive, setCoordFormatter, setCoordFormatterHandler, setInfoDelegator |
| Methods inherited from class com.bbn.openmap.OMComponent |
|---|
getPropertyPrefix, setProperties, setPropertyPrefix |
| Methods inherited from class com.bbn.openmap.MapHandlerChild |
|---|
addPropertyChangeListener, addVetoableChangeListener, childrenAdded, childrenRemoved, findAndInit, 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 |
| Field Detail |
|---|
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
| Constructor Detail |
|---|
public RangeRingsMouseMode()
public RangeRingsMouseMode(boolean shouldConsumeEvents)
public RangeRingsMouseMode(java.lang.String name,
boolean shouldConsumeEvents)
| Method Detail |
|---|
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.MouseListenermouseClicked in class AbstractMouseModee - MouseEventpublic void mousePressed(java.awt.event.MouseEvent e)
AbstractMouseMode
mousePressed in interface java.awt.event.MouseListenermousePressed in class AbstractMouseModee - MouseEventpublic void mouseReleased(java.awt.event.MouseEvent e)
AbstractMouseMode
mouseReleased in interface java.awt.event.MouseListenermouseReleased in class AbstractMouseModee - MouseEventpublic void mouseMoved(java.awt.event.MouseEvent e)
CoordMouseMode
mouseMoved in interface java.awt.event.MouseMotionListenermouseMoved in class CoordMouseModee - MouseEvent to be handledpublic void mouseEntered(java.awt.event.MouseEvent e)
AbstractMouseMode
mouseEntered in interface java.awt.event.MouseListenermouseEntered in class AbstractMouseModee - 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 PaintListenerlistenerPaint in class AbstractMouseModeprotected 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 PropertyConsumersetProperties in class CoordMouseModeprefix - the token to prefix the property namesprops - the Properties objectpublic java.util.Properties getProperties(java.util.Properties props)
OMComponent
getProperties in interface PropertyConsumergetProperties in class CoordMouseModeprops - 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 PropertyConsumergetPropertyInfo in class CoordMouseModelist - a Properties object to load the PropertyConsumer properties
into. If getList equals null, then a new Properties object should
be created.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||