Class ALspCreateEditorModel<T extends ILcdShape>

Direct Known Subclasses:

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.
  • 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.
      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.
      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.
      aChangeListener - a change listener
      See Also:
    • removeChangeListener

      public void removeChangeListener(ChangeListener aChangeListener)
      Removes a previously registered change listener
      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.
      aEvent - the event to fire