public abstract class ALspCreateControllerModel extends Object
Controller model used by the TLspCreateController
for the retrieval of the layer on which an object should be created as well
as the object that is to be created.
Apart from the getters and the create method, this class also has notification methods: canceled and finished. These methods are called whenever creation has been canceled or finished.
Constructor and Description |
---|
ALspCreateControllerModel() |
Modifier and Type | Method and Description |
---|---|
void |
canceled(TLspEditContext aEditContext)
Called when object creation has been canceled.
|
abstract Object |
create(ILspView aView,
ILspLayer aLayer)
Create a new (empty) object
|
void |
finished(TLspEditContext aEditContext)
Called when object creation has finished.
|
abstract ILspInteractivePaintableLayer |
getLayer(ILspView aView)
Gets the layer to which the created object should be added.
|
int |
getMaximumPointCount(TLspEditContext aEditContext)
A method that determines the maximum pointcount for a pointlist during creation.
|
int |
getMinimumPointCount(TLspEditContext aEditContext)
A method that determines the minimum pointcount for a pointlist during creation.
|
TLspPaintRepresentation |
getPaintRepresentation(ILspInteractivePaintableLayer aLayer,
ILspView aView)
Gets the paint representation which is used to retrieve an editor for object creation.
|
public abstract ILspInteractivePaintableLayer getLayer(ILspView aView)
aView
- the view the layer should belong topublic TLspPaintRepresentation getPaintRepresentation(ILspInteractivePaintableLayer aLayer, ILspView aView)
aLayer
- the layer.aView
- the view.public abstract Object create(ILspView aView, ILspLayer aLayer)
aView
- the view to create the layer foraLayer
- the layer to create the object forpublic void canceled(TLspEditContext aEditContext)
Called when object creation has been canceled. The default implementation does nothing.
This method is called by the controller. You do not need to call it yourself.
aEditContext
- the edit context for the object that has been canceled. Contains a reference to the object, as well
as the geometry. Also contains a reference to the layer and the view.public void finished(TLspEditContext aEditContext)
This method is called by the controller. You do not need to call it yourself.
aEditContext
- the edit context for the object that has been finished. Contains a reference to the object, as well
as the geometry. Also contains a reference to the layer and the view.public int getMinimumPointCount(TLspEditContext aEditContext)
A method that determines the minimum pointcount for a pointlist during creation. Override to alter the behavior.
Gets the minimum point-count for the given context when creating a new pointlist. By default, this method will look at aEditContext.getGeometry(). If this is an instance of ILcdPolygon, the minimum pointcount will be 3, otherwise it will be 2. Override this method to adjust this minimum value when creating pointlists.
This method is invoked by any point-list based editor in Lightspeed to determine if any existing minimum point count limitations need to be adjusted.
Note that this method will only strengthen any existing limitations of the count of a pointlist, it will not override the default minimum (if there are any).
aEditContext
- the editing context that contains the created geometrypublic int getMaximumPointCount(TLspEditContext aEditContext)
A method that determines the maximum pointcount for a pointlist during creation. Override to alter the behavior.
This method returns the maximum point-count for the given context when create a new pointlist. By default, this returns Integer.MAX_VALUE, to indicate there is no limit on the point-count of a point-list. Override this method to limit the point-count of a pointlist created in the creation phase.
This method is invoked by any point-list based editor in Lightspeed to determine if any existing maximum point count limitations need to be adjusted.
Note that this method will only strengthen any existing limitations of the count of a pointlist, it will not override the default maximum (if there are any).
aEditContext
- the editing context that contains the created geometry