## com.bbn.openmap.tools.drawing
Class OMDrawingToolMouseMode

    java.lang.Object
      com.bbn.openmap.MapHandlerChild
          com.bbn.openmap.OMComponent
              com.bbn.openmap.event.AbstractMouseMode
                  com.bbn.openmap.event.CoordMouseMode
                      com.bbn.openmap.tools.drawing.OMDrawingToolMouseMode

All Implemented Interfaces:
  java.beans.beancontext.BeanContextChild, java.beans.beancontext.BeanContextMembershipListener, java.util.EventListener, LightMapHandlerChild, MapMouseMode, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener, PaintListener, PropertyConsumer, java.io.Serializable

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 inherited from class com.bbn.openmap.event.AbstractMouseMode
`AbstractMouseMode.MouseWheelZoomEditor`

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
`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
`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
`createCoordinateInformationLine, findAndInit, findAndUndo, fireMouseLocation, getInfoDelegator, setActive, setInfoDelegator`

Methods inherited from class com.bbn.openmap.event.AbstractMouseMode

`actAsProxyFor, actAsProxyFor, addMapMouseListener, getClassToUseForIconRetrieval, getGUIIcon, getIconName, getID, getModeCursor, getMouseSupport, getPrettyName, getProperties, getPropertyInfo, getProxyDistributionMask, isConsumeEvents, isProxyFor, isVisible, isZoomWhenMouseWheelUp, listenerPaint, mouseWheelMoved, releaseProxy, removeAllMapMouseListeners, removeMapMouseListener, setConsumeEvents, setGUIIcon, setIconName, setID, setModeCursor, setModeCursor, setMouseSupport, setPrettyName, setProperties, setProxyDistributionMask, setVisible, setZoomWhenMouseWheelUp`

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

### 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