com.bbn.openmap.layer.editor
Class EditorLayer

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--com.bbn.openmap.Layer
                          |
                          +--com.bbn.openmap.layer.OMGraphicHandlerLayer
                                |
                                +--com.bbn.openmap.layer.DrawingToolLayer
                                      |
                                      +--com.bbn.openmap.layer.editor.EditorLayer
All Implemented Interfaces:
java.awt.event.ActionListener, java.beans.beancontext.BeanContextChild, java.beans.beancontext.BeanContextMembershipListener, DrawingToolRequestor, java.util.EventListener, GestureResponsePolicy, java.awt.image.ImageObserver, java.awt.MenuContainer, ProjectionListener, ProjectionPainter, PropertyConsumer, java.io.Serializable, Tool

public class EditorLayer
extends DrawingToolLayer
implements Tool

The EditorLayer is a layer that provides a specific set of tools to modify a set of OMGraphics that represent specific types of objects. It has an EditorTool that controls what the interface looks like, and controls reception of the mouse events to direct their interpretation usefully. The EditorLayer can use the following property:

 
  
   # could be com.bbn.openmap.layer.editor.DrawingEditorTool, for instance
   editorLayer.editor=EditorTool class
   
  
 

See Also:
Serialized Form

Field Summary
protected  EditorTool editorTool
          The EditorTool controls the interface, and how OMGraphics are managed.
static java.lang.String EditorToolProperty
          The property to use of the EditorLayer doesn't really know what EditorTool it will have.
protected  EditorLayerMouseMode elmm
          The mouse mode used to direct mouse events to the editor.
 
Fields inherited from class com.bbn.openmap.layer.DrawingToolLayer
drawingTool, DTL_DEBUG, proxyMMM, showHints, ShowHintsProperty
 
Fields inherited from class com.bbn.openmap.layer.OMGraphicHandlerLayer
cancelled, CANCELLED_LOCK, consumeEvents, ConsumeEventsProperty, filter, layerWorker, LAYERWORKER_LOCK, mouseEventInterpreter, mouseModeIDs, MouseModesProperty, projectionChangePolicy, ProjectionChangePolicyProperty, renderPolicy, RenderPolicyProperty, selectedList
 
Fields inherited from class com.bbn.openmap.Layer
addAsBackground, AddAsBackgroundProperty, addToBeanContext, AddToBeanContextProperty, autoPalette, AutoPaletteProperty, beanContextChildSupport, DisplayPaletteCmd, DisplayPropertiesCmd, doHack, HidePaletteCmd, i18n, IDListeners, localHackList, lsListeners, palette, paletteListener, PrettyNameProperty, propertyPrefix, RedrawCmd, removable, RemovableProperty, RemoveableProperty, SWING_PACKAGE, windowSupport
 
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
EditorLayer()
           
 
Method Summary
 void drawingComplete(OMGraphic omg, OMAction action)
          DrawingToolRequestor method.
 void findAndInit(java.lang.Object someObj)
          Called by findAndInit(Iterator) so subclasses can find objects, too.
 void findAndUndo(java.lang.Object someObj)
          BeanContextMembershipListener method.
 java.awt.Container getFace()
          The tool's interface.
 java.lang.String getKey()
          The retrieval key for this tool.
 MapMouseInterpreter getMouseEventInterpreter()
          Get the interpreter used to field and interpret MouseEvents, thereby calling GestureResponsePolicy methods on this layer.
 EditorLayerMouseMode getMouseMode()
          Get and/or create the EditorLayerMouseMode that can be used specifically for this layer, used to capture the MapBean's MouseEvents when an EditorTool is invoked.
 java.lang.String[] getMouseModeIDsForEvents()
          This is the important method call that determines what MapMouseModes the interpreter for this layer responds to.
 void setKey(java.lang.String aKey)
          Set the retrieval key for this tool.
 void setMouseModeIDsForEvents(java.lang.String[] modes)
          Use this method to set which mouse modes this layer responds to.
 void setProperties(java.lang.String prefix, java.util.Properties props)
          Overrides the Layer setProperties method.
 void setVisible(boolean show)
          Part of a layer hack to notify the component listener when the component is hidden.
 
Methods inherited from class com.bbn.openmap.layer.DrawingToolLayer
edit, getDrawingTool, getGUI, getInfoText, getProxyMouseMode, getShowHints, getToolTipTextFor, isHighlightable, isSelectable, releaseProxyMouseMode, select, setDrawingTool, setProxyMouseMode, setShowHints, shouldEdit
 
Methods inherited from class com.bbn.openmap.layer.OMGraphicHandlerLayer
canSetList, copy, cut, deselect, doAction, doPrepare, filter, filter, filter, getConsumeEvents, getFilter, getItemsForMapMenu, getItemsForOMGraphicMenu, getLayerWorker, getList, getMapMouseListener, getProjectionChangePolicy, getProperties, getPropertyInfo, getRenderPolicy, getSelected, highlight, interrupt, isCancelled, isWorking, leftClick, mouseOver, paint, paste, prepare, projectionChanged, receivesMapEvents, renderDataForProjection, resetFiltering, setCancelled, setConsumeEvents, setFilter, setLayerWorker, setList, setMouseEventInterpreter, setProjectionChangePolicy, setRenderPolicy, supportsSQL, unhighlight, workerComplete
 
Methods inherited from class com.bbn.openmap.Layer
actionPerformed, addComponentListener, added, addInfoDisplayListener, addLayerStatusListener, addMouseListener, addVetoableChangeListener, childrenAdded, childrenRemoved, clearListeners, connectToBeanContext, createWindowSupport, finalize, findAndInit, fireHideToolTip, fireHideToolTip, firePaletteEvent, fireRequestBrowserContent, fireRequestBrowserContent, fireRequestCursor, fireRequestInfoLine, fireRequestInfoLine, fireRequestInfoLine, fireRequestMessage, fireRequestMessage, fireRequestToolTip, fireRequestToolTip, fireRequestToolTip, fireRequestToolTip, fireRequestURL, fireRequestURL, fireStatusUpdate, fireStatusUpdate, fireVetoableChange, getAddAsBackground, getAddToBeanContext, getBeanContext, getPackage, getPalette, getProjection, getPropertyPrefix, getWindowSupport, hidePalette, isRemovable, isRemoveable, notifyHideHack, removeComponentListener, removeConfirmed, removed, removeInfoDisplayListener, removeLayerStatusListener, removeVetoableChangeListener, repaint, resetPalette, setAddAsBackground, setAddToBeanContext, setBeanContext, setName, setPaletteVisible, setProjection, setProjection, setProperties, setPropertyPrefix, setRemovable, setRemoveable, setWindowSupport, showPalette
 
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

editorTool

protected EditorTool editorTool
The EditorTool controls the interface, and how OMGraphics are managed.


elmm

protected EditorLayerMouseMode elmm
The mouse mode used to direct mouse events to the editor.


EditorToolProperty

public static final java.lang.String EditorToolProperty
The property to use of the EditorLayer doesn't really know what EditorTool it will have. This property is used in setProperties if the EditorTool isn't already set. If you extend the EditorLayer and specifically set the EditorTool in the constructor, this property will be ignored.

See Also:
Constant Field Values
Constructor Detail

EditorLayer

public EditorLayer()
Method Detail

setProperties

public void setProperties(java.lang.String prefix,
                          java.util.Properties props)
Description copied from class: OMGraphicHandlerLayer
Overrides the Layer setProperties method. Also calls Layer's version. If the ProjectionChangePolicy and RenderPolicy objects are set programmatically and are PropertyConsumers, they will still have access to properties if this method is called. Their property prefix will be scoped as if the OMGraphicHandlerLayer had them created, with their prefix being prefix + . + PropertyChangePolicyProperty and prefix + . + RenderPolicyProperty.

Specified by:
setProperties in interface PropertyConsumer
Overrides:
setProperties in class DrawingToolLayer
Parameters:
prefix - the token to prefix the property names
props - the Properties object

getMouseMode

public EditorLayerMouseMode getMouseMode()
Get and/or create the EditorLayerMouseMode that can be used specifically for this layer, used to capture the MapBean's MouseEvents when an EditorTool is invoked. The EditorLayerMouseMode is invisible, meaning it won't show up in standard OpenMap GUI widgets as a viable MouseMode. It is expected that the EditorTool will compensate for displaying what is going on.

If the EditorLayerMouseMode isn't set programmatically, this method will create one with this layer's name as the mouse mode ID. If the layer's name hasn't been set, a temporary mouse mode will be returned, but with a somewhat random name that may not really work as expected. Once the layer's name gets set, however, a good, useable mouse mode will get picked up and used.


drawingComplete

public void drawingComplete(OMGraphic omg,
                            OMAction action)
DrawingToolRequestor method. It's actually pretty important to call EditorTool.drawingComplete() from here, too, if you create a subclass to EditorLayer. The EditorTool needs to know this to reset the drawing tool mouse mode, to get ready for another new OMGraphic if necessary.

Specified by:
drawingComplete in interface DrawingToolRequestor
Overrides:
drawingComplete in class DrawingToolLayer

findAndInit

public void findAndInit(java.lang.Object someObj)
Called by findAndInit(Iterator) so subclasses can find objects, too.

Overrides:
findAndInit in class DrawingToolLayer

findAndUndo

public void findAndUndo(java.lang.Object someObj)
Description copied from class: DrawingToolLayer
BeanContextMembershipListener method. Called when a new object is removed from the BeanContext of this object.

Overrides:
findAndUndo in class DrawingToolLayer

setMouseModeIDsForEvents

public void setMouseModeIDsForEvents(java.lang.String[] modes)
Description copied from class: OMGraphicHandlerLayer
Use this method to set which mouse modes this layer responds to. The array should contain the mouse mode IDs.

Overrides:
setMouseModeIDsForEvents in class OMGraphicHandlerLayer

getMouseModeIDsForEvents

public java.lang.String[] getMouseModeIDsForEvents()
Description copied from class: OMGraphicHandlerLayer
This is the important method call that determines what MapMouseModes the interpreter for this layer responds to. The MapMouseInterpreter calls this so it can respond to MouseDelegator queries. You can programmatically call setMouseModeIDsForEvents with the mode IDs to set these values, or set the mouseModes property for this layer set to a space-separated list of mode IDs.

Overrides:
getMouseModeIDsForEvents in class OMGraphicHandlerLayer

getMouseEventInterpreter

public MapMouseInterpreter getMouseEventInterpreter()
Get the interpreter used to field and interpret MouseEvents, thereby calling GestureResponsePolicy methods on this layer. It returns whatever has been set as the interpreter, which could be null.

Overrides:
getMouseEventInterpreter in class OMGraphicHandlerLayer

setVisible

public void setVisible(boolean show)
Part of a layer hack to notify the component listener when the component is hidden. These components don't receive the ComponentHidden notification. Remove when it works.

Overrides:
setVisible in class Layer

getFace

public java.awt.Container getFace()
The tool's interface. This is added to the tool bar.

Specified by:
getFace in interface Tool
Returns:
String The key for this tool.

getKey

public java.lang.String getKey()
The retrieval key for this tool. We use the property prefix for the key. If the property prefix is not set then the name is used, which may not be that unique.

Specified by:
getKey in interface Tool
Returns:
String The key for this tool.

setKey

public void setKey(java.lang.String aKey)
Set the retrieval key for this tool. This call sets the key used for the Tool interface method, which is generally the property prefix used for this layer. Do not use this lightly, since the ToolPanel may be expecting to find a key that is reflected in the openmap.properties file.

Specified by:
setKey in interface Tool
Parameters:
aKey - The key for this tool.


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