Class ALspCreateEditorModel<T extends ILcdShape>

java.lang.Object
com.luciad.view.lightspeed.editor.ALspCreateEditorModel<T>
Direct Known Subclasses:
TLspCreateCurveEditorModel

public abstract class ALspCreateEditorModel<T extends ILcdShape> extends Object
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 Details

    • ALspCreateEditorModel

      public ALspCreateEditorModel()
  • Method Details

    • create

      public abstract T create(TLspContext aContext)
      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, the fireChangeEvent 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

      public void addChangeListener(ChangeListener aChangeListener)
      Adds a change listener to this create editor model, that is notified every time a call to the create method results in a new type of shape.
      Parameters:
      aChangeListener - a change listener
      See Also:
    • removeChangeListener

      public void removeChangeListener(ChangeListener aChangeListener)
      Removes a previously registered change listener
      Parameters:
      aChangeListener - a change listener that was previously registered
    • fireChangeEvent

      protected void fireChangeEvent(ChangeEvent aEvent)
      Subclasses of ALspCreateEditorModel should call this method every time a change occurs in the output type of the create(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