public class DemoLayer extends OMGraphicHandlerLayer implements DrawingToolRequestor
The DemoLayer has also been modified to demonstrate the first uses of the OMDrawingTool. The Palette has buttons that can be used to start the tool in several different ways.
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected DrawingTool |
drawingTool
Found in the findAndInit() method, in the MapHandler.
|
protected static java.lang.String |
externalKey
Used by geometries created in GUI for specify if the spatial filter is
for objects outside the drawn shape.
|
protected GraphicAttributes |
filterGA |
protected static java.lang.String |
internalKey
Used by geometries created in GUI for specify if the spatial filter is
for objects inside the drawn shape.
|
protected DrawingToolRequestor |
layer
Used by the internal ActionListeners for a callback, see getGUI().
|
protected javax.swing.JPanel |
legend |
protected OMGraphicList |
objects
This is a list to hold the non-changing OMGraphics to display on the
layer.
|
protected SymbolReferenceLibrary |
srl
Found in the findAndInit() method, in the MapHandler.
|
consumeEvents, ConsumeEventsProperty, filter, interruptable, InterruptableProperty, layerWorker, LAYERWORKER_LOCK, layerWorkerQueue, logger, mouseEventInterpreter, mouseModeIDs, MouseModesProperty, projectionChangePolicy, ProjectionChangePolicyProperty, renderPolicy, RenderPolicyProperty, selectedList, TransparencyProperty, wrapItUp
addAsBackground, AddAsBackgroundProperty, addToBeanContext, AddToBeanContextProperty, attributes, autoPalette, AutoPaletteProperty, beanContextChildSupport, coordTransform, DataPathPrefixProperty, DisplayPaletteCmd, DisplayPropertiesCmd, doHack, HidePaletteCmd, i18n, localHackList, maxScale, MaxScaleProperty, minScale, MinScaleProperty, palette, paletteListener, PrettyNameProperty, propertyPrefix, RedrawCmd, removable, RemovableProperty, SWING_PACKAGE, TransformProperty, windowSupport
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty
Constructor and Description |
---|
DemoLayer() |
Modifier and Type | Method and Description |
---|---|
void |
drawingComplete(OMGraphic omg,
OMAction action)
Called when the DrawingTool is complete, providing the layer with the
modified OMGraphic.
|
void |
findAndInit(java.lang.Object someObj)
Called when a component that is needed, and not available with an
appropriate iterator from the BeanContext.
|
void |
findAndUndo(java.lang.Object someObj)
BeanContextMembershipListener method.
|
DrawingTool |
getDrawingTool() |
protected GraphicAttributes |
getFilterGA() |
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.List<java.awt.Component> |
getItemsForMapMenu(MapMouseEvent me)
Return a JMenu with contents applicable to a pop-up menu for a location
over the map.
|
java.util.List<java.awt.Component> |
getItemsForOMGraphicMenu(OMGraphic omg)
Return a java.util.List containing input for a JMenu with contents
applicable to a pop-up menu for a location over an OMGraphic.
|
SymbolReferenceLibrary |
getSymbolReferenceLibrary() |
java.lang.String |
getToolTipTextFor(OMGraphic omg)
Query for what tooltip to display for an OMGraphic when the mouse is over
it.
|
OMGraphicList |
init() |
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.
|
void |
paint(java.awt.Graphics g)
The default action is to get the OMGraphicList and render it.
|
OMGraphicList |
prepare()
This is an important Layer method to override.
|
void |
select(OMGraphicList list)
Called if isSelectable(OMGraphic) was true, so the list has the
OMGraphic.
|
void |
setDrawingTool(DrawingTool dt) |
void |
setProperties(java.lang.String prefix,
java.util.Properties props)
Overrides the Layer setProperties method.
|
void |
setSymbolReferenceLibrary(SymbolReferenceLibrary library)
Set the MilStd2525 SymbolReferenceLibrary object used to create symbols.
|
actionPerformed, canSetList, copy, createLayerWorker, cut, deselect, dispose, doAction, doPrepare, filter, filter, filter, getConsumeEvents, getFilter, getLayerWorker, getList, getMapMouseListener, getMouseEventInterpreter, getMouseModeIDsForEvents, getProjectionChangePolicy, getProperties, getPropertyInfo, getRenderPolicy, getSelected, getTransparency, getTransparencyAdjustmentPanel, highlight, interrupt, isCancelled, isInterruptable, isWorking, leftClick, mouseOver, paste, projectionChanged, receivesMapEvents, renderDataForProjection, resetFiltering, setCancelled, setConsumeEvents, setFilter, setInterruptable, setLayerWorker, setList, setMouseEventInterpreter, setMouseModeIDsForEvents, setProjectionChangePolicy, setRenderPolicy, setTransparency, shouldWrapItUp, supportsSQL, unhighlight, workerComplete
addComponentListener, added, addInfoDisplayListener, addLayerStatusListener, addMouseListener, addVetoableChangeListener, childrenAdded, childrenRemoved, clearListeners, connectToBeanContext, createWindowSupport, disconnectFromBeanContext, finalize, findAndInit, fireHideToolTip, firePaletteEvent, fireRequestBrowserContent, fireRequestBrowserContent, fireRequestCursor, fireRequestInfoLine, fireRequestInfoLine, fireRequestInfoLine, fireRequestMessage, fireRequestMessage, fireRequestToolTip, fireRequestToolTip, fireRequestURL, fireRequestURL, fireStatusUpdate, fireStatusUpdate, fireVetoableChange, getAddAsBackground, getAddToBeanContext, getAttribute, getBeanContext, getCoordTransform, getIcon, getMaxScale, getMinScale, getPackage, getPalette, getProjection, getPropertyPrefix, getWindowSupport, hasGUI, hidePalette, isAutoPalette, isProjectionOK, isRemovable, notifyHideHack, prependDataPathPrefix, putAttribute, removeComponentListener, removeConfirmed, removed, removeInfoDisplayListener, removeLayerStatusListener, removeVetoableChangeListener, repaint, resetPalette, setAddAsBackground, setAddToBeanContext, setAutoPalette, setBeanContext, setCoordTransform, setIcon, setLayerProperties, setMaxScale, setMinScale, setName, setPaletteVisible, setProjection, setProjection, setProperties, setPropertyPrefix, setRemovable, setVisible, setWindowSupport, showPalette
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update, updateUI
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getName
protected javax.swing.JPanel legend
protected DrawingTool drawingTool
protected SymbolReferenceLibrary srl
protected final DrawingToolRequestor layer
protected static final java.lang.String internalKey
protected static final java.lang.String externalKey
protected GraphicAttributes filterGA
protected OMGraphicList objects
public void paint(java.awt.Graphics g)
OMGraphicHandlerLayer
paint
in class OMGraphicHandlerLayer
g
- java.awt.Graphics object to render OMGraphics into.public OMGraphicList init()
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 OMGraphicList prepare()
prepare
in class OMGraphicHandlerLayer
protected GraphicAttributes getFilterGA()
public java.awt.Component getGUI()
Layer
public DrawingTool getDrawingTool()
public void setDrawingTool(DrawingTool dt)
public void drawingComplete(OMGraphic omg, OMAction action)
drawingComplete
in interface DrawingToolRequestor
public void findAndInit(java.lang.Object someObj)
findAndInit
in class Layer
public void setSymbolReferenceLibrary(SymbolReferenceLibrary library)
library
- public SymbolReferenceLibrary getSymbolReferenceLibrary()
public void findAndUndo(java.lang.Object someObj)
findAndUndo
in class Layer
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 omg)
getToolTipTextFor
in interface GestureResponsePolicy
getToolTipTextFor
in class OMGraphicHandlerLayer
public void select(OMGraphicList list)
select
in interface GestureResponsePolicy
select
in class OMGraphicHandlerLayer
public java.util.List<java.awt.Component> getItemsForMapMenu(MapMouseEvent me)
OMGraphicHandlerLayer
getItemsForMapMenu
in interface GestureResponsePolicy
getItemsForMapMenu
in class OMGraphicHandlerLayer
me
- a MapMouseEvent describing the location over where the menu
items should apply, in case different options are appropriate for
different places.public java.util.List<java.awt.Component> getItemsForOMGraphicMenu(OMGraphic omg)
OMGraphicHandlerLayer
getItemsForOMGraphicMenu
in interface GestureResponsePolicy
getItemsForOMGraphicMenu
in class OMGraphicHandlerLayer
Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details