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 ILcdGXYEditors, 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, fXYWorkBoundsFields inherited from class com.luciad.view.gxy.controller.TLcdGXYDragRectangleController
fXPressed, fXReleased, fYPressed, fYReleased -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Constructs a TLcdGXYEditController object.TLcdGXYEditController(boolean aRegisterInstance) Deprecated.use the constructor without parameters. -
Method Summary
Modifier and TypeMethodDescriptionprotected TLcdCompositeUndoableDeprecated.Creates the composite undoable that will wrap all undoables generated by the usedILcdGXYEditors.protected TLcdCompositeUndoablecreateSingleObjectUndoable(Object aDomainObject, ILcdGXYLayer aGXYLayer) Deprecated.Creates the composite undoable that will wrap all the undoables generated by a singleILcdGXYEditorfor a single domain object.protected voiddoPanGXYView(int aDeltaX, int aDeltaY) Deprecated.Performs the pan of thisILcdGXYControllerILcdGXYViewprotected voiddoZoomGXYView(double aDoubleFactor) Deprecated.Performs the zoom of thisILcdGXYControllerILcdGXYViewinteditorModeOnMouseEvent(MouseEvent aMouseEvent) Deprecated.Returns editor mode to use for a specific mouse event.intDeprecated.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:nullis a valid returned value.booleanDeprecated.Returns if all gxy layers will be invalidated or only the ones that have been edited.booleanDeprecated.This method has been deprecated.booleanDeprecated.Returns whether the edit controller repaints only part of the ILcdGXYView while editing.voidDeprecated.voidmouseMoved(MouseEvent me) Deprecated.No operationvoidDeprecated.This implementation calls super.mousePressed(), caches the mouse event (for future use in other mouseXXX methods) and sets the cursor.voidDeprecated.Implements mouseReleased.voidDeprecated.Draws a rectangle on the given graphics ifALcdGXYSmartController.isDragging()returns true and if the rectangle is larger asTLcdGXYDragRectangleController.getMouseDraggedSensitivity().intpainterModeOnMouseEvent(MouseEvent aMouseEvent) Deprecated.Returns the painter mode to use for a specific mouse event.protected voidpaintMovedSelection(Graphics aGraphics, int aGXYPainterMode, MouseEvent aMouseEvent, int aDeltaX, int aDeltaY) Deprecated.Paints the selection being edited on a mouseDragged.protected booleanretrieveSnaptargetSFCT(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.voidDeprecated.voidsetEditingBoundsForRepaintMargin(int aEditingBoundsForRepaintMargin) Deprecated.Sets the margin to extend the dirty region when repainting only part of the view.protected voidsetGXYViewCursorFromTouchedGXYPainter(MouseEvent aMouseEvent) Deprecated.Changes theILcdGXYViewCursorwhen moving the mouse on top of selected Objects using theILcdGXYPainter.getCursormethod.voidsetInvalidateAllGXYLayersOnEdit(boolean aInvalidateAllGXYLayersOnEdit) Deprecated.Sets the value of the propertyinvalidateAllGXYLayersOnEdit.voidsetSnappables(ILcdGXYLayerSubsetList aNewSnappables) Deprecated.Sets the Objects to snap to when editing Objects:nullis a valid argument.voidsetTraceOn(boolean aTraceOn) Deprecated.This method has been deprecated.voidsetUseEditingBoundsForRepaint(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, undoMethods 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, triggerMethods 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, updateViewLocationAfterZoomSFCTMethods 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, viewRepaintMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.luciad.view.gxy.ILcdGXYController
getLayeredMethods inherited from interface com.luciad.gui.ILcdUndoableSource
addUndoableListener, removeUndoableListenerMethods inherited from interface java.awt.event.KeyListener
keyPressed, keyReleased, keyTypedMethods 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 eithertrueorfalseas argument automatically turns off tracing for all other class instances for whichsetTraceOnhas not been called. If the argument isfalsethen only the informative, warning and error log messages are recorded.- Overrides:
setTraceOnin 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.Returnstrueif tracing is enabled for this class.- Overrides:
isTraceOnin 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 theILcdGXYPainterwhile 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.paintmethod depending on theMouseEventreceived.
-
editorModeOnMouseEvent
Deprecated.Returns editor mode to use for a specific mouse event. This is the mode passed to theILcdGXYEditorto edit the object. It returnsILcdGXYEditor.RESHAPEDifaMouseEvent.isControlDown() (isMetaDown() in Mac OS)and notaMouseEvent.isAltDown()and notaMouseEvent.isShiftDown(), ,ILcdGXYEditor.TRANSLATEDotherwise.- Parameters:
aMouseEvent- the mouse event on release of the mouse.- Returns:
- a mode to use in the
ILcdGXYEditor.paintmethod depending on theMouseEventreceived.
-
mouseMoved
Deprecated.Description copied from class:TLcdGXYDragRectangleControllerNo operation- Specified by:
mouseMovedin interfaceMouseMotionListener- Overrides:
mouseMovedin classTLcdGXYDragRectangleController
-
doPanGXYView
protected void doPanGXYView(int aDeltaX, int aDeltaY) Deprecated.Description copied from class:ALcdGXYSmartControllerPerforms the pan of thisILcdGXYControllerILcdGXYView- Overrides:
doPanGXYViewin 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:ALcdGXYSmartControllerPerforms the zoom of thisILcdGXYControllerILcdGXYView- Overrides:
doZoomGXYViewin 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:
mousePressedin interfaceMouseListener- Overrides:
mousePressedin classTLcdGXYSelectController- Parameters:
me- the current mouse event.
-
setGXYViewCursorFromTouchedGXYPainter
Deprecated.Changes theILcdGXYViewCursorwhen moving the mouse on top of selected Objects using theILcdGXYPainter.getCursormethod. This method is called from mouseMoved, mousePressed and mouseDragged.- Parameters:
aMouseEvent- the mouse event on the method mouseMoved.
-
setCursor
Deprecated.- Overrides:
setCursorin classALcdGXYController- Parameters:
aCursor- theCursorto use when a user interacts with thisILcdGXYControlleron aILcdGXYView.
-
paint
Deprecated.Description copied from class:TLcdGXYDragRectangleControllerDraws a rectangle on the given graphics ifALcdGXYSmartController.isDragging()returns true and if the rectangle is larger asTLcdGXYDragRectangleController.getMouseDraggedSensitivity().- Specified by:
paintin interfaceILcdGXYController- Overrides:
paintin classTLcdGXYDragRectangleController- Parameters:
aGraphics- The graphics to draw on.
-
mouseDragged
Deprecated.- Specified by:
mouseDraggedin interfaceMouseMotionListener- Overrides:
mouseDraggedin 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:TLcdGXYSelectControllerImplements 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:
mouseReleasedin interfaceMouseListener- Overrides:
mouseReleasedin classTLcdGXYSelectController
-
createSingleObjectUndoable
protected TLcdCompositeUndoable createSingleObjectUndoable(Object aDomainObject, ILcdGXYLayer aGXYLayer) Deprecated.Creates the composite undoable that will wrap all the undoables generated by a single
ILcdGXYEditorfor a single domain object. This method is called from theapplyEditmethod.The default implementation returns a
TLcdCompositeUndoablethat 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:nullis a valid argument.- Parameters:
aNewSnappables- the new list of snappable objects.- See Also:
-
getSnappables
Deprecated.Returns the Objects to snap to when editing Objects:nullis a valid returned value.- Returns:
- the Objects to snap to when editing Objects:
nullis a valid returned value. - See Also:
-
setInvalidateAllGXYLayersOnEdit
public void setInvalidateAllGXYLayersOnEdit(boolean aInvalidateAllGXYLayersOnEdit) Deprecated.Sets the value of the propertyinvalidateAllGXYLayersOnEdit. The default isfalse. Iftrue, thisILcdGXYControllerwill invalidate and repaint all theILcdGXYLayer, even if changes have occurred on only one. Iffalse, it will call ILcdGXYView.invalidateGXYLayer for eachILcdGXYLayerwhich has been edited.- Parameters:
aInvalidateAllGXYLayersOnEdit- the newinvalidateAllGXYLayersOnEditproperty 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 allILcdGXYPainterimplementations of the selection should properly implements the methodILcdGXYPainter.boundsSFCT, i.c., they should take the modesILcdGXYPainter.CREATING,ILcdGXYPainter.TRANSLATING, andILcdGXYPainter.RESHAPINGinto 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 propertyuseEditingBoundsForRepaintis 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 propertyuseEditingBoundsForRepaintis true. It is expressed in screen pixels.- Parameters:
aEditingBoundsForRepaintMargin- the neweditingBoundsForRepaintMarginvalue (screen pixels).- See Also:
-
TLcdGXYEditController2instead. The functionality of this class will remain present as is.