com.bbn.openmap.event
Class DefaultOverviewMouseMode

java.lang.Object
  extended by com.bbn.openmap.MapHandlerChild
      extended by com.bbn.openmap.OMComponent
          extended by com.bbn.openmap.event.AbstractMouseMode
              extended by com.bbn.openmap.event.CoordMouseMode
                  extended by com.bbn.openmap.event.NavMouseMode
                      extended by com.bbn.openmap.event.NavMouseMode2
                          extended by com.bbn.openmap.event.DefaultOverviewMouseMode
All Implemented Interfaces:
MapMouseMode, PaintListener, LightMapHandlerChild, PropertyConsumer, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener, java.beans.beancontext.BeanContextChild, java.beans.beancontext.BeanContextMembershipListener, java.beans.PropertyChangeListener, java.io.Serializable, java.util.EventListener

public class DefaultOverviewMouseMode
extends NavMouseMode2

A MouseMode that handles drawing a box, or clicking on a point, but directs the updates to the ControlledMapSupport of the overview map handler, instead of the overview MapBean, which would have been the normal behavior.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.bbn.openmap.event.AbstractMouseMode
AbstractMouseMode.MouseWheelTimerListener
 
Field Summary
 
Fields inherited from class com.bbn.openmap.event.NavMouseMode
autoZoom, modeID, point1, point2, rectAttributes
 
Fields inherited from class com.bbn.openmap.event.CoordMouseMode
coordFormatter, coordFormatterHandler, CoordFormatterProperty, infoDelegator
 
Fields inherited from class com.bbn.openmap.event.AbstractMouseMode
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
 
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
DefaultOverviewMouseMode(OverviewMapHandler omh)
          Construct a OverviewMouseMode.
 
Method Summary
protected  java.awt.Point getRatioPoint(MapBean map, java.awt.Point pt1, java.awt.Point pt2)
          Get the projection of the source map and the starting point of a box (pt1), look at pt2 to see if it represents the ratio of the projection map size.
 void mouseReleased(java.awt.event.MouseEvent e)
          Handle a mouseReleased MouseListener event.
 
Methods inherited from class com.bbn.openmap.event.NavMouseMode2
handleMouseReleased, paintRectangle
 
Methods inherited from class com.bbn.openmap.event.NavMouseMode
cleanUp, getProperties, getPropertyInfo, getRectAttributes, listenerPaint, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, setProperties, setRectAttributes
 
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.event.AbstractMouseMode
actAsProxyFor, actAsProxyFor, addMapMouseListener, addPropertyChangeListener, getClassToUseForIconRetrieval, getGUIIcon, getIconName, getID, getModeCursor, getMouseSupport, getMouseWheelTimerInterval, getNoMouseWheelListener, getPrettyName, getProxied, getProxyDistributionMask, isConsumeEvents, isMouseWheelListener, isNoMouseWheelListenerTimer, isProxyFor, isVisible, isZoomWhenMouseWheelUp, mouseWheelMoved, releaseProxy, removeAllMapMouseListeners, removeMapMouseListener, removePropertyChangeListener, setConsumeEvents, setGUIIcon, setIconName, setID, setModeCursor, setModeCursor, setMouseSupport, setMouseWheelListener, setMouseWheelTimerInterval, setNoMouseWheelListener, setNoMouseWheelListenerTimer, setPrettyName, setProxyDistributionMask, setVisible, setZoomWhenMouseWheelUp, updateMouseWheelMoved
 
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
 

Constructor Detail

DefaultOverviewMouseMode

public DefaultOverviewMouseMode(OverviewMapHandler omh)
Construct a OverviewMouseMode. Sets the ID of the mode to the modeID, the consume mode to true, and the cursor to the crosshair.

Method Detail

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Handle a mouseReleased MouseListener event. If there was no drag events, or if there was only a small amount of dragging between the occurrence of the mousePressed and this event, then recenter the source map. Otherwise we get the second corner of the navigation rectangle and try to figure out the best scale and location to zoom in to based on that rectangle.

Specified by:
mouseReleased in interface java.awt.event.MouseListener
Overrides:
mouseReleased in class NavMouseMode
Parameters:
e - MouseEvent to be handled

getRatioPoint

protected java.awt.Point getRatioPoint(MapBean map,
                                       java.awt.Point pt1,
                                       java.awt.Point pt2)
Get the projection of the source map and the starting point of a box (pt1), look at pt2 to see if it represents the ratio of the projection map size. If it doesn't, provide a point that does.

Overrides:
getRatioPoint in class NavMouseMode


Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details