com.bbn.openmap.event
Class PanMouseMode

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.PanMouseMode
All Implemented Interfaces:
MapMouseMode, PaintListener, ProjectionListener, 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 PanMouseMode
extends CoordMouseMode
implements ProjectionListener

PanMouseMode it is a class for Pan operation on the visible map. This class show actual map in transparent mode. 25-feb-2005. There are a couple of properties that can be set in this mouse mode:

           # Floating number between 0-1, with 1 being opaque, default .5
           panmm.opaqueness=.5f
           # True/false, to leave old map up behind panned version.
           panmm.leaveShadow=true
 

Author:
cursor, Stephane Wasserhardt
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
           
static float DEFAULT_OPAQUENESS
           
static java.lang.String LEAVE_SHADOW_PROPERTY
           
static java.lang.String modeID
           
static java.lang.String OPAQUENESS_PROPERTY
           
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
PanMouseMode()
           
 
Method Summary
 void createBuffer(int w, int h)
          Instantiates new image buffers if needed.
This method is synchronized to avoid creating the images multiple times if width and height doesn't change.
protected  void createBufferImpl(int w, int h)
          Instantiates new image buffers.
 DrawingAttributes getAzDrawing()
           
 java.lang.String getAzPanningShapefile()
           
 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 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 arg0)
          Invoked when a mouse button has been pressed on a component.
 void mouseReleased(java.awt.event.MouseEvent arg0)
          Invoked when a mouse button has been released on a component.
 void projectionChanged(ProjectionEvent e)
          Invoked when there has been a fundamental change to the Map.
 void setActive(boolean val)
          If the MouseMode has been made inactive, clean out any input that might have been made to the info line.
 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, 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, mouseClicked, 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
Constructor Detail

PanMouseMode

public PanMouseMode()
Method Detail

setActive

public void setActive(boolean val)
Description copied from class: CoordMouseMode
If the MouseMode has been made inactive, clean out any input that might have been made to the info line.

Specified by:
setActive in interface MapMouseMode
Overrides:
setActive in class CoordMouseMode
Parameters:
val - true if the mode has been made active, false if it has been made inactive.

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.

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

mousePressed

public void mousePressed(java.awt.event.MouseEvent arg0)
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:
arg0 - MouseEvent

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 repaint the original image.

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()

getOY

public int getOY()

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

projectionChanged

public void projectionChanged(ProjectionEvent e)
Description copied from interface: ProjectionListener
Invoked when there has been a fundamental change to the Map.

Layers are expected to recompute their graphics (if this makes sense), and then repaint() themselves.

Specified by:
projectionChanged in interface ProjectionListener
Parameters:
e - ProjectionEvent

createBuffer

public void createBuffer(int w,
                         int h)
Instantiates new image buffers if needed.
This method is synchronized to avoid creating the images multiple times if width and height doesn't change.

Parameters:
w - mapBean's width.
h - mapBean's height.

createBufferImpl

protected void createBufferImpl(int w,
                                int h)
Instantiates new image buffers.

Parameters:
w - Non-zero mapBean's width.
h - Non-zero mapBean's height.


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