## com.bbn.openmap.graphicLoader
Class MMLGraphicLoader

    java.lang.Object
      com.bbn.openmap.MapHandlerChild
          com.bbn.openmap.OMComponent
              com.bbn.openmap.graphicLoader.AbstractGraphicLoader
                  com.bbn.openmap.graphicLoader.MMLGraphicLoader

All Implemented Interfaces:
  java.awt.event.ActionListener, java.beans.beancontext.BeanContextChild, java.beans.beancontext.BeanContextMembershipListener, java.util.EventListener, GraphicLoader, LightMapHandlerChild, MapMouseListener, PropertyConsumer

Direct Known Subclasses:
  LOSGraphicLoader, NetMapGraphicLoader, ScenarioGraphicLoader

public abstract class MMLGraphicLoader
extends AbstractGraphicLoader
implements MapMouseListener

The MMLGraphicLoader is an abstract GraphicLoader class that implements the MapMouseListener interface. It extends the AbstractGraphicLoader, so all of those features are included as well. These MapMouseListener methods are provided here as a convenience, so you don't have to write them all if you don't use them.

Field Summary

Fields inherited from class com.bbn.openmap.graphicLoader.AbstractGraphicLoader
`DO_NOT_UPDATE_TIMER, name, NameProperty, proj, receiver, timer, TimerCmd, updateInterval`

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
`MMLGraphicLoader()`
`MMLGraphicLoader(OMGraphicHandler receiver)`

Method Summary
`java.lang.String[]` `getMouseModeServiceList()` Return a list of the modes that are interesting to the MapMouseListener.
`boolean` `mouseClicked(java.awt.event.MouseEvent e)` Invoked when the mouse has been clicked on a component.
`boolean` `mouseDragged(java.awt.event.MouseEvent e)` Invoked when a mouse button is pressed on a component and then dragged.
`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()` Handle a mouse cursor moving without the button being pressed.
`boolean` `mouseMoved(java.awt.event.MouseEvent e)` Invoked when the mouse button has been moved on a component (with no buttons down).
`boolean` `mousePressed(java.awt.event.MouseEvent e)` Invoked when a mouse button has been pressed on a component.
`boolean` `mouseReleased(java.awt.event.MouseEvent e)` Invoked when a mouse button has been released on a component.

Methods inherited from class com.bbn.openmap.graphicLoader.AbstractGraphicLoader
`actionPerformed, createTimer, getGUI, getName, getProjection, getProperties, getPropertyInfo, getReceiver, getTimer, getUpdateInterval, manageGraphics, setName, setProjection, setProperties, setReceiver, setTimer, setUpdateInterval`

Methods inherited from class com.bbn.openmap.OMComponent
`getPropertyPrefix, setProperties, setPropertyPrefix`

Methods inherited from class com.bbn.openmap.MapHandlerChild
`addPropertyChangeListener, addVetoableChangeListener, childrenAdded, childrenRemoved, findAndInit, findAndInit, findAndUndo, firePropertyChange, fireVetoableChange, getBeanContext, removePropertyChangeListener, removeVetoableChangeListener, setBeanContext`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### MMLGraphicLoader

    public MMLGraphicLoader()

### MMLGraphicLoader

    public MMLGraphicLoader(OMGraphicHandler receiver)

Method Detail

### getMouseModeServiceList

    public java.lang.String[] getMouseModeServiceList()

  Return a list of the modes that are interesting to the MapMouseListener. The source MouseEvents will only get sent to the MapMouseListener if the mode is set to one that the listener is interested in. Layers interested in receiving events should register for receiving events in "select" mode: `

       return new String[] { SelectMouseMode.modeID };

  `

  ``
  Specified by:
    `getMouseModeServiceList` in interface `MapMouseListener`
  Returns:
    String[] of modeID's
  See Also:
    `NavMouseMode.modeID`, `SelectMouseMode.modeID`, `NullMouseMode.modeID`

### mousePressed

    public boolean mousePressed(java.awt.event.MouseEvent e)

  Invoked when a mouse button has been pressed on a component.

  Specified by:
    `mousePressed` in interface `MapMouseListener`
  Parameters:
    `e` - MouseEvent
  Returns:
    true if the listener was able to process the event.

### mouseReleased

    public boolean mouseReleased(java.awt.event.MouseEvent e)

  Invoked when a mouse button has been released on a component.

  Specified by:
    `mouseReleased` in interface `MapMouseListener`
  Parameters:
    `e` - MouseEvent
  Returns:
    true if the listener was able to process the event.

### mouseClicked

    public boolean mouseClicked(java.awt.event.MouseEvent e)

  Invoked when the mouse has been clicked on a component. The listener will receive this event if it successfully processed `mousePressed()`, or if no other listener processes the event. If the listener successfully processes `mouseClicked()`, then it will receive the next `mouseClicked()` notifications that have a click count greater than one.

  NOTE: We have noticed that this method can sometimes be erroneously invoked. It seems to occur when a light-weight AWT component (like an internal window or menu) closes (removes itself from the window hierarchy). A specific OpenMap example is when you make a menu selection when the MenuItem you select is above the MapBean canvas. After making the selection, the mouseClicked() gets invoked on the MouseDelegator, which passes it to the appropriate listeners depending on the MouseMode. The best way to avoid this problem is to not implement anything crucial in this method. Use a combination of `mousePressed()` and `mouseReleased()` instead.

  Specified by:
    `mouseClicked` in interface `MapMouseListener`
  Parameters:
    `e` - MouseEvent
  Returns:
    true if the listener was able to process the event.

### mouseEntered

    public void mouseEntered(java.awt.event.MouseEvent e)

  Invoked when the mouse enters a component.

  Specified by:
    `mouseEntered` in interface `MapMouseListener`
  Parameters:
    `e` - MouseEvent

### mouseExited

    public void mouseExited(java.awt.event.MouseEvent e)

  Invoked when the mouse exits a component.

  Specified by:
    `mouseExited` in interface `MapMouseListener`
  Parameters:
    `e` - MouseEvent

### mouseDragged

    public boolean mouseDragged(java.awt.event.MouseEvent e)

  Invoked when a mouse button is pressed on a component and then dragged. The listener will receive these events if it successfully processes mousePressed(), or if no other listener processes the event.

  Specified by:
    `mouseDragged` in interface `MapMouseListener`
  Parameters:
    `e` - MouseEvent
  Returns:
    true if the listener was able to process the event.

### mouseMoved

    public boolean mouseMoved(java.awt.event.MouseEvent e)

  Invoked when the mouse button has been moved on a component (with no buttons down).

  Specified by:
    `mouseMoved` in interface `MapMouseListener`
  Parameters:
    `e` - MouseEvent
  Returns:
    true if the listener was able to process the event.

### mouseMoved

    public void mouseMoved()

  Handle a mouse cursor moving without the button being pressed. This event is intended to tell the listener that there was a mouse movement, but that the event was consumed by another layer. This will allow a mouse listener to clean up actions that might have happened because of another motion event response.

  Specified by:
    `mouseMoved` in interface `MapMouseListener`

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