Class TLcyLspCreateControllerActiveSettable

All Implemented Interfaces:
ILcyActiveSettable, ILcyCustomizableRepresentationActiveSettable, ILcdPropertyChangeSource, Serializable

public class TLcyLspCreateControllerActiveSettable extends TLcyLspSetControllerActiveSettable implements ILcyCustomizableRepresentationActiveSettable

An extension of TLcyLspSetControllerActiveSettable for new controllers. It allows to double click or shift-click to keep the creation controller active. This allows to easily create multiple objects/ When it is kept active, a little plus icon is displayed on top of the regular icon.

Since:
2012.1
See Also:
  • Constructor Details

    • TLcyLspCreateControllerActiveSettable

      public TLcyLspCreateControllerActiveSettable(TLspCreateController aCreateController, ILspController aControllerToSetOnView, ILspView aView, ILcdAction aActionToTriggerAfterCreation, ILcyLucyEnv aLucyEnv)
      Constructor that creates a new active settable allowing to set a new controller on the view.
      Parameters:
      aCreateController - The create controller. Must not be null
      aControllerToSetOnView - The actual controller which will be set on the view. This might be different from aCreateController, for example if aCreateController is part of a chain of controllers to allow navigation as well.
      aView - The view on which the controller will be set when this active settable is activated. Must not be null
      aActionToTriggerAfterCreation - The action to trigger when the creation is complete. May be null
      aLucyEnv - The Lucy back-end
  • Method Details

    • createMouseControllerActiveSettable

      public static TLcyLspCreateControllerActiveSettable createMouseControllerActiveSettable(ALspCreateControllerModel aCreateControllerModel, ILcyLspMapComponent aLspMapComponent, ILcyLucyEnv aLucyEnv)
      Factory method to create a TLcyLspCreateControllerActiveSettable which allows to create new shapes through interaction with the mouse. This method will create the controller, add navigation capabilities to it and switch to the select controller after the shape has been created which allows to immediately start editing the shape after creation. The latter will only work for TLcyLspMapComponent instances which contain a TLcyLspMapComponentFactory.PAN_CONTROLLER.
      Parameters:
      aCreateControllerModel - The controller model
      aLspMapComponent - The map component.
      aLucyEnv - The Lucy back-end
      Returns:
      A new TLcyLspCreateControllerActiveSettable
    • createTouchControllerActiveSettable

      public static TLcyLspCreateControllerActiveSettable createTouchControllerActiveSettable(ALspCreateControllerModel aCreateControllerModel, ILcyLspMapComponent aLspMapComponent, ILcyLucyEnv aLucyEnv)
      Factory method to create a TLcyLspCreateControllerActiveSettable which allows to create new shapes through touch interaction. This method will create the controller, add navigation capabilities to it and switch to the select controller after the shape has been created which allows to immediately start editing the shape after creation. The latter will only work for TLcyLspMapComponent instances which contain a TLcyLspMapComponentFactory.PAN_TOUCH_CONTROLLER.
      Parameters:
      aCreateControllerModel - The controller model
      aLspMapComponent - The map component.
      aLucyEnv - The Lucy back-end
      Returns:
      A new TLcyLspCreateControllerActiveSettable
    • createTouchControllerActiveSettable

      public static TLcyLspCreateControllerActiveSettable createTouchControllerActiveSettable(ALspCreateControllerModel aCreateControllerModel, ILcyLspMapComponent aLspMapComponent, ALcyProperties aProperties, String aConfigPrefix, ILcyLucyEnv aLucyEnv)

      Similar to createTouchControllerActiveSettable, but this method also adds commit and cancel actions to the action bars when they are configured in the given properties object. This properties object is typically an object containing the addon's preferences (see ALcyPreferencesAddOn.getPreferences()).

      It can be used to add the "commitAction" or "cancelAction" on the map. E.g. when the configuration prefix for this active settable is TLcyExampleAddOn.createObject.touchNewController, the following properties can be used:

       TLcyExampleAddOn.createObject.touchNewController.commitAction.onMapActionBar.item=Commit
       TLcyExampleAddOn.createObject.touchNewController.commitAction.onMapActionBar.groups=NewGroup
       TLcyExampleAddOn.createObject.touchNewController.cancelAction.onMapActionBar.item=Cancel
       TLcyExampleAddOn.createObject.touchNewController.cancelAction.onMapActionBar.groups=NewGroup
       

      See the Lucy developer guide for more information on how to configure menu items and toolbar buttons.

      Parameters:
      aCreateControllerModel - The controller model
      aLspMapComponent - The map component
      aProperties - The relevant (addon) properties
      aConfigPrefix - The configuration prefix for this active settable.
      aLucyEnv - The Lucy back-end
      Returns:
      a TLcyLspCreateControllerActiveSettable which allows to create new shapes through touch interaction.
    • customizeRepresentation

      public Component customizeRepresentation(Component aDefaultComponent, ILcyActiveSettable aWrapperActiveSettable, ILcyActionBar aActionBar)
      Description copied from interface: ILcyCustomizableRepresentationActiveSettable
      Allows to customize or replace the default component that is used to represent this ILcyActiveSettable (typically a JToggleButton).
      Specified by:
      customizeRepresentation in interface ILcyCustomizableRepresentationActiveSettable
      Parameters:
      aDefaultComponent - The component that normally represents this active settable.
      aWrapperActiveSettable - In case this active settable is wrapped (for example when using (TLcyActionBarUtil), this parameter is the wrapper active settable, if not, it is this active settable. This is useful to retrieve properties such as the name or the icon of the active settable which can be different for different wrapper instances. E.g., a tool bar might use a different icon as a menu bar. And if the active settable is customized for the tool bar, it might be required to retrieve the tool bar icon.
      aActionBar - The action bar in which this active settable is going to be inserted, provided as contextual information..
      Returns:
      A customized or new component to represent this active settable. The simplest (but not useful) implementation of this method would be return aDefaultComponent;.
      See Also:
    • setActive

      public void setActive(boolean aActive)
      Description copied from interface: ILcyActiveSettable
      Sets the active state of this object. When the new state is different from the previous state, a certain action will need to be performed. Also a property change event will be fired in such a case. If no property change event is fired, synchronization between this ILcyActiveSettable and the GUI widget representing it will probably fail (e.g. the checkbox will not change state).

      Note: refer to Implementing Bound Property Support Within a Bean for an example about firing a property change.

      Specified by:
      setActive in interface ILcyActiveSettable
      Overrides:
      setActive in class TLcyLspSetControllerActiveSettable
      Parameters:
      aActive - True if the new state is active, false if the new state is inactive.
      See Also:
    • getKeepActiveIcon

      public ILcdIcon getKeepActiveIcon()
      Returns the icon that will be super imposed over the normal icon in case the active settable is kept active. The initial value will be an icon depicting a small plus symbol.
      Returns:
      the icon that will be super imposed over the normal icon when the active settable is kept active.
    • setKeepActiveIcon

      public void setKeepActiveIcon(ILcdIcon aIcon)
      Sets the icon that will be super imposed over the normal icon in case the active settable is kept active. The initial value will be an icon depicting a small plus symbol.
      Parameters:
      aIcon - the to super impose over the normal icon when the active settable is kept active.
    • getCreateController

      public final TLspCreateController getCreateController()
      Returns the create controller. It can be different from TLcyLspSetControllerActiveSettable.getController() because the controller on the view can be a chain of controllers containing the create controller, for example to provide navigation capabilities.
      Returns:
      the create controller