|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.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 java.awt.geom.Point2D |
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 java.awt.geom.Point2D |
intermediateDest
Temporary destination point of the range rings to be drawn. |
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 java.awt.geom.Point2D |
origin
Origin point of the range rings to be drawn. |
protected DrawingAttributes |
rrAttributes
|
protected Length |
units
Distance units for label. |
static java.lang.String |
UNITS_PROPERTY
|
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. |
java.text.Format |
getDistanceFormat()
Give the Format object used to display distances. |
protected java.lang.String |
getLabelFor(double distance)
Returns the String to be used as a labeler for the circle drawn using dest . |
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)
Get the current Properties for this mouse mode. |
java.util.Properties |
getPropertyInfo(java.util.Properties list)
Return property info metadata for this PropertyConsumer. |
protected void |
init()
|
void |
listenerPaint(java.lang.Object source,
java.awt.Graphics g)
PaintListener method. |
void |
mouseClicked(java.awt.event.MouseEvent e)
Invoked when the mouse has been clicked on a component. |
void |
mouseDragged(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 |
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(Geo originGeo,
double distance,
java.awt.Graphics graphics,
MapBean theMap)
Paints a unique circle centered on origin and which crosses
dest on the given Graphics. |
protected void |
paintLabel(Geo originGeo,
double distance,
java.awt.Graphics graphics,
MapBean theMap)
Paints a label for the circle drawn using dest on the given
Graphics. |
protected void |
paintOrigin(java.awt.geom.Point2D llp,
java.awt.Graphics graphics,
MapBean theMap)
Paints the origin point of the range rings and its label on the given Graphics. |
protected void |
paintOriginLabel(java.awt.geom.Point2D originPnt,
java.awt.Graphics graphics,
MapBean theMap)
Paints the origin label of the range rings on the given Graphics. |
protected void |
paintOriginPoint(java.awt.geom.Point2D originPnt,
java.awt.Graphics graphics,
MapBean theMap)
Paints the origin point of the range rings on the given Graphics. |
protected void |
paintRangeRings(java.awt.geom.Point2D originPnt,
java.awt.geom.Point2D dest,
java.awt.Graphics graphics,
MapBean theMap)
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 |
setActive(boolean active)
If the MouseMode has been made inactive, clean out any input that might have been made to the info line. |
void |
setDistanceFormat(java.text.Format distanceFormat)
Sets the Format object used to display distances. |
void |
setNumRings(int numRings)
Sets the number of rings to display. |
void |
setProperties(java.lang.String prefix,
java.util.Properties props)
Set properties for this mouse mode |
Methods inherited from class com.bbn.openmap.event.CoordMouseMode |
---|
findAndInit, findAndUndo, fireMouseLocation, getCoordFormatter, getCoordFormatterHandler, getInfoDelegator, propertyChange, 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 static final java.lang.String UNITS_PROPERTY
public transient java.text.DecimalFormat df
protected java.text.Format distanceFormat
protected int numRings
protected java.awt.geom.Point2D origin
protected java.awt.geom.Point2D intermediateDest
protected java.awt.geom.Point2D destination
protected DrawingAttributes rrAttributes
protected Length units
Constructor Detail |
---|
public RangeRingsMouseMode()
public RangeRingsMouseMode(boolean shouldConsumeEvents)
public RangeRingsMouseMode(java.lang.String name, boolean shouldConsumeEvents)
Method Detail |
---|
protected void init()
public 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 setActive(boolean active)
CoordMouseMode
setActive
in interface MapMouseMode
setActive
in class CoordMouseMode
active
- true if the mode has been made active, false if it has been
made inactive.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 mouseDragged(java.awt.event.MouseEvent e)
CoordMouseMode
mouseDragged
in interface java.awt.event.MouseMotionListener
mouseDragged
in class CoordMouseMode
e
- mouse event.public 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 listenerPaint(java.lang.Object source, java.awt.Graphics g)
listenerPaint
in interface PaintListener
listenerPaint
in class AbstractMouseMode
source
- the source object, most likely the MapBeang
- java.awt.Graphicsprotected void paintOrigin(java.awt.geom.Point2D llp, java.awt.Graphics graphics, MapBean theMap)
llp
- the location of the origin.graphics
- The Graphics to paint on.protected void paintOriginPoint(java.awt.geom.Point2D originPnt, java.awt.Graphics graphics, MapBean theMap)
originPnt
- the origin pointgraphics
- The Graphics to paint on.protected void paintOriginLabel(java.awt.geom.Point2D originPnt, java.awt.Graphics graphics, MapBean theMap)
originPnt
- the origin pointgraphics
- The Graphics to paint on.protected void paintRangeRings(java.awt.geom.Point2D originPnt, java.awt.geom.Point2D dest, java.awt.Graphics graphics, MapBean theMap)
originPnt
- the origin locationdest
- the location of the inner ring.graphics
- The Graphics to paint on.protected void paintCircle(Geo originGeo, double distance, java.awt.Graphics graphics, MapBean theMap)
origin
and which crosses
dest
on the given Graphics.
originGeo
- the origin locationdistance
- the distance of the circle from the origin, in radiansgraphics
- The Graphics to paint on.protected void paintLabel(Geo originGeo, double distance, java.awt.Graphics graphics, MapBean theMap)
dest
on the given
Graphics.
originGeo
- the Geo for the origin locationdistance
- the distance of circle in radians.graphics
- The Graphics to paint in.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(double distance)
dest
.
distance
- The distance from the origin for the label, in radians.
protected void cleanUp()
public void setProperties(java.lang.String prefix, java.util.Properties props)
setProperties
in interface PropertyConsumer
setProperties
in class CoordMouseMode
prefix
- property prefix that should be prepended to property keys.props
- the properties containing key-values.public java.util.Properties getProperties(java.util.Properties props)
getProperties
in interface PropertyConsumer
getProperties
in class CoordMouseMode
props
- The Properties object to add props to. A Properties object
will be created if null.
public java.util.Properties getPropertyInfo(java.util.Properties list)
getPropertyInfo
in interface PropertyConsumer
getPropertyInfo
in class CoordMouseMode
list
- Properties to add to, may be null.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |