|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
com.bbn.openmap.Layer
com.bbn.openmap.layer.OMGraphicHandlerLayer
com.bbn.openmap.layer.DrawingToolLayer
This layer can receive graphics from the OMDrawingToolLauncher, and also sent it's graphics to the OMDrawingTool for editing.
The projectionChanged() method is taken care of in the OMGraphicHandlerLayer superclass.
This class responds to all the properties that the OMGraphicHandlerLayer repsonds to, including the mouseModes property. If the mouseModes property isn't set, the SelectMouseMode.modeID mode ID is set. When the MapMouseInterpreter calls select(OMGraphic), the OMGraphic is passed to the DrawingTool. This class also responds to the showHints property (true by default), which dictates if tooltips and information delegator text is displayed when the layer's contents are moused over.
# Properties for DrawingToolLayer: drawingToolLayer.class=com.bbn.openmap.layer.DrawingToolLayer drawingToolLayer.prettyName=General Layer # optional flag to tell layer to display tooltip queues over it's OMGraphics drawingToolLayer.showHints=true # optional flag to specify file to store and read OMGraphics. A Save button # is available on the palette. If it's not specified and the Save button is # chosen, the user will queried for this location. drawingToolLayer.file=file to read OMGraphics from
Nested Class Summary |
Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
protected OMDrawingTool |
drawingTool
Get a handle on the DrawingTool. |
protected boolean |
DTL_DEBUG
|
protected java.lang.String[] |
fileName
The name of the file to read/save OMGraphics in. |
protected MapMouseMode |
proxyMMM
|
static java.lang.String |
SerializedURLNameProperty
A property to specify the file to use to read and save map objects in (file). |
protected boolean |
showHints
A flag to provide a tooltip over OMGraphics to click to edit. |
static java.lang.String |
ShowHintsProperty
A property that can control whether mouse events generate hints over map objects (showHints). |
Fields inherited from class com.bbn.openmap.layer.OMGraphicHandlerLayer |
consumeEvents, ConsumeEventsProperty, filter, interruptable, InterruptableProperty, layerWorker, LAYERWORKER_LOCK, mouseEventInterpreter, mouseModeIDs, MouseModesProperty, projectionChangePolicy, ProjectionChangePolicyProperty, renderPolicy, RenderPolicyProperty, selectedList, TransparencyProperty |
Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface com.bbn.openmap.PropertyConsumer |
EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
DrawingToolLayer()
|
Method Summary | |
protected void |
doIt()
|
void |
drawingComplete(OMGraphic omg,
OMAction action)
DrawingToolRequestor method. |
void |
edit(OMGraphic omg)
|
void |
findAndInit(java.lang.Object someObj)
Called by findAndInit(Iterator) so subclasses can find objects, too. |
void |
findAndUndo(java.lang.Object someObj)
BeanContextMembershipListener method. |
protected java.util.Vector |
getActions()
You can override this class if you want to provide more, fewer or different actions to the user. |
OMDrawingTool |
getDrawingTool()
|
java.lang.String |
getFileName()
|
java.awt.Component |
getGUI()
Gets the gui controls associated with the layer. |
java.lang.String |
getInfoText(OMGraphic omg)
Query for what text should be placed over the information bar when the mouse is over a particular OMGraphic. |
java.util.Properties |
getProperties(java.util.Properties props)
Overrides Layer getProperties method., also calls that method on Layer. |
java.util.Properties |
getPropertyInfo(java.util.Properties props)
Overrides Layer getProperties method., also calls that method on Layer. |
protected MapMouseMode |
getProxyMouseMode()
Get the ProxyMouseMode for the internal drawing tool, if there is one. |
boolean |
getShowHints()
|
java.lang.String |
getToolTipTextFor(OMGraphic omgr)
Query for what tooltip to display for an OMGraphic when the mouse is over it. |
boolean |
isHighlightable(OMGraphic omg)
Query that an OMGraphic can be highlighted when the mouse moves over it. |
boolean |
isSelectable(OMGraphic omg)
Query that an OMGraphic is selectable. |
OMGraphicList |
load()
Load the data from the file set in this layer. |
OMGraphicList |
prepare()
This is the main method you should be concerned with when overriding this class. |
void |
releaseProxyMouseMode()
If the DrawingToolLayer is using a hidden OMDrawingTool, release the proxy lock on the active MapMouseMode. |
void |
saveOMGraphics()
Get the current OMGraphicList and save it out to the file named in this class. |
void |
select(OMGraphicList omgl)
GestureResponsePolicy method. |
void |
setDrawingTool(OMDrawingTool dt)
|
void |
setProperties(java.lang.String prefix,
java.util.Properties props)
Overrides the Layer setProperties method. |
protected void |
setProxyMouseMode(MapMouseMode mmm)
Set the ProxyMouseMode for the internal drawing tool, if there is one. |
void |
setSFileName(java.lang.String serializedFile)
|
void |
setShowHints(boolean show)
A flag to provide a tooltip over OMGraphics to click to edit. |
boolean |
shouldEdit(OMGraphic omgr)
A method called from within different MapMouseListener methods to check whether an OMGraphic *should* be edited if the OMDrawingTool is able to edit it. |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update, updateUI |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.bbn.openmap.tools.drawing.DrawingToolRequestor |
getName |
Methods inherited from interface java.beans.beancontext.BeanContextChild |
addPropertyChangeListener, removePropertyChangeListener |
Field Detail |
protected OMDrawingTool drawingTool
protected boolean showHints
public static final java.lang.String ShowHintsProperty
public static final java.lang.String SerializedURLNameProperty
protected java.lang.String[] fileName
protected boolean DTL_DEBUG
protected MapMouseMode proxyMMM
Constructor Detail |
public DrawingToolLayer()
Method Detail |
public void setProperties(java.lang.String prefix, java.util.Properties props)
OMGraphicHandlerLayer
setProperties
in interface PropertyConsumer
setProperties
in class OMGraphicHandlerLayer
prefix
- the token to prefix the property namesprops
- the Properties
objectpublic java.util.Properties getProperties(java.util.Properties props)
OMGraphicHandlerLayer
getProperties
in interface PropertyConsumer
getProperties
in class OMGraphicHandlerLayer
public java.util.Properties getPropertyInfo(java.util.Properties props)
OMGraphicHandlerLayer
getPropertyInfo
in interface PropertyConsumer
getPropertyInfo
in class OMGraphicHandlerLayer
public OMGraphicList prepare()
OMGraphicHandlerLayer
This method will be called in a separate thread if doPrepare() is called on the layer. This will automatically cause repaint() to be called, which lets java know to call paint() on this class.
Note that the default action of this method is to get the OMGraphicList as it is currently set in the layer, reprojects the list with the current projection (calls generate() on them), and then returns the current list.
If your layer needs to change what is on the list based on what the current projection is, you can either clear() the list yourself and add new OMGraphics to it (remember to call generate(Projection) on them), and return the list. You also have the option of setting a ListResetPCPolicy, which will automatically set the list to null when the projection changes before calling this method. The OMGraphicHandlerList will ignore a null OMGraphicList.
NOTE: If you call prepare directly, you may need to call repaint(), too. With all invocations of this method that are cause by a projection change, repaint() will be called for you. The method is synchronized in case renderDataForProjection() gets called while in the middle of this method. For a different projection, that would be bad.
prepare
in class OMGraphicHandlerLayer
public OMDrawingTool getDrawingTool()
public void setDrawingTool(OMDrawingTool dt)
public void drawingComplete(OMGraphic omg, OMAction action)
drawingComplete
in interface DrawingToolRequestor
public void releaseProxyMouseMode()
public void findAndInit(java.lang.Object someObj)
findAndInit
in class Layer
public void findAndUndo(java.lang.Object someObj)
findAndUndo
in class Layer
protected void setProxyMouseMode(MapMouseMode mmm)
protected MapMouseMode getProxyMouseMode()
public boolean shouldEdit(OMGraphic omgr)
By default, this method always returns true because the DrawingToolLayer always thinks the OMGraphic should be edited.
public java.awt.Component getGUI()
Layer
getGUI
in class Layer
protected void doIt()
protected java.util.Vector getActions()
public void saveOMGraphics()
public OMGraphicList load()
public void setShowHints(boolean show)
public boolean getShowHints()
public boolean isHighlightable(OMGraphic omg)
isHighlightable
in interface GestureResponsePolicy
isHighlightable
in class OMGraphicHandlerLayer
public boolean isSelectable(OMGraphic omg)
isSelectable
in interface GestureResponsePolicy
isSelectable
in class OMGraphicHandlerLayer
public java.lang.String getInfoText(OMGraphic omg)
getInfoText
in interface GestureResponsePolicy
getInfoText
in class OMGraphicHandlerLayer
public java.lang.String getToolTipTextFor(OMGraphic omgr)
getToolTipTextFor
in interface GestureResponsePolicy
getToolTipTextFor
in class OMGraphicHandlerLayer
public void select(OMGraphicList omgl)
select
in interface GestureResponsePolicy
select
in class OMGraphicHandlerLayer
public void edit(OMGraphic omg)
public java.lang.String getFileName()
public void setSFileName(java.lang.String serializedFile)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |