Class TLcdGXYEditController

All Implemented Interfaces:
ILcdUndoableSource, ILcdStatusSource, ILcdGXYController, KeyListener, MouseListener, MouseMotionListener, Serializable, EventListener

public class TLcdGXYEditController extends TLcdGXYSelectController implements MouseListener, MouseMotionListener, KeyListener, ILcdUndoableSource
Deprecated.
as of version 10.0. It is advised to use the more flexible and powerful TLcdGXYEditController2 instead. The functionality of this class will remain present as is.
The 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:
  • 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 either true or false as argument automatically turns off tracing for all other class instances for which setTraceOn has not been called. If the argument is false then only the informative, warning and error log messages are recorded.
      Overrides:
      setTraceOn in class TLcdGXYSelectController
      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.
      Returns true if tracing is enabled for this class.
      Overrides:
      isTraceOn in class TLcdGXYSelectController
      Returns:
      true if tracing is enabled for this class, false otherwise.
    • painterModeOnMouseEvent

      public int painterModeOnMouseEvent(MouseEvent aMouseEvent)
      Deprecated.
      Returns the painter mode to use for a specific mouse event. This is the mode passed to the ILcdGXYPainter while editing the object. If aMouseEvent.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 the MouseEvent received.
    • editorModeOnMouseEvent

      public int editorModeOnMouseEvent(MouseEvent aMouseEvent)
      Deprecated.
      Returns editor mode to use for a specific mouse event. This is the mode passed to the ILcdGXYEditor to edit the object. It returns ILcdGXYEditor.RESHAPED if aMouseEvent.isControlDown() (isMetaDown() in Mac OS) and not aMouseEvent.isAltDown() and not aMouseEvent.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 the MouseEvent received.
    • mouseMoved

      public void mouseMoved(MouseEvent me)
      Deprecated.
      Description copied from class: TLcdGXYDragRectangleController
      No operation
      Specified by:
      mouseMoved in interface MouseMotionListener
      Overrides:
      mouseMoved in class TLcdGXYDragRectangleController
    • doPanGXYView

      protected void doPanGXYView(int aDeltaX, int aDeltaY)
      Deprecated.
      Description copied from class: ALcdGXYSmartController
      Performs the pan of this ILcdGXYController ILcdGXYView
      Overrides:
      doPanGXYView in class TLcdGXYDragRectangleController
      Parameters:
      aDeltaX - delta along the X axis, in AWT pixels
      aDeltaY - delta along the Y axis, in AWT pixels
    • doZoomGXYView

      protected void doZoomGXYView(double aDoubleFactor)
      Deprecated.
      Description copied from class: ALcdGXYSmartController
      Performs the zoom of this ILcdGXYController ILcdGXYView
      Overrides:
      doZoomGXYView in class TLcdGXYDragRectangleController
      Parameters:
      aDoubleFactor - zoom factor with which to multiply the view's scale
    • mousePressed

      public void mousePressed(MouseEvent me)
      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 interface MouseListener
      Overrides:
      mousePressed in class TLcdGXYSelectController
      Parameters:
      me - the current mouse event.
    • setGXYViewCursorFromTouchedGXYPainter

      protected void setGXYViewCursorFromTouchedGXYPainter(MouseEvent aMouseEvent)
      Deprecated.
      Changes the ILcdGXYView Cursor when moving the mouse on top of selected Objects using the ILcdGXYPainter.getCursor method. This method is called from mouseMoved, mousePressed and mouseDragged.
      Parameters:
      aMouseEvent - the mouse event on the method mouseMoved.
    • setCursor

      public void setCursor(Cursor aCursor)
      Deprecated.
      Overrides:
      setCursor in class ALcdGXYController
      Parameters:
      aCursor - the Cursor to use when a user interacts with this ILcdGXYController on a ILcdGXYView.
    • paint

      public void paint(Graphics aGraphics)
      Deprecated.
      Description copied from class: TLcdGXYDragRectangleController
      Draws a rectangle on the given graphics if ALcdGXYSmartController.isDragging() returns true and if the rectangle is larger as TLcdGXYDragRectangleController.getMouseDraggedSensitivity().
      Specified by:
      paint in interface ILcdGXYController
      Overrides:
      paint in class TLcdGXYDragRectangleController
      Parameters:
      aGraphics - The graphics to draw on.
    • mouseDragged

      public void mouseDragged(MouseEvent me)
      Deprecated.
      Specified by:
      mouseDragged in interface MouseMotionListener
      Overrides:
      mouseDragged in class TLcdGXYSelectController
    • 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

      public void mouseReleased(MouseEvent me)
      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 interface MouseListener
      Overrides:
      mouseReleased in class TLcdGXYSelectController
    • 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 the applyEdit 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

      protected TLcdCompositeUndoable 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 edited
      aObjectToSnapGXYLayer - the layer whose model contains the edited object
      aMouseEvent - the mouse event triggering the edit
      aAssoc - 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

      public void setSnappables(ILcdGXYLayerSubsetList aNewSnappables)
      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

      public ILcdGXYLayerSubsetList 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 property invalidateAllGXYLayersOnEdit. The default is false. If true, this ILcdGXYController will invalidate and repaint all the ILcdGXYLayer, even if changes have occurred on only one. If false, it will call ILcdGXYView.invalidateGXYLayer for each ILcdGXYLayer which has been edited.
      Parameters:
      aInvalidateAllGXYLayersOnEdit - the new invalidateAllGXYLayersOnEdit 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 is false.
      In order to use this mode all ILcdGXYPainter implementations of the selection should properly implements the method ILcdGXYPainter.boundsSFCT, i.c., they should take the modes ILcdGXYPainter.CREATING, ILcdGXYPainter.TRANSLATING, and ILcdGXYPainter.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 property useEditingBoundsForRepaint 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 property useEditingBoundsForRepaint is true. It is expressed in screen pixels.
      Parameters:
      aEditingBoundsForRepaintMargin - the new editingBoundsForRepaintMargin value (screen pixels).
      See Also: