Class ALcdGXYNewControllerModel

java.lang.Object
com.luciad.view.gxy.controller.ALcdGXYNewControllerModel
All Implemented Interfaces:
ILcdUndoableSource, ILcdGXYNewControllerModel

public abstract class ALcdGXYNewControllerModel extends Object implements ILcdGXYNewControllerModel, ILcdUndoableSource
This abstract class can be used as a basis for creating an implementation of ILcdGXYNewControllerModel.

It offers support for undo/redo by means of addUndoableListener(com.luciad.gui.ILcdUndoableListener).

  • Constructor Details

    • ALcdGXYNewControllerModel

      public ALcdGXYNewControllerModel()
  • Method Details

    • setClassTraceOn

      public static void setClassTraceOn(boolean aClassTraceOn)
      Deprecated.
      This method has been deprecated. It is recommended to use the standard Java logging framework directly.
      Enables tracing for all instances of this class. If the argument is true then all log messages are recorded, otherwise only the informative, warning and error messages are recorded.
      Parameters:
      aClassTraceOn - if true then all log messages are recorded, otherwise only the informative, warning and error messages are recorded.
    • 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.
      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.
      Returns:
      true if tracing is enabled for this class, false otherwise.
    • makeNewInstanceForGXYLayer

      public abstract Object makeNewInstanceForGXYLayer(ILcdGXYLayer aGXYLayer, ILcdGXYView aGXYView)
      Delegates the creation of a new Object to be initialized with Mouse interactions on aGXYView and after inserted in aGXYLayer.
      Specified by:
      makeNewInstanceForGXYLayer in interface ILcdGXYNewControllerModel
    • isValidGXYLayer

      public abstract boolean isValidGXYLayer(ILcdGXYLayer aGXYLayer)
      Returns:
      if aGXYLayer is a valid ILcdGXYLayer for inserting an Object to be created and initialized.
    • chooseGXYLayer

      public ILcdGXYLayer chooseGXYLayer(ILcdGXYView aGXYView)
      This default implementation puts in a Vector all the ILcdGXYLayer of the ILcdGXYView that satisfy isValidGXYLayer() then calls the protected method chooseGXYLayer( ILcdGXYView, Vector ), and returns its value.
      Specified by:
      chooseGXYLayer in interface ILcdGXYNewControllerModel
    • chooseGXYLayer

      protected ILcdGXYLayer chooseGXYLayer(ILcdGXYView aGXYView, Vector aVectorOfValidGXYLayer)
      If isChooseFirstValidGXYLayer returns false, this method pops up a Dialog with all the ILcdGXYLayers in aVectorOfValidGXYLayer from which the user has to pick one. This method makes use of the TLcdUserDialog.choose method and display the Strings returned by ILcdGXYLayer.getLabel.

      If isChooseFirstValidGXYLayer returns true, this method returns the first ILcdGXYLayer in aVectorOfValidGXYLayer.

      aVectorOfValidGXYLayer is created by the chooseGXYLayer(ILcdGXYView) method.

    • setChooseFirstValidGXYLayer

      public void setChooseFirstValidGXYLayer(boolean aChooseFirstValidGXYLayer)
      Parameters:
      aChooseFirstValidGXYLayer - if true: the first valid ILcdGXYLayer. If false, the user has to pick one among the valid ones. Default value is false.
    • isChooseFirstValidGXYLayer

      public boolean isChooseFirstValidGXYLayer()
      Returns:
      true if the first valid ILcdGXYLayer. false, if the user has to pick one among the valid ones. Default value is false.
    • setAddNewObjectInLayerSelection

      public void setAddNewObjectInLayerSelection(boolean aAddNewObjectInLayerSelection)
      Parameters:
      aAddNewObjectInLayerSelection - if true, this ILcdGXYNewControllerModel put each new created Object also in the ILcdGXYLayer selection. If false, it put only the objects in the ILcdModel of the chosen ILcdGXYLayer. Is false by default.
    • isAddNewObjectInLayerSelection

      public boolean isAddNewObjectInLayerSelection()
      See Also:
    • addObjectInGXYLayer

      public void addObjectInGXYLayer(Object aObject, ILcdGXYLayer aGXYLayer, ILcdGXYView aGXYView)
      Adds aObject in the ILcdModel of aGXYLayer and updates aGXYView.
      Specified by:
      addObjectInGXYLayer in interface ILcdGXYNewControllerModel
    • addUndoableListener

      public void addUndoableListener(ILcdUndoableListener aListener)
      Adds the given ILcdUndoableListener to the list of registered listeners. The listener now receives TLcdUndoableEvents from this controller.

      By for example adding a TLcdUndoManager to this controller, undo/redo support can be enabled.

      Specified by:
      addUndoableListener in interface ILcdUndoableSource
      Parameters:
      aListener - The listener to add.
      See Also:
    • removeUndoableListener

      public void removeUndoableListener(ILcdUndoableListener aListener)
      Removes the given ILcdUndoableListener from the list of registered listeners. The listener no longer receives TLcdUndoableEvents from this controller.

      Removing a listener that was never added or already removed, has no effect.

      Specified by:
      removeUndoableListener in interface ILcdUndoableSource
      Parameters:
      aListener - The listener to remove.
      See Also:
    • fireUndoableEvent

      protected void fireUndoableEvent(TLcdUndoableEvent aEvent)
      Fires the given TLcdUndoableEvent to all listeners registered to this controller.
      Parameters:
      aEvent - The event to fire to all registered listeners.
      See Also: