Package com.luciad.lucy.map.controller
Class ALcyGXYNewControllerModel
java.lang.Object
com.luciad.view.gxy.controller.ALcdGXYNewControllerModel2
com.luciad.lucy.map.controller.ALcyGXYNewControllerModel
- All Implemented Interfaces:
ILcdUndoableSource
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.
Lucy string translator
on the model.-
Nested Class Summary
Nested classes/interfaces inherited from class com.luciad.view.gxy.controller.ALcdGXYNewControllerModel2
ALcdGXYNewControllerModel2.CreationStatus, ALcdGXYNewControllerModel2.SnapTargetInfo
-
Constructor Summary
ConstructorDescriptionCreates a basic controller model.ALcyGXYNewControllerModel
(TLcyCreateGXYLayerAction aCreateLayerAction, ILcyMapComponent aMapComponent) Creates a new controller model that is capable of creating new layers for the given map. -
Method Summary
Modifier and TypeMethodDescriptionReturns the action that is used to create a new layer in case no appropriate existing layer can be found.Returns the layer to which new objects will be added.getGXYLayer
(Graphics aGraphics, MouseEvent aMouseEvent, ILcdGXYLayerSubsetList aSnappables, ILcdGXYContext aContext) Chooses and returns an appropriate layer to create new objects in the given view.Returns the map component of the model.void
setCreateLayerAction
(TLcyCreateGXYLayerAction aCreateLayerAction) Sets the action that is used to create a new layer in case no appropriate existing layer can be found.void
setCurrentLayer
(ILcdGXYLayer aCurrentLayer) Sets the layer in which new objects will be created.Methods inherited from class com.luciad.view.gxy.controller.ALcdGXYNewControllerModel2
addUndoableListener, cancel, commit, create, createCommitUndoable, edit, fireUndoableHappened, getCreationStatus, getStringTranslator, mouseCursor, paint, removeUndoableListener, setStringTranslator, shouldCommit, shouldEdit, shouldUndo, snapTarget
-
Constructor Details
-
ALcyGXYNewControllerModel
public ALcyGXYNewControllerModel()Creates a basic controller model. It expects the layer to be set before actually using it (seesetCurrentLayer(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
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
Sets the layer in which new objects will be created.- Parameters:
aCurrentLayer
- the layer to which new objects will be added.
-
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
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 (seegetCurrentLayer()
) 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 classALcdGXYNewControllerModel2
- Parameters:
aGraphics
- the graphics onto which created objects will be paintedaMouseEvent
- the mouse event causing the edit operation, or null if another input method is used.aSnappables
- the list of potential snap targetsaContext
- the GXY context information- Returns:
- a suitable layer to create an object for
- See Also:
-
getMapComponent
Returns the map component of the model. Can be null.- Returns:
- the map component of this model as passed in through the constructor.
-