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.
Lucy string translator
on the model.ALcdGXYNewControllerModel2.CreationStatus, ALcdGXYNewControllerModel2.SnapTargetInfo
Constructor and Description |
---|
ALcyGXYNewControllerModel()
Creates 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.
|
Modifier and Type | Method and Description |
---|---|
TLcyCreateGXYLayerAction |
getCreateLayerAction()
Returns the action that is used to create a new layer in case no appropriate existing layer can
be found.
|
ILcdGXYLayer |
getCurrentLayer()
Returns the layer to which new objects will be added.
|
ILcdGXYLayer |
getGXYLayer(Graphics aGraphics,
MouseEvent aMouseEvent,
ILcdGXYLayerSubsetList aSnappables,
ILcdGXYContext aContext)
Chooses and returns an appropriate layer to create new objects in the given view.
|
ILcyMapComponent |
getMapComponent()
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.
|
addUndoableListener, cancel, commit, create, createCommitUndoable, edit, fireUndoableHappened, getCreationStatus, getStringTranslator, mouseCursor, paint, removeUndoableListener, setStringTranslator, shouldCommit, shouldEdit, shouldUndo, snapTarget
public ALcyGXYNewControllerModel()
setCurrentLayer(ILcdGXYLayer)
).public ALcyGXYNewControllerModel(TLcyCreateGXYLayerAction aCreateLayerAction, ILcyMapComponent aMapComponent)
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.public ILcdGXYLayer getCurrentLayer()
public void setCurrentLayer(ILcdGXYLayer aCurrentLayer)
aCurrentLayer
- the layer to which new objects will be added.public TLcyCreateGXYLayerAction getCreateLayerAction()
public void setCreateLayerAction(TLcyCreateGXYLayerAction aCreateLayerAction)
aCreateLayerAction
- the new action.public ILcdGXYLayer getGXYLayer(Graphics aGraphics, MouseEvent aMouseEvent, ILcdGXYLayerSubsetList aSnappables, ILcdGXYContext aContext)
getCurrentLayer()
) to a not-null value, that value is returned.
Otherwise the create layer action is used to create a new layer.getGXYLayer
in class ALcdGXYNewControllerModel2
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 informationALcdGXYNewControllerModel2.create(int, java.awt.Graphics, java.awt.event.MouseEvent, com.luciad.view.gxy.ILcdGXYLayerSubsetList, com.luciad.view.gxy.ILcdGXYContext)
public ILcyMapComponent getMapComponent()