Class TLcdGXYEditController
- All Implemented Interfaces:
ILcdUndoableSource
,ILcdStatusSource
,ILcdGXYController
,KeyListener
,MouseListener
,MouseMotionListener
,Serializable
,EventListener
TLcdGXYEditController
is an extension of
TLcdGXYSelectController
that can be used for selecting Objects in
an ILcdGXYView
and editing one or more selected Object
(s) with
the mouse (sequence of mousePressed, mouseDragged and mouseReleased).
The
editing with the mouse of an Object
on the ILcdGXYView
is
delegated to one ILcdGXYEditor
. This ILcdGXYEditor
is returned by the ILcdGXYLayer
the Object
belongs to.
The actual edit operation is only called on mouseReleased.
While the edit process is ongoing (e.g., the user is performing a drag), the
objects are not edited all the time, they are just painted in their temporary
state.
Furthermore this controller is an ILcdUndoableSource
. When editing objects using
their corresponding ILcdGXYEditor
s, all the undoables generated by the editors are
collected and combined in a single ILcdUndoable
. The listeners that have registered
themselves using the ALcdGXYSmartController.addUndoableListener(com.luciad.gui.ILcdUndoableListener)
will then
be notified of this single ILcdUndoable
. For this controller to be able to collect
the undoables generated by the editors, these editors need to implement
ILcdUndoableSource
.
- See Also:
-
Field Summary
Fields inherited from class com.luciad.view.gxy.controller.TLcdGXYSelectController
fAWTWorkBounds, fLastSelectionClip, fSelection, fWorkContext, fXYWorkBounds
Fields inherited from class com.luciad.view.gxy.controller.TLcdGXYDragRectangleController
fXPressed, fXReleased, fYPressed, fYReleased
-
Constructor Summary
ConstructorDescriptionDeprecated.Constructs a TLcdGXYEditController object.TLcdGXYEditController
(boolean aRegisterInstance) Deprecated.use the constructor without parameters. -
Method Summary
Modifier and TypeMethodDescriptionprotected TLcdCompositeUndoable
Deprecated.Creates the composite undoable that will wrap all undoables generated by the usedILcdGXYEditors
.protected TLcdCompositeUndoable
createSingleObjectUndoable
(Object aDomainObject, ILcdGXYLayer aGXYLayer) Deprecated.Creates the composite undoable that will wrap all the undoables generated by a singleILcdGXYEditor
for a single domain object.protected void
doPanGXYView
(int aDeltaX, int aDeltaY) Deprecated.Performs the pan of thisILcdGXYController
ILcdGXYView
protected void
doZoomGXYView
(double aDoubleFactor) Deprecated.Performs the zoom of thisILcdGXYController
ILcdGXYView
int
editorModeOnMouseEvent
(MouseEvent aMouseEvent) Deprecated.Returns editor mode to use for a specific mouse event.int
Deprecated.Returns the margin to extend the dirty region when repainting only part of the view.Deprecated.Returns the Objects to snap to when editing Objects:null
is a valid returned value.boolean
Deprecated.Returns if all gxy layers will be invalidated or only the ones that have been edited.boolean
Deprecated.This method has been deprecated.boolean
Deprecated.Returns whether the edit controller repaints only part of the ILcdGXYView while editing.void
Deprecated.void
mouseMoved
(MouseEvent me) Deprecated.No operationvoid
Deprecated.This implementation calls super.mousePressed(), caches the mouse event (for future use in other mouseXXX methods) and sets the cursor.void
Deprecated.Implements mouseReleased.void
Deprecated.Draws a rectangle on the given graphics ifALcdGXYSmartController.isDragging()
returns true and if the rectangle is larger asTLcdGXYDragRectangleController.getMouseDraggedSensitivity()
.int
painterModeOnMouseEvent
(MouseEvent aMouseEvent) Deprecated.Returns the painter mode to use for a specific mouse event.protected void
paintMovedSelection
(Graphics aGraphics, int aGXYPainterMode, MouseEvent aMouseEvent, int aDeltaX, int aDeltaY) Deprecated.Paints the selection being edited on a mouseDragged.protected boolean
retrieveSnaptargetSFCT
(Object aObjectToSnap, ILcdGXYLayer aObjectToSnapGXYLayer, MouseEvent aMouseEvent, ILcdAssoc aAssoc, int aDeltaX, int aDeltaY) Deprecated.Tries to retrieve a snap target and puts it in the given assoc.void
Deprecated.void
setEditingBoundsForRepaintMargin
(int aEditingBoundsForRepaintMargin) Deprecated.Sets the margin to extend the dirty region when repainting only part of the view.protected void
setGXYViewCursorFromTouchedGXYPainter
(MouseEvent aMouseEvent) Deprecated.Changes theILcdGXYView
Cursor
when moving the mouse on top of selected Objects using theILcdGXYPainter.getCursor
method.void
setInvalidateAllGXYLayersOnEdit
(boolean aInvalidateAllGXYLayersOnEdit) Deprecated.Sets the value of the propertyinvalidateAllGXYLayersOnEdit
.void
setSnappables
(ILcdGXYLayerSubsetList aNewSnappables) Deprecated.Sets the Objects to snap to when editing Objects:null
is a valid argument.void
setTraceOn
(boolean aTraceOn) Deprecated.This method has been deprecated.void
setUseEditingBoundsForRepaint
(boolean aUseEditingBoundsForRepaint) Deprecated.Sets whether the edit controller should repaint only part of the ILcdGXYView while editing.Methods inherited from class com.luciad.view.gxy.controller.TLcdGXYSelectController
addInSelection, deselectAll, fireAllLayerCollectedSelectionChanges, getActionOnDoubleClick, getActionOnRightMouseButtonPressed, getGXYSelectControllerModel, getLastMousePressedEvent, getLastMouseReleasedEvent, getMousePressedSensitivity, getPreviousSelectionClip, getSelectionClip, getSelectionCount, getSensitivity, isActionOnRightMouseButtonPerformed, isInvertSelectionOnAlternateModeDrag, isSelectInBoundsAllowed, isStrictInteraction, lastSelected, processRightMouseButtonPressed, removeFromSelection, selectAt, selectInBounds, selection, selectOnLayer, setActionOnDoubleClick, setActionOnRightMouseButtonPressed, setGXYSelectControllerModel, setInvertSelectionOnAlternateModeDrag, setMousePressedSensitivity, setSelectInBoundsAllowed, setSensitivity, setStrictInteraction, startInteraction, terminateInteraction, undo
Methods inherited from class com.luciad.view.gxy.controller.TLcdGXYDragRectangleController
adaptRectangle, drawGhost, getCurrentRectangle, getGhostColor, getGhostLineWidth, getHaloColor, getHaloThickness, getMouseDraggedSensitivity, getXORModelColor, isDragCentered, isForceToSquare, isHaloEnabled, isRepaintOnReleased, isXORMode, lastXPressed, lastXReleased, lastYPressed, lastYReleased, setDragCentered, setForceToSquare, setGhostColor, setGhostLineWidth, setHaloColor, setHaloEnabled, setHaloThickness, setMouseDraggedSensitivity, setRepaintOnReleased, setXORMode, setXORModeColor, trigger
Methods inherited from class com.luciad.view.gxy.controller.ALcdGXYSmartController
addUndoableListener, fireUndoableEvent, getDownPanChars, getDownPanCodes, getLeftPanChars, getLeftPanCodes, getPanAbsDelta, getPanAbsDelta, getRightPanChars, getRightPanCodes, getUndoableListenerCount, getUpPanChars, getUpPanCodes, getZoomInChars, getZoomInCodes, getZoomOutChars, getZoomOutCodes, isDragging, isPanOnMouseDragExit, isPanOnMouseMoveExit, isPanUndoable, isRequestFocusOnMouseEntered, isRequestFocusOnMousePressed, isZoomUndoable, keyPressed, keyReleased, keyTyped, mouseClicked, mouseEntered, mouseExited, removeUndoableListener, setDownPanChars, setDownPanCodes, setIsDragging, setLeftPanChars, setLeftPanCodes, setPanAbsDelta, setPanOnMouseDragExit, setPanOnMouseMoveExit, setPanUndoable, setRequestFocusOnMouseEntered, setRequestFocusOnMousePressed, setRightPanChars, setRightPanCodes, setUpPanChars, setUpPanCodes, setZoomInChars, setZoomInCodes, setZoomOutChars, setZoomOutCodes, setZoomUndoable, updateViewLocationAfterZoomSFCT
Methods inherited from class com.luciad.view.gxy.controller.ALcdGXYController
addStatusListener, asGXYController, fireStatusEvent, getCursor, getGXYView, getIcon, getName, getShortDescription, registerInstance, removeStatusListener, retrieveGXYViewXYWorldTransformation, setClassTraceOn, setGXYView, setIcon, setName, setShortDescription, viewRepaint
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.view.gxy.ILcdGXYController
getLayered
Methods inherited from interface com.luciad.gui.ILcdUndoableSource
addUndoableListener, removeUndoableListener
Methods inherited from interface java.awt.event.KeyListener
keyPressed, keyReleased, keyTyped
Methods inherited from interface java.awt.event.MouseListener
mouseClicked, mouseEntered, mouseExited
-
Constructor Details
-
TLcdGXYEditController
public TLcdGXYEditController()Deprecated.Constructs a TLcdGXYEditController object. This controller allows to edit objects graphically. -
TLcdGXYEditController
public TLcdGXYEditController(boolean aRegisterInstance) Deprecated.use the constructor without parameters.
-
-
Method Details
-
setTraceOn
public void setTraceOn(boolean aTraceOn) Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Enables tracing for this class instance. Calling this method with eithertrue
orfalse
as argument automatically turns off tracing for all other class instances for whichsetTraceOn
has not been called. If the argument isfalse
then only the informative, warning and error log messages are recorded.- Overrides:
setTraceOn
in classTLcdGXYSelectController
- Parameters:
aTraceOn
- if true then all log messages are recorded for this instance. If false, then only the informative, warning and error log messages are recorded.
-
isTraceOn
public boolean isTraceOn()Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Returnstrue
if tracing is enabled for this class.- Overrides:
isTraceOn
in classTLcdGXYSelectController
- Returns:
- true if tracing is enabled for this class, false otherwise.
-
painterModeOnMouseEvent
Deprecated.Returns the painter mode to use for a specific mouse event. This is the mode passed to theILcdGXYPainter
while editing the object. IfaMouseEvent.isControlDown()(isMetaDown() on Mac OS)
, it returns (ILcdGXYPainter.RESHAPING
|ILcdGXYPainter.BODY
|ILcdGXYPainter.HANDLES
|ILcdGXYPainter.SELECTED
), else it returns (ILcdGXYPainter.TRANSLATING
|ILcdGXYPainter.BODY
|ILcdGXYPainter.HANDLES
|ILcdGXYPainter.SELECTED
).- Parameters:
aMouseEvent
- the current mouse event.- Returns:
- the mode to use in the
ILcdGXYPainter.paint
method depending on theMouseEvent
received.
-
editorModeOnMouseEvent
Deprecated.Returns editor mode to use for a specific mouse event. This is the mode passed to theILcdGXYEditor
to edit the object. It returnsILcdGXYEditor.RESHAPED
ifaMouseEvent.isControlDown() (isMetaDown() in Mac OS)
and notaMouseEvent.isAltDown()
and notaMouseEvent.isShiftDown()
, ,ILcdGXYEditor.TRANSLATED
otherwise.- Parameters:
aMouseEvent
- the mouse event on release of the mouse.- Returns:
- a mode to use in the
ILcdGXYEditor.paint
method depending on theMouseEvent
received.
-
mouseMoved
Deprecated.Description copied from class:TLcdGXYDragRectangleController
No operation- Specified by:
mouseMoved
in interfaceMouseMotionListener
- Overrides:
mouseMoved
in classTLcdGXYDragRectangleController
-
doPanGXYView
protected void doPanGXYView(int aDeltaX, int aDeltaY) Deprecated.Description copied from class:ALcdGXYSmartController
Performs the pan of thisILcdGXYController
ILcdGXYView
- Overrides:
doPanGXYView
in classTLcdGXYDragRectangleController
- Parameters:
aDeltaX
- delta along the X axis, in AWT pixelsaDeltaY
- delta along the Y axis, in AWT pixels
-
doZoomGXYView
protected void doZoomGXYView(double aDoubleFactor) Deprecated.Description copied from class:ALcdGXYSmartController
Performs the zoom of thisILcdGXYController
ILcdGXYView
- Overrides:
doZoomGXYView
in classTLcdGXYDragRectangleController
- Parameters:
aDoubleFactor
- zoom factor with which to multiply the view's scale
-
mousePressed
Deprecated.This implementation calls super.mousePressed(), caches the mouse event (for future use in other mouseXXX methods) and sets the cursor.- Specified by:
mousePressed
in interfaceMouseListener
- Overrides:
mousePressed
in classTLcdGXYSelectController
- Parameters:
me
- the current mouse event.
-
setGXYViewCursorFromTouchedGXYPainter
Deprecated.Changes theILcdGXYView
Cursor
when moving the mouse on top of selected Objects using theILcdGXYPainter.getCursor
method. This method is called from mouseMoved, mousePressed and mouseDragged.- Parameters:
aMouseEvent
- the mouse event on the method mouseMoved.
-
setCursor
Deprecated.- Overrides:
setCursor
in classALcdGXYController
- Parameters:
aCursor
- theCursor
to use when a user interacts with thisILcdGXYController
on aILcdGXYView
.
-
paint
Deprecated.Description copied from class:TLcdGXYDragRectangleController
Draws a rectangle on the given graphics ifALcdGXYSmartController.isDragging()
returns true and if the rectangle is larger asTLcdGXYDragRectangleController.getMouseDraggedSensitivity()
.- Specified by:
paint
in interfaceILcdGXYController
- Overrides:
paint
in classTLcdGXYDragRectangleController
- Parameters:
aGraphics
- The graphics to draw on.
-
mouseDragged
Deprecated.- Specified by:
mouseDragged
in interfaceMouseMotionListener
- Overrides:
mouseDragged
in classTLcdGXYSelectController
-
paintMovedSelection
protected void paintMovedSelection(Graphics aGraphics, int aGXYPainterMode, MouseEvent aMouseEvent, int aDeltaX, int aDeltaY) Deprecated.Paints the selection being edited on a mouseDragged.- Parameters:
aGraphics
- the Graphics on which to paint the 'edited' selection.aGXYPainterMode
- the painter mode to pass to the ILcdGXYPainter objects.aMouseEvent
- the last mouse event (drag) for which this method is invoked.aDeltaX
- the delta x of the current mouse event to the last mouse pressed event.aDeltaY
- the delta y of the current mouse event to the last mouse pressed event.
-
mouseReleased
Deprecated.Description copied from class:TLcdGXYSelectController
Implements mouseReleased. This method can be redefined to implement a behavior after processing a new selection. Do not forget to start this redefinition by calling super.mouseReleased(me).- Specified by:
mouseReleased
in interfaceMouseListener
- Overrides:
mouseReleased
in classTLcdGXYSelectController
-
createSingleObjectUndoable
protected TLcdCompositeUndoable createSingleObjectUndoable(Object aDomainObject, ILcdGXYLayer aGXYLayer) Deprecated.Creates the composite undoable that will wrap all the undoables generated by a single
ILcdGXYEditor
for a single domain object. This method is called from theapplyEdit
method.The default implementation returns a
TLcdCompositeUndoable
that selects the given domain object in the given layer on undo and redo. Its display name is"Edit " + String.valueOf(aDomainObject)
.- Parameters:
aDomainObject
- The domain object from the model which is being edited.aGXYLayer
- The layer of the domain object which is being edited.- Returns:
- The composite undoable that will be fired when the edit operation is complete. Must not
be
null
.
-
createCompositeUndoable
Deprecated.Creates the composite undoable that will wrap all undoables generated by the used
ILcdGXYEditors
.This default implementation returns a TLcdCompositeUndoable that clears the selection of the view on undo and redo. Its display name is "Edit Objects". Override this method if you want to disable this selection behaviour or want another name.
- Returns:
- The composite undoable that will be fired when the edit operation is complete.
Must not be
null
.
-
retrieveSnaptargetSFCT
protected boolean retrieveSnaptargetSFCT(Object aObjectToSnap, ILcdGXYLayer aObjectToSnapGXYLayer, MouseEvent aMouseEvent, ILcdAssoc aAssoc, int aDeltaX, int aDeltaY) Deprecated.Tries to retrieve a snap target and puts it in the given assoc. This method is called when editing the selected objects. When no snap target can be found this method should return false, true otherwise. This implementation picks the snap target from a list of possible snap targets (getSnappables()
) in all layers of the current view (ALcdGXYController.getGXYView()
)- Parameters:
aObjectToSnap
- the object that is being editedaObjectToSnapGXYLayer
- the layer whose model contains the edited objectaMouseEvent
- the mouse event triggering the editaAssoc
- the assoc to put the snap target in. The key is the layer that contains the snap target and the value is the snap target itself.aDeltaX
- the number of pixels the mouse has moved in the X direction since it was pressed.aDeltaY
- the number of pixels the mouse has moved in the Y direction since it was pressed.- Returns:
- true when a snap target was found, false otherwise.
- See Also:
-
setSnappables
Deprecated.Sets the Objects to snap to when editing Objects:null
is a valid argument.- Parameters:
aNewSnappables
- the new list of snappable objects.- See Also:
-
getSnappables
Deprecated.Returns the Objects to snap to when editing Objects:null
is a valid returned value.- Returns:
- the Objects to snap to when editing Objects:
null
is a valid returned value. - See Also:
-
setInvalidateAllGXYLayersOnEdit
public void setInvalidateAllGXYLayersOnEdit(boolean aInvalidateAllGXYLayersOnEdit) Deprecated.Sets the value of the propertyinvalidateAllGXYLayersOnEdit
. The default isfalse
. Iftrue
, thisILcdGXYController
will invalidate and repaint all theILcdGXYLayer
, even if changes have occurred on only one. Iffalse
, it will call ILcdGXYView.invalidateGXYLayer for eachILcdGXYLayer
which has been edited.- Parameters:
aInvalidateAllGXYLayersOnEdit
- the newinvalidateAllGXYLayersOnEdit
property value.- See Also:
-
isInvalidateAllGXYLayersOnEdit
public boolean isInvalidateAllGXYLayersOnEdit()Deprecated.Returns if all gxy layers will be invalidated or only the ones that have been edited.- Returns:
- if all gxy layers will be invalidated or only the ones that have been edited.
- See Also:
-
isUseEditingBoundsForRepaint
public boolean isUseEditingBoundsForRepaint()Deprecated.Returns whether the edit controller repaints only part of the ILcdGXYView while editing.- Returns:
- whether the edit controller repaints only part of the ILcdGXYView while editing.
- Since:
- 3.1
- See Also:
-
setUseEditingBoundsForRepaint
public void setUseEditingBoundsForRepaint(boolean aUseEditingBoundsForRepaint) Deprecated.Sets whether the edit controller should repaint only part of the ILcdGXYView while editing. The default value isfalse
.
In order to use this mode allILcdGXYPainter
implementations of the selection should properly implements the methodILcdGXYPainter.boundsSFCT
, i.c., they should take the modesILcdGXYPainter.CREATING
,ILcdGXYPainter.TRANSLATING
, andILcdGXYPainter.RESHAPING
into account.- Parameters:
aUseEditingBoundsForRepaint
- the new useClip value.- Since:
- 3.1
- See Also:
-
getEditingBoundsForRepaintMargin
public int getEditingBoundsForRepaintMargin()Deprecated.Returns the margin to extend the dirty region when repainting only part of the view. It is only used if the propertyuseEditingBoundsForRepaint
is true. It is expressed in screen pixels.- Returns:
- the margin to extend the dirty region when repainting only part of the view.
- See Also:
-
setEditingBoundsForRepaintMargin
public void setEditingBoundsForRepaintMargin(int aEditingBoundsForRepaintMargin) Deprecated.Sets the margin to extend the dirty region when repainting only part of the view. It is only used if the propertyuseEditingBoundsForRepaint
is true. It is expressed in screen pixels.- Parameters:
aEditingBoundsForRepaintMargin
- the neweditingBoundsForRepaintMargin
value (screen pixels).- See Also:
-
TLcdGXYEditController2
instead. The functionality of this class will remain present as is.