|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel com.bbn.openmap.gui.OMComponentPanel com.bbn.openmap.gui.OMToolComponent com.bbn.openmap.tools.drawing.OMDrawingTool
public class OMDrawingTool
The OMDrawingTool implements the DrawingTool interface, and can be used to adjust the drawing parameters of OMGraphics. It is basically a manager for directing MouseEvents and MouseMotionEvents from a Component to a EditableOMGraphic. The EditableOMGraphic is responsible for interpreting the events and making the adjustments to the OMGraphic it has wrapped within. The OMDrawingTool also tries to keep the presentation of the OMGraphic up to date, by managing the repaints of the Component to include the graphic being modified.
The OMDrawingTool is also a com.bbn.openmap.gui.Tool, which allows it to appear in the OpenMap toolbar. The OMDrawingTool keeps track of whether it is a tool, and appears accordingly:
If the OMDrawingTool is being used as a tool (getUseAsTool() == true), then it will set itself to be visible. If you are putting an OMDrawingTool in the OpenMap application and you want the color/line/graphic options to be visible in the toolbar, use the itTool property for the OMDrawingTool in the properties file. If you are using your own OMDrawingTool, in your EditorLayerTool for instance, you should set useAsTool(true) programmatically to get the visibility of the tool to appear. There is a property to tell the OMDrawingTool to be visible when it is inactive, and that flag is true by default. You can set that property (visibleWhenInactive) to change this behavior. If the OMDrawingTool is not being used as a tool, it can be brought up in a window. This window can be brought up with a right click or control-click on the object being edited.
If the OMGraphic being edited doesn't want to have the OMDrawingTool visible, it won't be. Neither the tool nor the option to bring the window up won't be displayed with a right/control click.
The OMDrawingTool uses a behavior mask to give control over how it behaves. You can control if the attribute palette appears, if a popup gui appears by default when the editing is complete, or appear when the alt+mouse key or right mouse key is pressed. You should set this mask if you are not sure about the values that other components may have set on the OMDrawingTool.
The OMDrawingTool uses EditToolLoaders to determine what EditableOMGraphic can be used for a particular class name or OMGraphic type. If a loader for an OMGraphic type is not found, then that OMGraphic type won't be handled, and the tool will react to a create() or edit() call with a null object pointer. If a loader is found, and the OMgraphic can be edited or modified, then the create() or edit() methods will return a pointer to the OMGraphic being modified.
The GUI for the OMDrawingTool is multi-layered. The OMDrawingTool contains a GraphicsAttributes object, which is an extension of the GraphicAttributes object. The GraphicAttributes GUI within the tool lets you change the colors, line width and line dash pattern of the current OMGraphic. The GraphicAttributes contribution to the GUI is not yet implemented, but will let you change the render type and line type of the OMGraphic. Finally, the EditableOMGraphic is given an opportunity to change and set parameters of the OMGraphic that is knows about - for instance, the EditableOMLine object will soon provide an interface to set arrowheads on the lines, as well as set the amount of arc a line has (it's currently not implemented).
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
javax.swing.JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected boolean |
activated
Just a helper flag to reduce work caused by unnecessary deactivate calls. |
protected boolean |
allowDrawingToolToDeactivateItself
Flag to allow drawing tool to sense when an OMGraphic is clicked off and deactivate. |
static int |
ALT_POPUP_BEHAVIOR_MASK
Allow a GUI popup to appear over the map when the gesturing/modifications appear to be over, and when the ctrl key or right mouse button is pressed. |
protected int |
behaviorMask
A integer that is looked at, bitwise, to determine different behaviors. |
static java.lang.String |
BehaviorProperty
The property list defining behavior mask values that should be set. |
protected javax.swing.JComponent |
canvas
The JComponent the drawing tool is servicing, usually the MapBean. |
protected EditableOMGraphic |
currentEditable
The current graphic being modified. |
static int |
DEACTIVATE_ASAP_BEHAVIOR_MASK
This behavior is used internally, when the OMDrawingTool should be told to clean up as soon as it is safe. |
protected boolean |
DEBUG
Debug flag turned on when drawingtool debug flag enabled. |
static int |
DEFAULT_BEHAVIOR_MASK
A convenience value that tells the OMDrawingTool to show the GUI if it is a tool, or to only display the popup with the ctrl key or right mouse button if it isn't. |
protected OMDrawingToolMouseMode |
dtmm
The MouseMode used for the drawing tool. |
protected MapMouseMode |
formerMouseMode
A placeholder for the last mouse mode active before the drawing tool took over. |
protected GraphicAttributes |
graphicAttributes
A GraphicAttributes object that describes the current coloring parameters for the current graphic. |
static int |
GUI_VIA_POPUP_BEHAVIOR_MASK
A behavior mask to add a menu item to the popup that will allow the GUI to appear. |
protected InformationDelegator |
informationDelegator
A handle to the InformationDelegator to use for status messages. |
protected java.util.Hashtable |
loaders
The objects that know how to create a EditableOMGraphic for a particular class name or OMGraphic. |
static java.lang.String |
LoadersProperty
Used for property change notifications. |
protected MouseDelegator |
mouseDelegator
The MouseDelegator to use to get mouse events directed to the DrawingTool. |
static int |
PASSIVE_MOUSE_EVENT_BEHAVIOR_MASK
Set the flag for the behavior that will tell the OMDrawingTool to *NOT* add the OMDrawingToolMouseMode to the MouseDelegator as the active mouse mode when activated. |
protected java.util.Vector |
possibleEditableClasses
A Vector of Classes that can be handled by the OMDrawingTool. |
protected Projection |
projection
The current projection. |
static int |
QUICK_CHANGE_BEHAVIOR_MASK
A convenience value that tells the OMDrawingTool to not show the GUI, but show the popup with the alt key, and the popup has the ability to delete the OMGraphic. |
protected java.util.Vector |
rawLoaders
The ordered list of EditToolLoaders, for notification. |
protected DrawingToolRequestor |
requestor
The component to notify when the drawing tool is finished. |
protected boolean |
resetGUIWhenDeactivated
Flag to tell tool to reset the GUI when it is deactivated. |
protected SelectionSupport |
selectionSupport
A support object to handle telling listeners that the drawing tool is in the process of editing an object, hence making it selected. |
static int |
SHOW_GUI_BEHAVIOR_MASK
A behavior mask to show the GUI for the OMDrawingTool. |
protected UndoStack |
undoStack
The stack for keeping track of edits and allowing them to be reverted. |
protected UndoMenuItemStackTrigger |
undoTrigger
|
static int |
USE_POPUP_BEHAVIOR_MASK
Flag to tell the OMDrawingTool to display a popup when gesturing/modifications appear to be over. |
protected boolean |
visibleWhenInactive
Tell the drawing tool to be invisible when it is inactive. |
static java.lang.String |
VisibleWhenInactiveProperty
The property, visibleWhenIactive, to set to false if you want that behavior. |
Fields inherited from class com.bbn.openmap.gui.OMToolComponent |
---|
c, defaultKey, gridbag, key, useAsTool, UseAsToolProperty |
Fields inherited from class com.bbn.openmap.gui.OMComponentPanel |
---|
beanContextChildSupport, i18n, isolated, orientation, propertyPrefix, 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 | |
---|---|
OMDrawingTool()
Create a OpenMap Drawing Tool. |
Method Summary | |
---|---|
protected void |
activate()
Turn the OMDrawingTool on, attaching it to the MouseDelegator or the canvas component it is assigned to. |
protected void |
activate(boolean completeHookup)
Turn the OMDrawingTool on with the caveat that the OMDrawingTool may be active already, and that a complete hookup may not be needed. |
void |
addLoader(EditToolLoader loader)
Add an EditToolLoader to the Hashtable of loaders that the OMDrawingTool can use to create/modify OMGraphics. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Make sure that new property change listeners receive a current list of edit tool loaders. |
void |
addSelectionListener(SelectionListener list)
|
boolean |
canEdit(java.lang.Class omgc)
Return true if the OMDrawingTool can edit the OMGraphic. |
void |
clearSelectionListeners()
|
OMGraphic |
create(java.lang.String classname,
DrawingToolRequestor requestor)
Create a new OMGraphic, encased in a new EditableOMGraphic that can modify it. |
OMGraphic |
create(java.lang.String classname,
GraphicAttributes ga,
DrawingToolRequestor requestor)
Create a new OMGraphic, encased in a new EditableOMGraphic that can modify it. |
OMGraphic |
create(java.lang.String classname,
GraphicAttributes ga,
DrawingToolRequestor requestor,
boolean showGUI)
Create a new OMGraphic, encased in a new EditableOMGraphic that can modify it. |
protected OMDrawingToolMouseMode |
createMouseMode()
Create the mouse mode used with the drawing tool. |
javax.swing.JPopupMenu |
createPopupMenu()
|
void |
deactivate()
Turn the drawing tool off, disconnecting it from the MouseDelegator or canvas component, and removing the palette. |
void |
deactivate(int actionToDoWithOMGraphic)
Turn the drawing tool off, disconnecting it from the MouseDelegator or canvas component, and removing the palette. |
void |
deselect(OMGraphic omg)
|
protected boolean |
doPopup(int x,
int y,
java.util.List additionalOptions)
|
OMGraphic |
edit(EditableOMGraphic eomg,
DrawingToolRequestor requestor)
Given an EditableOMGraphic, use it to make modifications, and then call requestor.drawingComplete(). |
OMGraphic |
edit(EditableOMGraphic eomg,
DrawingToolRequestor requestor,
java.awt.event.MouseEvent e)
A slightly different edit method, where the EditableOMGraphic is put directly into edit mode, and the mouse events immediately start making modifications to the OMGraphic. |
OMGraphic |
edit(OMGraphic g,
DrawingToolRequestor requestor)
Given an OMGraphic, wrap it in the applicable EditableOMGraphic, allow the user to make modifications, and then call requestor.drawingComplete(). |
OMGraphic |
edit(OMGraphic g,
DrawingToolRequestor requestor,
boolean showGUI)
Given an OMGraphic, wrap it in the applicable EditableOMGraphic, allow the user to make modifications, and then call requestor.drawingComplete(). |
OMGraphic |
edit(OMGraphic g,
DrawingToolRequestor requestor,
java.awt.event.MouseEvent e)
A slightly different edit method, where the EditableOMGraphic is put directly into edit mode, and the mouse events immediately start making modifications to the OMGraphic. |
void |
eomgChanged(EOMGEvent event)
This is a EOMGListener method, and gets called by the EditableOMGraphic when something changes. |
void |
findAndInit(java.lang.Object someObj)
Called from the findAndInit(Iterator) method, when objects are added to the MapHandler. |
void |
findAndUndo(java.lang.Object someObj)
Called by childrenRemoved, it provides a good method for handling any object you may want to take away from the OMDrawingTool. |
protected void |
generateOMGraphic(OMGraphic g)
If the projection is not null, generate the OMGraphic. |
GraphicAttributes |
getAttributes()
Get the DrawingAttributes driving the parameters of the current graphic. |
int |
getBehaviorMask()
A integer that is looked at internally, bitwise, to determine different behaviors. |
javax.swing.JComponent |
getCanvas()
Get the JComponent this thing is directing events for. |
EditableOMGraphic |
getCurrentEditable()
Get the current EditableOMGraphic being used by the drawing tool. |
java.awt.Cursor |
getCursor()
|
EditableOMGraphic |
getEditableGraphic(OMGraphic g)
Given an OMGraphic, check the EditToolLoaders and wrap it in an EditableOMGraphic. |
EditableOMGraphic |
getEditableGraphic(java.lang.String classname,
GraphicAttributes ga)
Given a classname, check the EditToolLoaders and create the OMGraphic it represents wrapped in an EditableOMGraphic. |
java.awt.Component |
getGUI()
Get the GUI that dictates what the OMDrawingTool has control over. |
InformationDelegator |
getInformationDelegator()
|
EditToolLoader[] |
getLoaders()
Get all the loaders the OMDrawingTool has access to. |
MouseDelegator |
getMouseDelegator()
Get the MouseDelegator used to receive mouse events. |
OMDrawingToolMouseMode |
getMouseMode()
If you want to run the drawing tool in passive mode, you'll need a handle on the mouseMode to feed events to. |
Projection |
getProjection()
Get the current projection, if one has been provided. |
void |
hidePalette()
Hide the OMDrawingTool palette. |
boolean |
isActivated()
Convenience function to tell if the OMDrawingTool is currently working on an OMGraphic. |
boolean |
isAllowDrawingToolToDeactivateItself()
|
boolean |
isEditing(OMGraphic omg)
Returns true of the OMGraphic is being edited, or is on an EditableOMGraphicList being manipulated. |
boolean |
isMask(int mask)
Return whether a mask value is set in the internal value. |
void |
listenerPaint(java.lang.Object source,
java.awt.Graphics g)
PaintListener interface. |
static void |
main(java.lang.String[] args)
|
void |
notifyListener(OMGraphic graphic,
OMAction action)
Notify the listener of an action to a graphic. |
void |
projectionChanged(ProjectionEvent e)
ProjectionListener method. |
void |
propertyChange(java.beans.PropertyChangeEvent pce)
PropertyChangeListener method. |
void |
removeLoader(EditToolLoader loader)
Remove an EditToolLoader from the Hashtable of loaders that the OMDrawingTool can use to create/modify OMGraphics. |
void |
removeSelectionListener(SelectionListener list)
|
void |
resetBehaviorMask()
Set the behavior mask to the default. |
void |
resetGUIWhenDeactivated(boolean value)
|
boolean |
select(OMGraphic omg,
DrawingToolRequestor req,
java.awt.event.MouseEvent e)
|
void |
setAllowDrawingToolToDeactivateItself(boolean allow)
|
void |
setAttributes(GraphicAttributes da)
Set the GraphicAttributes object used to fill the OMGraphic java.awt.Graphics parameters. |
void |
setBehaviorMask(int mask)
A integer that is looked at internally, bitwise, to determine different behaviors. |
void |
setCanvas(javax.swing.JComponent can)
Set the JComponent this thing is directing events for. |
boolean |
setCurrentEditable(EditableOMGraphic eomg)
Set the EditableOMGraphic being used, if it hasn't already been set. |
void |
setCursor(java.awt.Cursor cursor)
|
void |
setInformationDelegator(InformationDelegator id)
|
void |
setLoaders(EditToolLoader[] etls)
Set the loaders that the OMDrawingTool has access to. |
int |
setMask(int mask)
Set a particular mask bit in the internal value. |
void |
setMouseDelegator(MouseDelegator md)
Set the MouseDelegator used to receive mouse events. |
void |
setMouseMode(OMDrawingToolMouseMode adtmm)
If you need your OMDrawingToolMouseMode to do something a little different, you can substitute your subclass here. |
void |
setProjection(Projection proj)
Set the current projection. |
void |
setProperties(java.lang.String prefix,
java.util.Properties props)
Sets the properties for the OMComponent. |
void |
setRemarks(java.lang.String message)
Put the message in a display line that the OMDrawingTool is using. |
void |
showInWindow()
|
void |
showPalette()
Display the palette. |
int |
unsetMask(int mask)
Unset a particular mask bit in the internal value. |
Methods inherited from class com.bbn.openmap.gui.OMToolComponent |
---|
add, createLayout, getFace, getGridBagConstraints, getKey, getProperties, getPropertyInfo, getUseAsTool, setKey, setUseAsTool |
Methods inherited from class com.bbn.openmap.gui.OMComponentPanel |
---|
addVetoableChangeListener, childrenAdded, childrenRemoved, findAndInit, fireVetoableChange, getBeanContext, getOrientation, getPropertyPrefix, getWindowSupport, isIsolated, removeVetoableChangeListener, setBeanContext, setIsolated, setOrientation, setProperties, setPropertyPrefix, setWindowSupport |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, 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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, 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, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, addContainerListener, addImpl, 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, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, 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, 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, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.bbn.openmap.gui.Tool |
---|
getOrientation, setOrientation |
Methods inherited from interface java.beans.beancontext.BeanContextChild |
---|
addPropertyChangeListener, removePropertyChangeListener |
Field Detail |
---|
protected GraphicAttributes graphicAttributes
protected EditableOMGraphic currentEditable
protected MouseDelegator mouseDelegator
protected MapMouseMode formerMouseMode
protected javax.swing.JComponent canvas
protected java.util.Hashtable loaders
protected java.util.Vector rawLoaders
protected OMDrawingToolMouseMode dtmm
protected boolean allowDrawingToolToDeactivateItself
protected DrawingToolRequestor requestor
protected Projection projection
protected SelectionSupport selectionSupport
protected UndoStack undoStack
protected UndoMenuItemStackTrigger undoTrigger
public static final int SHOW_GUI_BEHAVIOR_MASK
public static final int GUI_VIA_POPUP_BEHAVIOR_MASK
public static final int USE_POPUP_BEHAVIOR_MASK
public static final int ALT_POPUP_BEHAVIOR_MASK
public static final int PASSIVE_MOUSE_EVENT_BEHAVIOR_MASK
public static final int DEACTIVATE_ASAP_BEHAVIOR_MASK
public static final int DEFAULT_BEHAVIOR_MASK
public static final int QUICK_CHANGE_BEHAVIOR_MASK
protected int behaviorMask
public static final java.lang.String LoadersProperty
protected boolean DEBUG
protected InformationDelegator informationDelegator
protected java.util.Vector possibleEditableClasses
protected boolean activated
protected boolean visibleWhenInactive
public static final java.lang.String VisibleWhenInactiveProperty
public static final java.lang.String BehaviorProperty
protected boolean resetGUIWhenDeactivated
Constructor Detail |
---|
public OMDrawingTool()
Method Detail |
---|
protected OMDrawingToolMouseMode createMouseMode()
public OMGraphic create(java.lang.String classname, DrawingToolRequestor requestor)
create
in interface DrawingTool
classname
- the classname of the graphic to create.requestor
- the Component that is requesting the OMGraphic. The
requestor gets notified when the user is finished with the
DrawingTool and the graphic is ready.
public OMGraphic create(java.lang.String classname, GraphicAttributes ga, DrawingToolRequestor requestor)
create
in interface DrawingTool
classname
- the classname of the graphic to create.ga
- GraphicAttributes object that contains more information about
the type of line to be created.requestor
- the Component that is requesting the OMGraphic. The
requestor gets notified when the user is finished with the
DrawingTool and the graphic is ready.
public OMGraphic create(java.lang.String classname, GraphicAttributes ga, DrawingToolRequestor requestor, boolean showGUI)
create
in interface DrawingTool
classname
- the classname of the graphic to create.ga
- GraphicAttributes object that contains more information about
the type of line to be created.requestor
- the Component that is requesting the OMGraphic. The
requestor gets notified when the user is finished with the
DrawingTool and the graphic is ready.showGUI
- set to true (default) if a GUI showing attribute controls
should be displayed. The behaviorMask will be adjusted
accordingly.
public OMGraphic edit(OMGraphic g, DrawingToolRequestor requestor)
edit
in interface DrawingTool
g
- OMGraphic to modifyrequestor
- the Component that is requesting the OMGraphic. The
requestor gets notified when the user is finished with the
DrawingTool and the graphic is ready.
public OMGraphic edit(OMGraphic g, DrawingToolRequestor requestor, boolean showGUI)
edit
in interface DrawingTool
g
- OMGraphic to modifyrequestor
- the Component that is requesting the OMGraphic. The
requestor gets notified when the user is finished with the
DrawingTool and the graphic is ready.showGUI
- set to true (default) if a GUI showing attribute controls
should be displayed. The behaviorMask will be adjusted
accordingly.
public OMGraphic edit(EditableOMGraphic eomg, DrawingToolRequestor requestor)
edit
in interface DrawingTool
eomg
- OMGraphic to modifyrequestor
- the Component that is requesting the OMGraphic. The
requestor gets notified when the user is finished with the
DrawingTool and the graphic is ready.
public OMGraphic edit(OMGraphic g, DrawingToolRequestor requestor, java.awt.event.MouseEvent e)
edit
in interface DrawingTool
g
- OMGraphic to modifyrequestor
- the Component that is requesting the OMGraphic. The
requestor gets notified when the user is finished with the
DrawingTool and the graphic is ready.e
- MouseEvent to use to start editing with.
public OMGraphic edit(EditableOMGraphic eomg, DrawingToolRequestor requestor, java.awt.event.MouseEvent e)
edit
in interface DrawingTool
eomg
- EditableOMGraphic to modifyrequestor
- the Component that is requesting the OMGraphic. The
requestor gets notified when the user is finished with the
DrawingTool and the graphic is ready.e
- MouseEvent to use to start editing with.
public boolean isEditing(OMGraphic omg)
public void deselect(OMGraphic omg)
public boolean select(OMGraphic omg, DrawingToolRequestor req, java.awt.event.MouseEvent e)
public EditableOMGraphic getEditableGraphic(java.lang.String classname, GraphicAttributes ga)
classname
- the classname of an OMGraphic to create.ga
- GraphicAttributes needed to initialize the OMGraphic.
public EditableOMGraphic getEditableGraphic(OMGraphic g)
g
- the OMGraphic being wrapped.
public boolean canEdit(java.lang.Class omgc)
canEdit
in interface DrawingTool
public boolean setCurrentEditable(EditableOMGraphic eomg)
public EditableOMGraphic getCurrentEditable()
public void setMouseMode(OMDrawingToolMouseMode adtmm)
public OMDrawingToolMouseMode getMouseMode()
public void addLoader(EditToolLoader loader)
addLoader
in interface DrawingTool
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListener
in class java.awt.Container
public void removeLoader(EditToolLoader loader)
removeLoader
in interface DrawingTool
public EditToolLoader[] getLoaders()
getLoaders
in interface DrawingTool
public void setLoaders(EditToolLoader[] etls)
setLoaders
in interface DrawingTool
public void resetGUIWhenDeactivated(boolean value)
public java.awt.Component getGUI()
To create different types of graphics, the OMDrawingToolMouseMode can be used, to attach to a layer to make it a drawing layer. The Loaders can be queried to get their trigger graphics so you can load the drawing tool with a particular loader to create a particular graphic. But here, we just deal with the actual controls over the particular graphic loaded and being modified.
public void setInformationDelegator(InformationDelegator id)
public InformationDelegator getInformationDelegator()
public void setRemarks(java.lang.String message)
public boolean isActivated()
protected void activate()
protected void activate(boolean completeHookup)
public void deactivate()
public void deactivate(int actionToDoWithOMGraphic)
actionToDoWithOMGraphic
- a masked int from OMGraphicConstants that
describes an OMAction to take on the current editable.OMGraphicConstants
protected void generateOMGraphic(OMGraphic g)
public void notifyListener(OMGraphic graphic, OMAction action)
graphic
- the graphic being created/modifiedaction
- the OMAction telling the listener what to do with the
graphic.public void projectionChanged(ProjectionEvent e)
projectionChanged
in interface ProjectionListener
e
- ProjectionEventpublic void setProjection(Projection proj)
public Projection getProjection()
public void setAttributes(GraphicAttributes da)
public GraphicAttributes getAttributes()
public void listenerPaint(java.lang.Object source, java.awt.Graphics g)
listenerPaint
in interface PaintListener
source
- object being painted.g
- the Graphics to draw into.public void setMouseDelegator(MouseDelegator md)
public MouseDelegator getMouseDelegator()
public void setCursor(java.awt.Cursor cursor)
setCursor
in class java.awt.Component
public java.awt.Cursor getCursor()
getCursor
in class java.awt.Component
public void setCanvas(javax.swing.JComponent can)
public javax.swing.JComponent getCanvas()
public void findAndInit(java.lang.Object someObj)
findAndInit
in interface LightMapHandlerChild
findAndInit
in class OMComponentPanel
public void findAndUndo(java.lang.Object someObj)
findAndUndo
in interface LightMapHandlerChild
findAndUndo
in class OMComponentPanel
public void showPalette()
public void hidePalette()
public void showInWindow()
public void setBehaviorMask(int mask)
setBehaviorMask
in interface DrawingTool
public int getBehaviorMask()
getBehaviorMask
in interface DrawingTool
public void resetBehaviorMask()
public int setMask(int mask)
mask
- an OMDrawingTool behavior mask.
public int unsetMask(int mask)
mask
- an OMDrawingTool behavior mask.
public boolean isMask(int mask)
mask
- an OMDrawingTool behavior mask.
public void propertyChange(java.beans.PropertyChangeEvent pce)
propertyChange
in interface java.beans.PropertyChangeListener
public void eomgChanged(EOMGEvent event)
eomgChanged
in interface EOMGListener
public boolean isAllowDrawingToolToDeactivateItself()
public void setAllowDrawingToolToDeactivateItself(boolean allow)
protected boolean doPopup(int x, int y, java.util.List additionalOptions)
public javax.swing.JPopupMenu createPopupMenu()
public void addSelectionListener(SelectionListener list)
addSelectionListener
in interface SelectionProvider
public void removeSelectionListener(SelectionListener list)
removeSelectionListener
in interface SelectionProvider
public void clearSelectionListeners()
clearSelectionListeners
in interface SelectionProvider
public static void main(java.lang.String[] args)
public void setProperties(java.lang.String prefix, java.util.Properties props)
OMComponentPanel
setProperties
in interface PropertyConsumer
setProperties
in class OMToolComponent
prefix
- the token to prefix the property namesprops
- the Properties
object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |