|
|||||||||||
| 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
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 Name
This class delegates much of the work of managing its listeners to
a MapMouseSupport object.
MapMouseSupport,
Serialized Form| Field Summary | |
protected java.awt.Cursor |
cursor
The cursor that appears on the map when this Mouse Mode is active. |
java.text.DecimalFormat |
df
|
protected javax.swing.Icon |
guiIcon
The Icon that can be used in a GUI. |
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 MapMouseSupport |
mouseSupport
The object used to handle the listeners and to pass out the event to the layers interesed in it. |
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 boolean |
visible
|
| 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 | |
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. |
javax.swing.Icon |
getGUIIcon()
Gets the Icon to represent the Mouse Mode in a GUI. |
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. |
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. |
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 |
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. |
void |
listenerPaint(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 |
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 |
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 |
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 |
setMouseSupport(MapMouseSupport support)
Set a MouseSupport explicitly. |
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. |
| 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, removePropertyChangeListener, removeVetoableChangeListener, setBeanContext |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.lang.String ID
protected MapMouseSupport mouseSupport
protected java.awt.Cursor cursor
protected transient javax.swing.Icon guiIcon
public transient java.text.DecimalFormat df
protected transient boolean visible
protected java.lang.String prettyName
public static final java.lang.String IDProperty
public static final java.lang.String PrettyNameProperty
| 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
MapMouseListeners| Method Detail |
public java.lang.String getID()
getID in interface MapMouseModepublic 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 MapMouseModepublic java.awt.Cursor getModeCursor()
getModeCursor in interface MapMouseModepublic void setModeCursor(java.awt.Cursor curs)
curs - the cursor that is recommended for use on the map
when this mouse mode is active.public javax.swing.Icon getGUIIcon()
getGUIIcon in interface MapMouseModepublic void setGUIIcon(javax.swing.Icon icon)
public void setConsumeEvents(boolean value)
value - true for limited distribution.public boolean isConsumeEvents()
public void addMapMouseListener(MapMouseListener l)
addMapMouseListener in interface MapMouseModel - the MapMouseListener to add.public void removeMapMouseListener(MapMouseListener l)
removeMapMouseListener in interface MapMouseModel - the MapMouseListener to remove.public void removeAllMapMouseListeners()
removeAllMapMouseListeners in interface MapMouseModepublic void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked in interface java.awt.event.MouseListenere - MouseEventpublic void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenere - MouseEventpublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenere - MouseEventpublic void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered in interface java.awt.event.MouseListenere - MouseEventpublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited in interface java.awt.event.MouseListenere - MouseEventpublic void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged in interface java.awt.event.MouseMotionListenere - MouseEventpublic void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved in interface java.awt.event.MouseMotionListenere - MouseEventpublic void setActive(boolean active)
setActive in interface MapMouseModeactive - 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 MapMouseModepublic void setVisible(boolean value)
public boolean actAsProxyFor(MapMouseMode mmm)
actAsProxyFor in interface MapMouseModemmm - the hidden MapMouseMode for this MapMouseMode to
send events to.
public boolean actAsProxyFor(MapMouseMode mmm,
int pdm)
actAsProxyFor in interface MapMouseModemmm - 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 MapMouseModepublic void releaseProxy()
releaseProxy in interface MapMouseModepublic void setProxyDistributionMask(int mask)
setProxyDistributionMask in interface MapMouseModefor definitions of mask bits.public int getProxyDistributionMask()
getProxyDistributionMask in interface MapMouseModefor definitions of mask bits.
public void setProperties(java.lang.String prefix,
java.util.Properties props)
OMComponent
setProperties in interface PropertyConsumersetProperties in class OMComponentprefix - the token to prefix the property namesprops - the Properties objectpublic java.util.Properties getProperties(java.util.Properties props)
OMComponent
getProperties in interface PropertyConsumergetProperties in class OMComponentprops - 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 PropertyConsumergetPropertyInfo in class OMComponentprops - a Properties object to load the PropertyConsumer
properties into. If getList equals null, then a new
Properties object should be created.
public void listenerPaint(java.awt.Graphics g)
listenerPaint in interface PaintListener
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||