Class ALspCreateEditorModel<T extends ILcdShape>
java.lang.Object
com.luciad.view.lightspeed.editor.ALspCreateEditorModel<T>
- Direct Known Subclasses:
TLspCreateCurveEditorModel
An abstract class that can be used by editors to create a new (sub-)shape. The output
of the
create
method is assumed
to be of the same type. If the type changes, an event should be fired internally using
the fireChangeEvent(javax.swing.event.ChangeEvent)
method.- Since:
- 2012.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addChangeListener
(ChangeListener aChangeListener) Adds a change listener to this create editor model, that is notified every time a call to thecreate
method results in a new type of shape.abstract T
create
(TLspContext aContext) Creates a new shape, based on the given context.protected void
fireChangeEvent
(ChangeEvent aEvent) Subclasses ofALspCreateEditorModel
should call this method every time a change occurs in the output type of thecreate(com.luciad.view.lightspeed.TLspContext)
method.void
removeChangeListener
(ChangeListener aChangeListener) Removes a previously registered change listener
-
Constructor Details
-
ALspCreateEditorModel
public ALspCreateEditorModel()
-
-
Method Details
-
create
Creates a new shape, based on the given context. The output of this method is assumed to be constant over time (i.e. of the same type). If the type changes, thefireChangeEvent
method should be called to notify all listeners of this create editor model.- Parameters:
aContext
- context information. Contains the view and layer for which the shape should be created. Important here is that the created shape is defined in the same reference as the model in this context.- Returns:
- a new shape
-
addChangeListener
Adds a change listener to this create editor model, that is notified every time a call to thecreate
method results in a new type of shape.- Parameters:
aChangeListener
- a change listener- See Also:
-
removeChangeListener
Removes a previously registered change listener- Parameters:
aChangeListener
- a change listener that was previously registered
-
fireChangeEvent
Subclasses ofALspCreateEditorModel
should call this method every time a change occurs in the output type of thecreate(com.luciad.view.lightspeed.TLspContext)
method. This notifies all listeners so they can act accordingly to the changed state.- Parameters:
aEvent
- the event to fire
-