|
|||||||||||
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.NavMouseMode
The Navigation Mouse Mode interprets mouse clicks and mouse drags to recenter and rescale the map. The map is centered on the location where a click occurs. If a box is drawn by clicking down and dragging the mouse, the map is centered on the dot in the center of the box, and the scale is adjusted so the screen fills the area designated by the box.
You MUST add this MouseMode as a ProjectionListener to the MapBean to get it to work. If you use a MouseDelegator with the bean, it will take care of that for you.
Nested Class Summary |
Nested classes inherited from class com.bbn.openmap.event.AbstractMouseMode |
AbstractMouseMode.MouseWheelZoomEditor |
Field Summary | |
protected boolean |
autoZoom
|
static java.lang.String |
modeID
Mouse Mode identifier, which is "Navigation". |
protected java.awt.Point |
point1
|
protected java.awt.Point |
point2
|
Fields inherited from class com.bbn.openmap.event.CoordMouseMode |
infoDelegator |
Fields inherited from class com.bbn.openmap.event.AbstractMouseMode |
cursor, CursorIDProperty, df, guiIcon, iconName, IconProperty, ID, IDProperty, mouseSupport, MouseWheelZoomProperty, prettyName, PrettyNameProperty, visible, ZOOM_IN, ZOOM_OUT, zoomWhenMouseWheelUp |
Fields inherited from class com.bbn.openmap.OMComponent |
i18n, propertyPrefix |
Fields inherited from class com.bbn.openmap.MapHandlerChild |
beanContextChildSupport |
Fields inherited from interface com.bbn.openmap.PropertyConsumer |
EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty |
Constructor Summary | |
NavMouseMode()
Construct a NavMouseMode. |
|
NavMouseMode(boolean shouldConsumeEvents)
Construct a NavMouseMode. |
Method Summary | |
protected java.awt.Point |
getRatioPoint(MapBean map,
java.awt.Point pt1,
java.awt.Point pt2)
Given a MapBean, which provides the projection, and the starting point of a box (pt1), look at pt2 to see if it represents the ratio of the projection map size. |
void |
listenerPaint(java.awt.Graphics g)
Called by the MapBean when it repaints, to let the MouseMode know when to update itself on the map. |
void |
mouseClicked(java.awt.event.MouseEvent e)
Invoked when the mouse has been clicked on a component. |
void |
mouseDragged(java.awt.event.MouseEvent e)
Handle a mouseDragged MouseMotionListener event. |
void |
mouseEntered(java.awt.event.MouseEvent e)
Handle a mouseEntered MouseListener event. |
void |
mouseExited(java.awt.event.MouseEvent e)
Handle a mouseExited MouseListener event. |
void |
mousePressed(java.awt.event.MouseEvent e)
Handle a mousePressed MouseListener event. |
void |
mouseReleased(java.awt.event.MouseEvent e)
Handle a mouseReleased MouseListener event. |
protected void |
paintRectangle(java.awt.Graphics g,
java.awt.Point pt1,
java.awt.Point pt2)
Draws or erases boxes between two screen pixel points. |
protected void |
paintRectangle(MapBean map,
java.awt.Point pt1,
java.awt.Point pt2)
Draws or erases boxes between two screen pixel points. |
Methods inherited from class com.bbn.openmap.event.CoordMouseMode |
createCoordinateInformationLine, findAndInit, findAndUndo, fireMouseLocation, getInfoDelegator, mouseMoved, setActive, 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, removePropertyChangeListener, removeVetoableChangeListener, setBeanContext |
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
protected java.awt.Point point1
protected java.awt.Point point2
protected boolean autoZoom
Constructor Detail |
public NavMouseMode()
public NavMouseMode(boolean shouldConsumeEvents)
shouldConsumeEvents
- the mode setting.Method Detail |
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
mousePressed
in class AbstractMouseMode
e
- MouseEvent to be handledpublic void mouseClicked(java.awt.event.MouseEvent e)
AbstractMouseMode
mouseClicked
in interface java.awt.event.MouseListener
mouseClicked
in class AbstractMouseMode
e
- MouseEventpublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
mouseReleased
in class AbstractMouseMode
e
- MouseEvent to be handledpublic void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
mouseEntered
in class AbstractMouseMode
e
- MouseEvent to be handledpublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
mouseExited
in class AbstractMouseMode
e
- MouseEvent to be handledpublic void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
mouseDragged
in class CoordMouseMode
e
- MouseEvent to be handledprotected java.awt.Point getRatioPoint(MapBean map, java.awt.Point pt1, java.awt.Point pt2)
protected void paintRectangle(MapBean map, java.awt.Point pt1, java.awt.Point pt2)
pt1
- one corner of the box to drawn, in window pixel coordinates.pt2
- the opposite corner of the box.protected void paintRectangle(java.awt.Graphics g, java.awt.Point pt1, java.awt.Point pt2)
pt1
- one corner of the box to drawn, in window pixel coordinates.pt2
- the opposite corner of the box.public void listenerPaint(java.awt.Graphics g)
listenerPaint
in interface PaintListener
listenerPaint
in class AbstractMouseMode
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |