edu.sc.seis.fissuresUtil.map.tools
Class OpenMapTool

java.lang.Object
  extended by edu.sc.seis.fissuresUtil.map.tools.OpenMapTool
All Implemented Interfaces:
com.bbn.openmap.event.MapMouseMode, com.bbn.openmap.event.PaintListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.util.EventListener
Direct Known Subclasses:
PanTool, ZoomTool

public abstract class OpenMapTool
extends java.lang.Object
implements com.bbn.openmap.event.MapMouseMode


Constructor Summary
OpenMapTool()
           
 
Method Summary
 boolean actAsProxyFor(com.bbn.openmap.event.MapMouseMode mmm)
          Request to have the MapMouseMode act as a proxy for a MapMouseMode that wants to remain hidden.
 boolean actAsProxyFor(com.bbn.openmap.event.MapMouseMode mmm, int pdm)
          Request to have the MapMouseMode act as a proxy for a MapMouseMode that wants to remain hidden.
 void addMapMouseListener(com.bbn.openmap.event.MapMouseListener l)
          Add a MapMouseListener to the MouseMode.
 javax.swing.Icon getGUIIcon()
          Gets the Icon to represent the Mouse Mode in a GUI.
 java.awt.Cursor getModeCursor()
           
 java.awt.Cursor getPressedCursor()
           
 int getProxyDistributionMask()
          Get the mask that dictates which events get sent to this support object's targets even if the parent mouse mode is acting as a proxy.
 boolean isActive()
           
 boolean isProxyFor(com.bbn.openmap.event.MapMouseMode mmm)
          Can check if the MapMouseMode is acting as a proxy for a MapMouseMode.
 boolean isVisible()
          Lets the MouseDelegator know if the MapMouseMode should be visible in the GUI, in order to create certain mouse modes that may be controlled by other tools.
 void listenerPaint(java.awt.Graphics graphics)
           
 void mouseClicked(java.awt.event.MouseEvent e)
          Invoked when the mouse button has been clicked (pressed and released) on a component.
 void 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(java.awt.event.MouseEvent e)
          Invoked when the mouse cursor has been moved onto a component but no buttons have been pushed.
 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.
 void releaseProxy()
          Release the proxy lock on the MapMouseMode.
 void removeAllMapMouseListeners()
          Remove all MapMouseListeners from the mode.
 void removeMapMouseListener(com.bbn.openmap.event.MapMouseListener l)
          Remove a MapMouseListener from the MouseMode.
 void setActive(boolean isActive)
           
 void setModeCursor(java.awt.Cursor cursor)
           
 void setPressedCursor(java.awt.Cursor cursor)
           
 void setProxyDistributionMask(int mask)
          Set the mask that dictates which events get sent to this support object's targets even if the parent mouse mode is acting as a proxy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.bbn.openmap.event.MapMouseMode
getID, getPrettyName
 

Constructor Detail

OpenMapTool

public OpenMapTool()
Method Detail

setActive

public void setActive(boolean isActive)
Specified by:
setActive in interface com.bbn.openmap.event.MapMouseMode

isActive

public boolean isActive()

getGUIIcon

public javax.swing.Icon getGUIIcon()
Gets the Icon to represent the Mouse Mode in a GUI.

Specified by:
getGUIIcon in interface com.bbn.openmap.event.MapMouseMode

getModeCursor

public java.awt.Cursor getModeCursor()
Specified by:
getModeCursor in interface com.bbn.openmap.event.MapMouseMode

getPressedCursor

public java.awt.Cursor getPressedCursor()

setModeCursor

public void setModeCursor(java.awt.Cursor cursor)

setPressedCursor

public void setPressedCursor(java.awt.Cursor cursor)

addMapMouseListener

public void addMapMouseListener(com.bbn.openmap.event.MapMouseListener l)
Add a MapMouseListener to the MouseMode.

Specified by:
addMapMouseListener in interface com.bbn.openmap.event.MapMouseMode
Parameters:
l - the MapMouseListener to add.

removeAllMapMouseListeners

public void removeAllMapMouseListeners()
Remove all MapMouseListeners from the mode.

Specified by:
removeAllMapMouseListeners in interface com.bbn.openmap.event.MapMouseMode

removeMapMouseListener

public void removeMapMouseListener(com.bbn.openmap.event.MapMouseListener l)
Remove a MapMouseListener from the MouseMode.

Specified by:
removeMapMouseListener in interface com.bbn.openmap.event.MapMouseMode
Parameters:
l - the MapMouseListener to remove.

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Invoked when the mouse button has been clicked (pressed and released) on a component.

Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Invoked when a mouse button is pressed on a component and then dragged. MOUSE_DRAGGED events will continue to be delivered to the component where the drag originated until the mouse button is released (regardless of whether the mouse position is within the bounds of the component).

Due to platform-dependent Drag&Drop implementations, MOUSE_DRAGGED events may not be delivered during a native Drag&Drop operation.

Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Invoked when the mouse cursor has been moved onto a component but no buttons have been pushed.

Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Invoked when the mouse enters a component.

Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Invoked when a mouse button has been released on a component.

Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Invoked when the mouse exits a component.

Specified by:
mouseExited in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Invoked when a mouse button has been pressed on a component.

Specified by:
mousePressed in interface java.awt.event.MouseListener

isVisible

public boolean isVisible()
Lets the MouseDelegator know if the MapMouseMode should be visible in the GUI, in order to create certain mouse modes that may be controlled by other tools.

Specified by:
isVisible in interface com.bbn.openmap.event.MapMouseMode

actAsProxyFor

public boolean actAsProxyFor(com.bbn.openmap.event.MapMouseMode mmm)
Request to have the MapMouseMode act as a proxy for a MapMouseMode that wants to remain hidden. Can be useful for directing events to one object. With this call, no events will be forwared to the proxy's target.

Specified by:
actAsProxyFor in interface com.bbn.openmap.event.MapMouseMode
Parameters:
mmm - the hidden MapMouseMode for this MapMouseMode to send events to.
Returns:
true if the proxy setup (essentially a lock) is successful, false if the proxy is already set up for another listener.

actAsProxyFor

public boolean actAsProxyFor(com.bbn.openmap.event.MapMouseMode mmm,
                             int pdm)
Request to have the MapMouseMode act as a proxy for a MapMouseMode that wants to remain hidden. Can be useful for directing events to one object.

Specified by:
actAsProxyFor in interface com.bbn.openmap.event.MapMouseMode
Parameters:
mmm - the hidden MapMouseMode for this MapMouseMode to send events to.
pdm - the proxy distribution mask to use, which lets this proxy notify its targets of events.
Returns:
true if the proxy setup (essentially a lock) is successful, false if the proxy is already set up for another listener.

isProxyFor

public boolean isProxyFor(com.bbn.openmap.event.MapMouseMode mmm)
Can check if the MapMouseMode is acting as a proxy for a MapMouseMode.

Specified by:
isProxyFor in interface com.bbn.openmap.event.MapMouseMode

releaseProxy

public void releaseProxy()
Release the proxy lock on the MapMouseMode.

Specified by:
releaseProxy in interface com.bbn.openmap.event.MapMouseMode

setProxyDistributionMask

public void setProxyDistributionMask(int mask)
Set the mask that dictates which events get sent to this support object's targets even if the parent mouse mode is acting as a proxy.

Specified by:
setProxyDistributionMask in interface com.bbn.openmap.event.MapMouseMode
See Also:
for definitions of mask bits.

getProxyDistributionMask

public int getProxyDistributionMask()
Get the mask that dictates which events get sent to this support object's targets even if the parent mouse mode is acting as a proxy.

Specified by:
getProxyDistributionMask in interface com.bbn.openmap.event.MapMouseMode
See Also:
for definitions of mask bits.

listenerPaint

public void listenerPaint(java.awt.Graphics graphics)
Specified by:
listenerPaint in interface com.bbn.openmap.event.PaintListener