|
||||||||||
| 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
public class 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/interfaces inherited from class com.bbn.openmap.event.AbstractMouseMode |
|---|
AbstractMouseMode.MouseWheelTimerListener |
| 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
|
protected DrawingAttributes |
rectAttributes
DrawingAttributes to use for drawn rectangle. |
| 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 | |
|---|---|
NavMouseMode()
Construct a NavMouseMode. |
|
NavMouseMode(boolean shouldConsumeEvents)
Construct a NavMouseMode. |
|
| Method Summary | |
|---|---|
protected void |
cleanUp()
|
java.util.Properties |
getProperties(java.util.Properties getList)
PropertyConsumer interface method. |
java.util.Properties |
getPropertyInfo(java.util.Properties list)
PropertyConsumer interface method. |
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. |
DrawingAttributes |
getRectAttributes()
|
protected void |
handleMouseReleased(java.awt.event.MouseEvent e)
Override this method to change what happens when the mouse is released. |
void |
listenerPaint(java.lang.Object obj,
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 |
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)
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. |
void |
setProperties(java.lang.String prefix,
java.util.Properties setList)
PropertyConsumer interface method. |
void |
setRectAttributes(DrawingAttributes rectAttributes)
|
| Methods inherited from class com.bbn.openmap.event.CoordMouseMode |
|---|
findAndInit, findAndUndo, fireMouseLocation, getCoordFormatter, getCoordFormatterHandler, getInfoDelegator, 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
protected java.awt.Point point1
protected java.awt.Point point2
protected boolean autoZoom
protected DrawingAttributes rectAttributes
| 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.MouseListenermousePressed in class AbstractMouseModee - MouseEvent to be handledpublic void mouseClicked(java.awt.event.MouseEvent e)
AbstractMouseMode
mouseClicked in interface java.awt.event.MouseListenermouseClicked 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 mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenermouseReleased in class AbstractMouseModee - MouseEvent to be handledprotected void handleMouseReleased(java.awt.event.MouseEvent e)
e - MouseEventpublic void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered in interface java.awt.event.MouseListenermouseEntered in class AbstractMouseModee - MouseEvent to be handledpublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited in interface java.awt.event.MouseListenermouseExited in class AbstractMouseModee - MouseEvent to be handledpublic void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged in interface java.awt.event.MouseMotionListenermouseDragged in class CoordMouseModee - MouseEvent to be handledprotected void cleanUp()
protected java.awt.Point getRatioPoint(MapBean map,
java.awt.Point pt1,
java.awt.Point pt2)
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.lang.Object obj,
java.awt.Graphics g)
listenerPaint in interface PaintListenerlistenerPaint in class AbstractMouseModeobj - the source object, may be null, you need to check.g - the graphics to paint into.public DrawingAttributes getRectAttributes()
public void setRectAttributes(DrawingAttributes rectAttributes)
public void setProperties(java.lang.String prefix,
java.util.Properties setList)
setProperties in interface PropertyConsumersetProperties in class CoordMouseModeprefix - the token to prefix the property namessetList - the Properties objectpublic java.util.Properties getProperties(java.util.Properties getList)
getProperties in interface PropertyConsumergetProperties in class CoordMouseModegetList - 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)
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 | |||||||||