|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bbn.openmap.MapHandlerChild com.bbn.openmap.OMComponent com.bbn.openmap.event.AbstractMouseMode
public class AbstractMouseMode
Base class of the MouseModes. It takes care of the administrative aspects of being a mouse mode, but does not respond to MouseEvents.
The ID and pretty name can be set in the properties file.
# Name that layers use to get events from this mode mousemode.id=ID # Tooltip and Menu name for mode mousemode.prettyName=Display NameThis class delegates much of the work of managing its listeners to a MapMouseSupport object.
MapMouseSupport
,
Serialized FormNested Class Summary | |
---|---|
protected class |
AbstractMouseMode.MouseWheelTimerListener
The definition of the listener that calls updateMouseMoved when the timer goes off. |
Field Summary | |
---|---|
protected java.awt.Cursor |
cursor
The cursor that appears on the map when this Mouse Mode is active. |
static java.lang.String |
CursorIDProperty
The java.awt.Cursor id that should be used for the mouse mode. |
protected javax.swing.Icon |
guiIcon
The Icon that can be used in a GUI. |
protected java.lang.String |
iconName
|
static java.lang.String |
IconProperty
A property that lets you specify the resource to use for the icon for the MouseMode. |
protected java.lang.String |
ID
The identifier for the mode, which is also the name that will be used in a used interface describing the mode to a user. |
static java.lang.String |
IDProperty
The MouseModeID to use for a particular instance of a MapMouseMode. |
protected static java.util.logging.Logger |
logger
|
protected MapMouseSupport |
mouseSupport
The object used to handle the listeners and to pass out the event to the layers interested in it. |
protected javax.swing.Timer |
mouseTimer
The timer used to track the wait interval. |
protected boolean |
mouseWheelListener
|
static java.lang.String |
MouseWheelListenerProperty
A property that lets you turn off the mouse wheel listening functionality. |
protected int |
mouseWheelTimerInterval
The wait interval before a mouse wheel event gets triggered. |
static java.lang.String |
MouseWheelTimerIntervalProperty
A property that lets you set the wait interval before a mouse wheel event gets triggered. |
protected AbstractMouseMode.MouseWheelTimerListener |
mouseWheelTimerListener
The timer listener that calls updateMouseMoved. |
static java.lang.String |
MouseWheelZoomProperty
A property that lets you specify if the mode zooms in or out when the mouse wheel is rotated up. |
protected boolean |
noMouseWheelListenerTimer
|
static java.lang.String |
NoMouseWheelListenerTimerProperty
A property that lets you turn off the mouse wheel timer. |
protected java.lang.String |
prettyName
|
static java.lang.String |
PrettyNameProperty
The String to use for a key lookup in a Properties object to find the name to use in a GUI relating to this Mouse Mode. |
protected java.beans.PropertyChangeSupport |
propertyChangeSupport
|
protected boolean |
visible
|
static boolean |
ZOOM_IN
Zoom direction in when mouse wheel rotated up. |
static boolean |
ZOOM_OUT
Zoom direction out when mouse wheel rotated up. |
protected boolean |
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 | |
---|---|
AbstractMouseMode()
Construct an AbstractMouseMode. |
|
AbstractMouseMode(java.lang.String name,
boolean shouldConsumeEvents)
Construct an AbstractMouseMode. |
Method Summary | |
---|---|
boolean |
actAsProxyFor(MapMouseMode mmm)
Request to have the parent MapMouseMode act as a proxy for a MapMouseMode that wants to remain hidden. |
boolean |
actAsProxyFor(MapMouseMode mmm,
int pdm)
Request to have the MapMouseMode act as a proxy for a MapMouseMode that wants to remain hidden. |
void |
addMapMouseListener(MapMouseListener l)
Add a MapMouseListener to the MouseMode. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
The MapMouseMode should send out notifications when a proxy is added or removed. |
protected java.lang.Class<?> |
getClassToUseForIconRetrieval()
Internal callback method that lets subclasses override a class to use as a resource point for icon image retrieval. |
javax.swing.Icon |
getGUIIcon()
Gets the Icon to represent the Mouse Mode in a GUI. |
java.lang.String |
getIconName()
|
java.lang.String |
getID()
Returns the id (mode name). |
java.awt.Cursor |
getModeCursor()
Gets the mouse cursor recommended for use when this mouse mode is active. |
MapMouseSupport |
getMouseSupport()
Get the MouseSupport. |
int |
getMouseWheelTimerInterval()
|
boolean |
getNoMouseWheelListener()
|
java.lang.String |
getPrettyName()
Return a pretty name, suitable for the GUI. |
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. |
MapMouseMode |
getProxied()
Returns the MapMouseMode being held inside this mouse mode. |
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 |
isConsumeEvents()
Returns how the delegate (and it's mouse support) is set up to distribute events. |
boolean |
isMouseWheelListener()
Check setting for whether MouseMode responds to mouse wheel events. |
boolean |
isNoMouseWheelListenerTimer()
|
boolean |
isProxyFor(MapMouseMode mmm)
Can check if the MapMouseMode is acting as a proxy for another MapMouseMode. |
boolean |
isVisible()
Method to let the MouseDelegator know if the MapMouseMode should be visible, as opposed to a MapMouseMode that is being provided and controlled by another tool. |
boolean |
isZoomWhenMouseWheelUp()
|
void |
listenerPaint(java.lang.Object source,
java.awt.Graphics g)
PaintListener interface, notifying the MouseMode that the MapBean has repainted itself. |
void |
mouseClicked(java.awt.event.MouseEvent e)
Invoked when the mouse has been clicked 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 button has been moved on a component (with no buttons no down). |
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 |
mouseWheelMoved(java.awt.event.MouseWheelEvent e)
Invoked from the MouseWheelListener interface. |
void |
releaseProxy()
Release the proxy lock on the MapMouseMode. |
void |
removeAllMapMouseListeners()
Remove all MapMouseListeners from the mode. |
void |
removeMapMouseListener(MapMouseListener l)
Remove a MapMouseListener from the MouseMode. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
|
void |
setActive(boolean active)
Part of the MapMouseMode interface. |
void |
setConsumeEvents(boolean value)
Sets how the delegate passes out events. |
void |
setGUIIcon(javax.swing.Icon icon)
Set the icon that should be used for this Mouse Mode in a GUI. |
void |
setIconName(java.lang.String iName)
Sets the GUI icon based on the name of the resource provided. |
void |
setID(java.lang.String id)
Set the id (mode name). |
void |
setModeCursor(java.awt.Cursor curs)
Sets the cursor that is recommended for use on the map when this mouse mode is active. |
void |
setModeCursor(java.lang.String cursorID)
Sets the cursor that is recommended for use on the map when this mouse mode is active. |
void |
setMouseSupport(MapMouseSupport support)
Set a MouseSupport explicitly. |
void |
setMouseWheelListener(boolean mouseWheelListener)
Set whether MouseMode responds to mouse wheel events. |
void |
setMouseWheelTimerInterval(int interval)
Set the time interval that the mouse timer waits before calling upateMouseMoved. |
void |
setNoMouseWheelListener(boolean val)
|
void |
setNoMouseWheelListenerTimer(boolean noMouseWheelListenerTimer)
|
void |
setPrettyName(java.lang.String pn)
|
void |
setProperties(java.lang.String prefix,
java.util.Properties props)
Sets the properties for the OMComponent. |
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. |
void |
setVisible(boolean value)
Method to set if the MapMouseMode should be visible, as opposed to a MapMouseMode that is being provided and controlled by another tool. |
void |
setZoomWhenMouseWheelUp(boolean zoomWhenMouseWheelUp)
|
void |
updateMouseWheelMoved(MapBean mb,
float value)
Invoked from the MouseWheelListener interface. |
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, 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 |
---|
protected static java.util.logging.Logger logger
protected java.lang.String ID
protected MapMouseSupport mouseSupport
protected java.awt.Cursor cursor
protected transient javax.swing.Icon guiIcon
protected transient boolean visible
protected boolean mouseWheelListener
protected boolean noMouseWheelListenerTimer
protected java.lang.String prettyName
protected java.lang.String iconName
protected boolean zoomWhenMouseWheelUp
protected java.beans.PropertyChangeSupport propertyChangeSupport
public static final boolean ZOOM_IN
public static final boolean ZOOM_OUT
public static final java.lang.String IDProperty
public static final java.lang.String PrettyNameProperty
public static final java.lang.String CursorIDProperty
Cursor
,
Constant Field Valuespublic static final java.lang.String IconProperty
public static final java.lang.String MouseWheelZoomProperty
public static final java.lang.String MouseWheelListenerProperty
public static final java.lang.String NoMouseWheelListenerTimerProperty
public static final java.lang.String MouseWheelTimerIntervalProperty
protected int mouseWheelTimerInterval
protected javax.swing.Timer mouseTimer
protected AbstractMouseMode.MouseWheelTimerListener mouseWheelTimerListener
Constructor Detail |
---|
public AbstractMouseMode()
public AbstractMouseMode(java.lang.String name, boolean shouldConsumeEvents)
name
- the ID of the mode.shouldConsumeEvents
- if true, events are propagated to the first
MapMouseListener that successfully processes the event, if false,
events are propagated to all MapMouseListenersMethod Detail |
---|
protected java.lang.Class<?> getClassToUseForIconRetrieval()
public void setIconName(java.lang.String iName)
iName
- public java.lang.String getIconName()
public java.lang.String getID()
getID
in interface MapMouseMode
public void setID(java.lang.String id)
id
- string that identifies the delegate.public void setPrettyName(java.lang.String pn)
public java.lang.String getPrettyName()
getPrettyName
in interface MapMouseMode
public java.awt.Cursor getModeCursor()
getModeCursor
in interface MapMouseMode
public void setModeCursor(java.awt.Cursor curs)
curs
- the cursor that is recommended for use on the map when this
mouse mode is active.public void setModeCursor(java.lang.String cursorID)
cursorID
- the cursor ID member variable string, i.e. DEFAULT_CURSORCursor
public javax.swing.Icon getGUIIcon()
getGUIIcon
in interface MapMouseMode
public void setGUIIcon(javax.swing.Icon icon)
public void setConsumeEvents(boolean value)
value
- true for limited distribution.public boolean isConsumeEvents()
public boolean isZoomWhenMouseWheelUp()
public void setZoomWhenMouseWheelUp(boolean zoomWhenMouseWheelUp)
public void addMapMouseListener(MapMouseListener l)
addMapMouseListener
in interface MapMouseMode
l
- the MapMouseListener to add.public void removeMapMouseListener(MapMouseListener l)
removeMapMouseListener
in interface MapMouseMode
l
- the MapMouseListener to remove.public void removeAllMapMouseListeners()
removeAllMapMouseListeners
in interface MapMouseMode
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
e
- MouseEventpublic void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
e
- MouseEventpublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
e
- MouseEventpublic void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
e
- MouseEventpublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
e
- MouseEventpublic void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
e
- MouseEventpublic void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
e
- MouseEventpublic void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
mouseWheelMoved
in interface java.awt.event.MouseWheelListener
public void updateMouseWheelMoved(MapBean mb, float value)
public boolean isMouseWheelListener()
public void setMouseWheelListener(boolean mouseWheelListener)
mouseWheelListener
- public void setActive(boolean active)
setActive
in interface MapMouseMode
active
- true if the mode has been made active, false if it has been
made inactive.public void setMouseSupport(MapMouseSupport support)
support
- The new MapMouseSupport instancepublic MapMouseSupport getMouseSupport()
public boolean isVisible()
isVisible
in interface MapMouseMode
public void setVisible(boolean value)
public boolean actAsProxyFor(MapMouseMode mmm)
actAsProxyFor
in interface MapMouseMode
mmm
- the hidden MapMouseMode for this MapMouseMode to send events
to.
public boolean actAsProxyFor(MapMouseMode mmm, int pdm)
actAsProxyFor
in interface MapMouseMode
mmm
- the hidden MapMouseMode for this MapMouseMode to send events
to.pdm
- the proxy distribution mask to use, which lets this support
object notify its targets of events if the parent is acting as a
proxy.
public boolean isProxyFor(MapMouseMode mmm)
isProxyFor
in interface MapMouseMode
public void releaseProxy()
releaseProxy
in interface MapMouseMode
public void setProxyDistributionMask(int mask)
setProxyDistributionMask
in interface MapMouseMode
for definitions of mask bits.
public MapMouseMode getProxied()
getProxied
in interface MapMouseMode
public int getProxyDistributionMask()
getProxyDistributionMask
in interface MapMouseMode
for definitions of mask bits.
public void setProperties(java.lang.String prefix, java.util.Properties props)
OMComponent
setProperties
in interface PropertyConsumer
setProperties
in class OMComponent
prefix
- the token to prefix the property namesprops
- the Properties
objectpublic java.util.Properties getProperties(java.util.Properties props)
OMComponent
getProperties
in interface PropertyConsumer
getProperties
in class OMComponent
props
- a Properties object to load the PropertyConsumer properties
into. If props equals null, then a new Properties object should be
created.
public java.util.Properties getPropertyInfo(java.util.Properties props)
OMComponent
getPropertyInfo
in interface PropertyConsumer
getPropertyInfo
in class OMComponent
props
- a Properties object to load the PropertyConsumer properties
into. If getList equals null, then a new Properties object should
be created.
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
MapMouseMode
addPropertyChangeListener
in interface MapMouseMode
listener
- listener to notify.public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener
in interface MapMouseMode
public void listenerPaint(java.lang.Object source, java.awt.Graphics g)
listenerPaint
in interface PaintListener
source
- the source object, may be null, you need to check.g
- the graphics to paint into.public void setNoMouseWheelListener(boolean val)
public boolean getNoMouseWheelListener()
public void setMouseWheelTimerInterval(int interval)
public int getMouseWheelTimerInterval()
public boolean isNoMouseWheelListenerTimer()
public void setNoMouseWheelListenerTimer(boolean noMouseWheelListenerTimer)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |