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
.
DEFAULT, LONG_DESCRIPTION, NAME, SHORT_DESCRIPTION, SHOW_ACTION_NAME, SMALL_ICON, SMALL_SELECTED_ICON, VISIBLE
Modifier | Constructor and Description |
---|---|
protected |
ALcyGXYNewControllerActiveSettable(ALcdGXYNewControllerModel2 aNewControllerModel,
ILcyMapComponent aMapComponent,
ILcyLucyEnv aLucyEnv)
Utility constructor that creates a new
ALcyGXYNewControllerActiveSettable for the
given ALcdGXYNewControllerModel2 . |
protected |
ALcyGXYNewControllerActiveSettable(ALcyGXYNewControllerModel aControllerModel,
ILcyLucyEnv aLucyEnv)
Utility constructor that creates a new
ALcyGXYNewControllerActiveSettable for the
given ALcyGXYNewControllerModel . |
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 |
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 |
Modifier and Type | Method and Description |
---|---|
Component |
customizeRepresentation(Component aDefaultComponent,
ILcyActiveSettable aWrapperActiveSettable,
ILcyActionBar aActionBar)
Allows to customize or replace the default component that is used to represent this
ILcyActiveSettable (typically a JToggleButton ). |
T |
getGXYNewController()
Returns the new controller.
|
ILcdIcon |
getKeepActiveIcon()
Returns the icon that will be super imposed over the normal icon in case the active settable is
kept active.
|
void |
setActive(boolean aActive)
Sets the active state of this object.
|
void |
setKeepActiveIcon(ILcdIcon aIcon)
Sets the icon that will be super imposed over the normal icon in case the active settable is
kept active.
|
combineWithNavigateController, getGXYController, getGXYView, getLucyEnv, isActive, setGXYController, setGXYView
addPropertyChangeListener, firePropertyChange, getDisplayName, getIcon, getLongDescription, getName, getShortDescription, getValue, isEnabled, putValue, removePropertyChangeListener, setDisplayName, setEnabled, setIcon, setLongDescription, setName, setShortDescription
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getValue, isActive, isEnabled, putValue, setEnabled
addPropertyChangeListener, removePropertyChangeListener
protected ALcyGXYNewControllerActiveSettable(ALcyGXYNewControllerModel aControllerModel, ILcyLucyEnv aLucyEnv)
Utility constructor that creates a new ALcyGXYNewControllerActiveSettable
for the
given ALcyGXYNewControllerModel
.
It performs these steps automatically:
setSnappables
) of the created controller is set to aControllerModel.getMapComponent().getSnapList()
.setActionToTriggerAfterCommit
of the new controller is initialized with an
action that switches back to the select controller of the current map.aControllerModel
- The model of the new controlleraLucyEnv
- The Lucy back-endprotected ALcyGXYNewControllerActiveSettable(ALcdGXYNewControllerModel2 aNewControllerModel, ILcyMapComponent aMapComponent, ILcyLucyEnv aLucyEnv)
Utility constructor that creates a new ALcyGXYNewControllerActiveSettable
for the
given ALcdGXYNewControllerModel2
.
It performs these steps automatically:
setSnappables
) of the created controller is set to aControllerModel.getMapComponent().getSnapList()
.setActionToTriggerAfterCommit
of the new controller is initialized with an
action that switches back to the select controller of the map component.aNewControllerModel
- The model of the new controlleraMapComponent
- The map component on which the controller will be set when the
active settable is activatedaLucyEnv
- The Lucy back-endprotected ALcyGXYNewControllerActiveSettable(T aNewController, ILcdGXYView aGXYView, ILcdAction aActionToTriggerAfterCreation, ILcyLucyEnv aLucyEnv)
ALcyGXYNewControllerActiveSettable
given a new
controller, a view and an actionaNewController
- The controller which will be set on the view when this
active settable gets activatedaGXYView
- The view on which the controller will be setaActionToTriggerAfterCreation
- The action that is triggered after a new instance has been
createdaLucyEnv
- The Lucy back-endprotected ALcyGXYNewControllerActiveSettable(T aNewController, ILcdGXYView aGXYView, ILcdAction aActionToTriggerAfterCreation, ILcdGXYController aControllerToSetToView, ILcyLucyEnv aLucyEnv)
ALcyGXYNewControllerActiveSettable
given a new
controller, a view and an actionaNewController
- 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 setaActionToTriggerAfterCreation
- The action that is triggered after a new instance has been
createdaControllerToSetToView
- 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-endpublic Component customizeRepresentation(Component aDefaultComponent, ILcyActiveSettable aWrapperActiveSettable, ILcyActionBar aActionBar)
ILcyCustomizableRepresentationActiveSettable
ILcyActiveSettable
(typically a JToggleButton
).customizeRepresentation
in interface ILcyCustomizableRepresentationActiveSettable
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..return aDefaultComponent;
.TLcyAlwaysFitJToolBar.createToolBarPanel(java.awt.Component)
public void setActive(boolean aActive)
ILcyActiveSettable
setActive
in interface ILcyActiveSettable
setActive
in class TLcyGXYSetControllerActiveSettable
aActive
- True if the new state is active, false if the new state is inactive.ILcyActiveSettable.isActive()
public ILcdIcon getKeepActiveIcon()
public void setKeepActiveIcon(ILcdIcon aIcon)
aIcon
- the to super impose over the normal icon when the active settable is kept active.public T getGXYNewController()
TLcyGXYSetControllerActiveSettable.getGXYController()
because the
controller might for example wrap the new controller to provide navigation capabilities.