com.bbn.openmap.tools.drawing
Class OMDrawingToolMouseMode

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.tools.drawing.OMDrawingToolMouseMode
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 OMDrawingToolMouseMode
extends CoordMouseMode

The OMDrawingToolMouseMode is the MapMouseMode that handles the events for the OMDrawingTool.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.bbn.openmap.event.AbstractMouseMode
AbstractMouseMode.MouseWheelTimerListener
 
Field Summary
protected  OMDrawingTool drawingTool
           
static java.lang.String modeID
          Mouse Mode identifier, which is "Drawing Tool".
 
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
OMDrawingToolMouseMode()
          Construct an OMDrawingToolMouseMode.
OMDrawingToolMouseMode(OMDrawingTool omdt)
          Construct a OMDrawingToolMouseMode.
 
Method Summary
protected  EditableOMGraphic getCurrentGraphic()
          Get the EditableOMGraphic from the OMDrawingTool.
protected  OMDrawingTool getDrawingTool()
          Get the drawing tool for the mouse mode.
 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 mouseEntered(java.awt.event.MouseEvent e)
          Invoked when the mouse enters a component.
 void mouseExited(java.awt.event.MouseEvent e)
          Invoked when the mouse exits 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 setDrawingTool(OMDrawingTool omdt)
          Set the DrawingTool for the mouse mode.
 
Methods inherited from class com.bbn.openmap.event.CoordMouseMode
findAndInit, findAndUndo, fireMouseLocation, getCoordFormatter, getCoordFormatterHandler, getInfoDelegator, getProperties, getPropertyInfo, propertyChange, setActive, setCoordFormatter, setCoordFormatterHandler, setInfoDelegator, setProperties
 
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, listenerPaint, 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
 

Field Detail

modeID

public static final transient java.lang.String modeID
Mouse Mode identifier, which is "Drawing Tool".

See Also:
Constant Field Values

drawingTool

protected OMDrawingTool drawingTool
Constructor Detail

OMDrawingToolMouseMode

public OMDrawingToolMouseMode()
Construct an OMDrawingToolMouseMode. Sets the ID of the mode to the modeID, the consume mode to true.


OMDrawingToolMouseMode

public OMDrawingToolMouseMode(OMDrawingTool omdt)
Construct a OMDrawingToolMouseMode. Lets you set the consume mode. If the events are consumed, then a MouseEvent is sent only to the first MapMouseListener that successfully processes the event. If they are not consumed, then all of the listeners get a chance to act on the event.

Parameters:
omdt - the drawing tool for this mousemode
Method Detail

setDrawingTool

protected void setDrawingTool(OMDrawingTool omdt)
Set the DrawingTool for the mouse mode. Expected to be self-called by the mouse mode using the BeanContext.


getDrawingTool

protected OMDrawingTool getDrawingTool()
Get the drawing tool for the mouse mode.


getCurrentGraphic

protected EditableOMGraphic getCurrentGraphic()
Get the EditableOMGraphic from the OMDrawingTool. Returns null if anything isn't set up correctly.


mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Description copied from class: AbstractMouseMode
Invoked when a mouse button has been pressed on a component. Calls fiewMapMousePressed on the MouseSupport. Also requests focus on the source of the MouseEvent, so that key events can be processed.

Specified by:
mousePressed in interface java.awt.event.MouseListener
Overrides:
mousePressed in class AbstractMouseMode
Parameters:
e - MouseEvent

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Description copied from class: AbstractMouseMode
Invoked when a mouse button has been released on a component. Calls fireMapMouseReleased on the MouseSupport.

Specified by:
mouseReleased in interface java.awt.event.MouseListener
Overrides:
mouseReleased in class AbstractMouseMode
Parameters:
e - MouseEvent

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Description copied from class: AbstractMouseMode
Invoked when the mouse has been clicked on a component. Calls fireMapMouseClicked on MouseSupport.

Specified by:
mouseClicked in interface java.awt.event.MouseListener
Overrides:
mouseClicked in class AbstractMouseMode
Parameters:
e - MouseEvent

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Description copied from class: AbstractMouseMode
Invoked when the mouse enters a component. Calls fireMapMouseEntered on the MouseSupport.

Specified by:
mouseEntered in interface java.awt.event.MouseListener
Overrides:
mouseEntered in class AbstractMouseMode
Parameters:
e - MouseEvent

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Description copied from class: AbstractMouseMode
Invoked when the mouse exits a component. This does nothing. Extend this class to add functionality.

Specified by:
mouseExited in interface java.awt.event.MouseListener
Overrides:
mouseExited in class AbstractMouseMode
Parameters:
e - MouseEvent

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Description copied from class: CoordMouseMode
Fires a mouse location to the InformationDelegator, and then calls the super class method which calls the MouseSupport method.

Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener
Overrides:
mouseDragged in class CoordMouseMode
Parameters:
e - mouse event.

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Description copied from class: CoordMouseMode
Fires a mouse location to the InformationDelegator, and then calls the super class method which calls the MouseSupport method.

Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener
Overrides:
mouseMoved in class CoordMouseMode
Parameters:
e - MouseEvent to be handled


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