Class ALspCreateControllerModel
- Direct Known Subclasses:
ALcyLspCreateControllerModel
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.
- Since:
- 2012.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
canceled
(TLspEditContext aEditContext) Called when object creation has been canceled.abstract Object
Create a new (empty) objectvoid
finished
(TLspEditContext aEditContext) Called when object creation has finished.abstract ILspInteractivePaintableLayer
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.getPaintRepresentation
(ILspInteractivePaintableLayer aLayer, ILspView aView) Gets the paint representation which is used to retrieve an editor for object creation.
-
Constructor Details
-
ALspCreateControllerModel
public ALspCreateControllerModel()
-
-
Method Details
-
getLayer
Gets the layer to which the created object should be added.- Parameters:
aView
- the view the layer should belong to- Returns:
- the layer to create objects for, or null if the controller model cannot create objects for the given view
-
getPaintRepresentation
public TLspPaintRepresentation getPaintRepresentation(ILspInteractivePaintableLayer aLayer, ILspView aView) Gets the paint representation which is used to retrieve an editor for object creation. The default implementation returns {TLspPaintRepresentation.BODY}.- Parameters:
aLayer
- the layer.aView
- the view.- Returns:
- the paint representation
-
create
Create a new (empty) object- Parameters:
aView
- the view to create the layer foraLayer
- the layer to create the object for- Returns:
- a new object, or null if the controller model could not create an object for the given layer
-
canceled
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.
- Parameters:
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.
-
finished
Called when object creation has finished. The default implementation does nothing.This method is called by the controller. You do not need to call it yourself.
- Parameters:
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.
-
getMinimumPointCount
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).
- Parameters:
aEditContext
- the editing context that contains the created geometry- Returns:
- a value between 0 and Integer.MAX_VALUE
-
getMaximumPointCount
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).
- Parameters:
aEditContext
- the editing context that contains the created geometry- Returns:
- a value between 1 and Integer.MAX_VALUE
-