Class ALcyGXYNewControllerModel

java.lang.Object
com.luciad.view.gxy.controller.ALcdGXYNewControllerModel2
com.luciad.lucy.map.controller.ALcyGXYNewControllerModel
All Implemented Interfaces:
ILcdUndoableSource

public abstract class ALcyGXYNewControllerModel extends ALcdGXYNewControllerModel2

An implementation of ALcdGXYNewControllerModel2 that has a currentLayer property. If that property is null, the given action to create a layer is used to make one. It also changes the visible, selectable and editable properties of the layer to true if needed. For the latter, a confirmation dialog is displayed. Furthermore, it selects the layer that is being drawn on (TLcyMapComponent.setSelectedLayers), so that the user knows about it.

Also sets a Lucy string translator on the model.
  • Constructor Details

    • ALcyGXYNewControllerModel

      public ALcyGXYNewControllerModel()
      Creates a basic controller model. It expects the layer to be set before actually using it (see setCurrentLayer(ILcdGXYLayer)).
    • ALcyGXYNewControllerModel

      public ALcyGXYNewControllerModel(TLcyCreateGXYLayerAction aCreateLayerAction, ILcyMapComponent aMapComponent)
      Creates a new controller model that is capable of creating new layers for the given map.
      Parameters:
      aCreateLayerAction - the action that is used to create a new layer in case no appropriate existing layer can be found.
      aMapComponent - the map in which view will be looked for layers.
  • Method Details

    • getCurrentLayer

      public ILcdGXYLayer getCurrentLayer()
      Returns the layer to which new objects will be added. If this is null, the model tries to create a new one.
      Returns:
      The layer to which new objects will be added.
    • setCurrentLayer

      public void setCurrentLayer(ILcdGXYLayer aCurrentLayer)
      Sets the layer in which new objects will be created.
      Parameters:
      aCurrentLayer - the layer to which new objects will be added.
    • getCreateLayerAction

      public TLcyCreateGXYLayerAction getCreateLayerAction()
      Returns the action that is used to create a new layer in case no appropriate existing layer can be found.
      Returns:
      the action.
    • setCreateLayerAction

      public void setCreateLayerAction(TLcyCreateGXYLayerAction aCreateLayerAction)
      Sets the action that is used to create a new layer in case no appropriate existing layer can be found.
      Parameters:
      aCreateLayerAction - the new action.
    • getGXYLayer

      public ILcdGXYLayer getGXYLayer(Graphics aGraphics, MouseEvent aMouseEvent, ILcdGXYLayerSubsetList aSnappables, ILcdGXYContext aContext)
      Chooses and returns an appropriate layer to create new objects in the given view. If current layer is set (see getCurrentLayer()) to a not-null value, that value is returned. Otherwise the create layer action is used to create a new layer.
      Specified by:
      getGXYLayer in class ALcdGXYNewControllerModel2
      Parameters:
      aGraphics - the graphics onto which created objects will be painted
      aMouseEvent - the mouse event causing the edit operation, or null if another input method is used.
      aSnappables - the list of potential snap targets
      aContext - the GXY context information
      Returns:
      a suitable layer to create an object for
      See Also:
    • getMapComponent

      public ILcyMapComponent getMapComponent()
      Returns the map component of the model. Can be null.
      Returns:
      the map component of this model as passed in through the constructor.