com.bbn.openmap.event
Class PanMouseMode

java.lang.Object
  extended bycom.bbn.openmap.MapHandlerChild
      extended bycom.bbn.openmap.OMComponent
          extended bycom.bbn.openmap.event.AbstractMouseMode
              extended bycom.bbn.openmap.event.CoordMouseMode
                  extended bycom.bbn.openmap.event.PanMouseMode
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, ProjectionListener, PropertyConsumer, java.io.Serializable

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 inherited from class com.bbn.openmap.event.AbstractMouseMode
AbstractMouseMode.MouseWheelZoomEditor
 
Field Summary
 float DEFAULT_OPAQUENESS
           
static java.lang.String LeaveShadowProperty
           
static java.lang.String modeID
           
static java.lang.String OpaquenessProperty
           
static java.lang.String UseCursorProperty
           
 
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
PanMouseMode()
           
 
Method Summary
 void createBuffers(int w, int h)
          Instanciates 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 createBuffersImpl(int w, int h)
          Instanciates new image buffers.
 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 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 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 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
createCoordinateInformationLine, findAndInit, findAndUndo, fireMouseLocation, getInfoDelegator, mouseMoved, setInfoDelegator
 
Methods inherited from class com.bbn.openmap.event.AbstractMouseMode
actAsProxyFor, actAsProxyFor, addMapMouseListener, getClassToUseForIconRetrieval, getGUIIcon, getIconName, getID, getModeCursor, getMouseSupport, getPrettyName, getProxyDistributionMask, isConsumeEvents, isProxyFor, isVisible, isZoomWhenMouseWheelUp, listenerPaint, mouseClicked, mouseEntered, mouseExited, mousePressed, mouseWheelMoved, releaseProxy, removeAllMapMouseListeners, removeMapMouseListener, setConsumeEvents, setGUIIcon, setIconName, setID, setModeCursor, setModeCursor, setMouseSupport, setPrettyName, 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

OpaquenessProperty

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

LeaveShadowProperty

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

UseCursorProperty

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

DEFAULT_OPAQUENESS

public 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

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 AbstractMouseMode

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 propery key it uses for configuration.

Specified by:
getProperties in interface PropertyConsumer
Overrides:
getProperties in class AbstractMouseMode

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 AbstractMouseMode

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.

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

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

createBuffers

public void createBuffers(int w,
                          int h)
Instanciates 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.

createBuffersImpl

protected void createBuffersImpl(int w,
                                 int h)
Instanciates 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