com.bbn.openmap.event
Class OMMouseMode

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.OMMouseMode
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 OMMouseMode
extends CoordMouseMode

OMMouseMode is a combination of the PanMouseMode, NavMouseMode and SelectMouseMode. Press and drag to pan. Double click to re-center, CTRL double click to re-center and zoom. Shift-CTRL-Double click to center and zoom out. Double click to select OMGraphics. Right click for pop-up menu.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.bbn.openmap.event.AbstractMouseMode
AbstractMouseMode.MouseWheelTimerListener
 
Field Summary
static java.lang.String AZ_PANNING_PROPERTY
           
static java.lang.String AZ_PANNING_SHAPEFILE_PROPERTY
           
protected  java.lang.String coordString
           
static float DEFAULT_OPAQUENESS
           
static java.lang.String LEAVE_SHADOW_PROPERTY
           
static java.lang.String modeID
           
static java.lang.String OPAQUENESS_PROPERTY
           
 java.awt.geom.Point2D rPoint1
          rPoint1 is the anchor point of a line segment
 java.awt.geom.Point2D rPoint2
          rPoint2 is the new (current) point of a line segment
protected  BufferedMapBean theMap
           
static java.lang.String USE_CURSOR_PROPERTY
           
 
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
OMMouseMode()
           
 
Method Summary
 DrawingAttributes getAzDrawing()
           
 java.lang.String getAzPanningShapefile()
           
protected  BufferedMapBean getBufferedMapBean(java.awt.event.MouseEvent evt)
          Checks the MouseEvent to see if a BufferedMapBean can be found.
 float getOpaqueness()
           
 int getOX()
           
 int getOY()
           
 java.util.Properties getProperties(java.util.Properties props)
          PropertyConsumer method, to fill in a Properties object, reflecting the current values of the OMComponent.
 java.util.Properties getPropertyInfo(java.util.Properties props)
          Method to fill in a Properties object with values reflecting the properties able to be set on this PropertyConsumer.
 boolean isLeaveShadow()
           
 boolean isPanning()
           
 boolean isUseCursor()
           
 void listenerPaint(java.lang.Object source, java.awt.Graphics g)
          PaintListener method.
 void mouseClicked(java.awt.event.MouseEvent e)
          Invoked when the mouse has been clicked on a component.
 void mouseDragged(java.awt.event.MouseEvent arg0)
          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)
          Process a mouse pressed event.
 void mouseReleased(java.awt.event.MouseEvent arg0)
          Invoked when a mouse button has been released on a component.
 void setAzDrawing(DrawingAttributes azDrawing)
           
 void setAzPanningShapefile(java.lang.String azPanningShapefile)
           
 void setLeaveShadow(boolean leaveShadow)
           
 void setOpaqueness(float opaqueness)
           
 void setProperties(java.lang.String prefix, java.util.Properties props)
          Sets the properties for the OMComponent.
 void setUseCursor(boolean useCursor)
           
 
Methods inherited from class com.bbn.openmap.event.CoordMouseMode
findAndInit, findAndUndo, fireMouseLocation, getCoordFormatter, getCoordFormatterHandler, getInfoDelegator, mouseMoved, 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, mouseEntered, mouseExited, 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

OPAQUENESS_PROPERTY

public static final java.lang.String OPAQUENESS_PROPERTY
See Also:
Constant Field Values

LEAVE_SHADOW_PROPERTY

public static final java.lang.String LEAVE_SHADOW_PROPERTY
See Also:
Constant Field Values

USE_CURSOR_PROPERTY

public static final java.lang.String USE_CURSOR_PROPERTY
See Also:
Constant Field Values

AZ_PANNING_SHAPEFILE_PROPERTY

public static final java.lang.String AZ_PANNING_SHAPEFILE_PROPERTY
See Also:
Constant Field Values

AZ_PANNING_PROPERTY

public static final java.lang.String AZ_PANNING_PROPERTY
See Also:
Constant Field Values

DEFAULT_OPAQUENESS

public static final float DEFAULT_OPAQUENESS
See Also:
Constant Field Values

modeID

public static final transient java.lang.String modeID
See Also:
Constant Field Values

rPoint1

public java.awt.geom.Point2D rPoint1
rPoint1 is the anchor point of a line segment


rPoint2

public java.awt.geom.Point2D rPoint2
rPoint2 is the new (current) point of a line segment


theMap

protected BufferedMapBean theMap

coordString

protected java.lang.String coordString
Constructor Detail

OMMouseMode

public OMMouseMode()
Method Detail

isUseCursor

public boolean isUseCursor()
Returns:
Returns the useCursor.

setUseCursor

public void setUseCursor(boolean useCursor)
Parameters:
useCursor - The useCursor to set.

setProperties

public void setProperties(java.lang.String prefix,
                          java.util.Properties props)
Description copied from class: OMComponent
Sets the properties for the OMComponent.

Specified by:
setProperties in interface PropertyConsumer
Overrides:
setProperties in class CoordMouseMode
Parameters:
prefix - the token to prefix the property names
props - the Properties object

getProperties

public java.util.Properties getProperties(java.util.Properties props)
Description copied from class: OMComponent
PropertyConsumer method, to fill in a Properties object, reflecting the current values of the OMComponent. If the component has a propertyPrefix set, the property keys should have that prefix plus a separating '.' prepended to each property key it uses for configuration.

Specified by:
getProperties in interface PropertyConsumer
Overrides:
getProperties in class CoordMouseMode
Parameters:
props - a Properties object to load the PropertyConsumer properties into. If props equals null, then a new Properties object should be created.
Returns:
Properties object containing PropertyConsumer property values. If getList was not null, this should equal getList. Otherwise, it should be the Properties object created by the PropertyConsumer.

getPropertyInfo

public java.util.Properties getPropertyInfo(java.util.Properties props)
Description copied from class: OMComponent
Method to fill in a Properties object with values reflecting the properties able to be set on this PropertyConsumer. The key for each property should be the raw property name (without a prefix) with a value that is a String that describes what the property key represents, along with any other information about the property that would be helpful (range, default value, etc.). For Layer, this method should at least return the 'prettyName' property.

Specified by:
getPropertyInfo in interface PropertyConsumer
Overrides:
getPropertyInfo in class CoordMouseMode
Parameters:
props - a Properties object to load the PropertyConsumer properties into. If getList equals null, then a new Properties object should be created.
Returns:
Properties object containing PropertyConsumer property values. If getList was not null, this should equal getList. Otherwise, it should be the Properties object created by the PropertyConsumer.

getBufferedMapBean

protected BufferedMapBean getBufferedMapBean(java.awt.event.MouseEvent evt)
Checks the MouseEvent to see if a BufferedMapBean can be found.

Parameters:
evt - MouseEvent, or a MapMouseEvent
Returns:
BufferedMapBean, or null if source is not a BufferedMapBean.

listenerPaint

public void listenerPaint(java.lang.Object source,
                          java.awt.Graphics g)
PaintListener method.

Specified by:
listenerPaint in interface PaintListener
Overrides:
listenerPaint in class AbstractMouseMode
Parameters:
source - the source object, most likely the MapBean
g - java.awt.Graphics

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent arg0)
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:
arg0 - mouse event.
See Also:
The first click for drag, the image is generated. This image is redrawing when the mouse is move, but, I need to repain the original image.

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Process a mouse pressed event. Add the mouse location to the segment vector. Calculate the cumulative total distance.

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

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

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent arg0)
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:
arg0 - MouseEvent
See Also:
Make Pan event for the map.

isLeaveShadow

public boolean isLeaveShadow()

setLeaveShadow

public void setLeaveShadow(boolean leaveShadow)

getOpaqueness

public float getOpaqueness()

setOpaqueness

public void setOpaqueness(float opaqueness)

isPanning

public boolean isPanning()

getOX

public int getOX()
Returns:
the starting x pixel location of a drag.

getOY

public int getOY()
Returns:
the starting y pixel location of a drag.

getAzPanningShapefile

public java.lang.String getAzPanningShapefile()
Returns:
the azPanningShapefile

setAzPanningShapefile

public void setAzPanningShapefile(java.lang.String azPanningShapefile)
Parameters:
azPanningShapefile - the azPanningShapefile to set

getAzDrawing

public DrawingAttributes getAzDrawing()
Returns:
the azDrawing

setAzDrawing

public void setAzDrawing(DrawingAttributes azDrawing)
Parameters:
azDrawing - the azDrawing to set


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