Class ALcyGXYNewControllerActiveSettable<T extends ILcdGXYController>

All Implemented Interfaces:
ILcyActiveSettable, ILcyCustomizableRepresentationActiveSettable, ILcdPropertyChangeSource, Serializable
Direct Known Subclasses:
TLcyGXYNewControllerActiveSettable, TLcyGXYTouchNewControllerActiveSettable

public abstract class ALcyGXYNewControllerActiveSettable<T extends ILcdGXYController> extends TLcyGXYSetControllerActiveSettable implements ILcyCustomizableRepresentationActiveSettable

Abstract base class to create an extension of TLcyGXYSetControllerActiveSettable for a new controller. It allows to double click or shift-click to keep the new 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.

It does so by adapting the button that is representing this active settable, by implementing ILcyCustomizableRepresentationActiveSettable.

Since:
2012.1
See Also:
  • Constructor Details

    • ALcyGXYNewControllerActiveSettable

      protected ALcyGXYNewControllerActiveSettable(ALcyGXYNewControllerModel aControllerModel, ILcyLucyEnv aLucyEnv)

      Utility constructor that creates a new ALcyGXYNewControllerActiveSettable for the given ALcyGXYNewControllerModel.

      It performs these steps automatically:

      • The snappables (setSnappables) of the created controller is set to aControllerModel.getMapComponent().getSnapList().
      • The setActionToTriggerAfterCommit of the new controller is initialized with an action that switches back to the select controller of the current map.
      • The controller is combined with the navigate controller.
      Parameters:
      aControllerModel - The model of the new controller
      aLucyEnv - The Lucy back-end
    • ALcyGXYNewControllerActiveSettable

      protected ALcyGXYNewControllerActiveSettable(ALcdGXYNewControllerModel2 aNewControllerModel, ILcyMapComponent aMapComponent, ILcyLucyEnv aLucyEnv)

      Utility constructor that creates a new ALcyGXYNewControllerActiveSettable for the given ALcdGXYNewControllerModel2.

      It performs these steps automatically:

      • The snappables (setSnappables) of the created controller is set to aControllerModel.getMapComponent().getSnapList().
      • The setActionToTriggerAfterCommit of the new controller is initialized with an action that switches back to the select controller of the map component.
      • The controller is combined with the navigate controller.
      Parameters:
      aNewControllerModel - The model of the new controller
      aMapComponent - The map component on which the controller will be set when the active settable is activated
      aLucyEnv - The Lucy back-end
    • ALcyGXYNewControllerActiveSettable

      protected ALcyGXYNewControllerActiveSettable(T aNewController, ILcdGXYView aGXYView, ILcdAction aActionToTriggerAfterCreation, ILcyLucyEnv aLucyEnv)
      Constructor that creates a new ALcyGXYNewControllerActiveSettable given a new controller, a view and an action
      Parameters:
      aNewController - The controller which will be set on the view when this active settable gets activated
      aGXYView - The view on which the controller will be set
      aActionToTriggerAfterCreation - The action that is triggered after a new instance has been created
      aLucyEnv - The Lucy back-end
    • ALcyGXYNewControllerActiveSettable

      protected ALcyGXYNewControllerActiveSettable(T aNewController, ILcdGXYView aGXYView, ILcdAction aActionToTriggerAfterCreation, ILcdGXYController aControllerToSetToView, ILcyLucyEnv aLucyEnv)
      Constructor that creates a new ALcyGXYNewControllerActiveSettable given a new controller, a view and an action
      Parameters:
      aNewController - The new controller. The action to trigger after commit will be modified to have the special double click behavior (see class comment)
      aGXYView - The view on which the controller will be set
      aActionToTriggerAfterCreation - The action that is triggered after a new instance has been created
      aControllerToSetToView - The controller that is actually set to the ILcdGXYView. It can be different from aNewController to allow wrapping the controller, for example to add navigation capabilities to the controller.
      aLucyEnv - The Lucy back-end
  • Method Details

    • 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 TLcyGXYSetControllerActiveSettable
      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.
    • getGXYNewController

      public T getGXYNewController()
      Returns the new controller. It can be different from TLcyGXYSetControllerActiveSettable.getGXYController() because the controller might for example wrap the new controller to provide navigation capabilities.
      Returns:
      The new controller