Class ALcyGXYNewControllerActiveSettable<T extends ILcdGXYController>
- All Implemented Interfaces:
ILcyActiveSettable
,ILcyCustomizableRepresentationActiveSettable
,ILcdPropertyChangeSource
,Serializable
- Direct Known Subclasses:
TLcyGXYNewControllerActiveSettable
,TLcyGXYTouchNewControllerActiveSettable
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:
-
Field Summary
Fields inherited from interface com.luciad.lucy.gui.ILcyActiveSettable
DEFAULT, LONG_DESCRIPTION, NAME, SHORT_DESCRIPTION, SHOW_ACTION_NAME, SMALL_ICON, SMALL_SELECTED_ICON, VISIBLE
-
Constructor Summary
ModifierConstructorDescriptionprotected
ALcyGXYNewControllerActiveSettable
(ALcyGXYNewControllerModel aControllerModel, ILcyLucyEnv aLucyEnv) Utility constructor that creates a newALcyGXYNewControllerActiveSettable
for the givenALcyGXYNewControllerModel
.protected
ALcyGXYNewControllerActiveSettable
(ALcdGXYNewControllerModel2 aNewControllerModel, ILcyMapComponent aMapComponent, ILcyLucyEnv aLucyEnv) Utility constructor that creates a newALcyGXYNewControllerActiveSettable
for the givenALcdGXYNewControllerModel2
.protected
ALcyGXYNewControllerActiveSettable
(T aNewController, ILcdGXYView aGXYView, ILcdAction aActionToTriggerAfterCreation, ILcyLucyEnv aLucyEnv) Constructor that creates a newALcyGXYNewControllerActiveSettable
given a new controller, a view and an actionprotected
ALcyGXYNewControllerActiveSettable
(T aNewController, ILcdGXYView aGXYView, ILcdAction aActionToTriggerAfterCreation, ILcdGXYController aControllerToSetToView, ILcyLucyEnv aLucyEnv) Constructor that creates a newALcyGXYNewControllerActiveSettable
given a new controller, a view and an action -
Method Summary
Modifier and TypeMethodDescriptioncustomizeRepresentation
(Component aDefaultComponent, ILcyActiveSettable aWrapperActiveSettable, ILcyActionBar aActionBar) Allows to customize or replace the default component that is used to represent thisILcyActiveSettable
(typically aJToggleButton
).Returns the new controller.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.Methods inherited from class com.luciad.lucy.map.action.TLcyGXYSetControllerActiveSettable
combineWithNavigateController, getGXYController, getGXYView, getLucyEnv, isActive, setGXYController, setGXYView
Methods inherited from class com.luciad.lucy.gui.ALcyActiveSettable
addPropertyChangeListener, firePropertyChange, getDisplayName, getIcon, getLongDescription, getName, getShortDescription, getValue, isEnabled, putValue, removePropertyChangeListener, setDisplayName, setEnabled, setIcon, setLongDescription, setName, setShortDescription
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.util.ILcdPropertyChangeSource
addPropertyChangeListener, removePropertyChangeListener
Methods inherited from interface com.luciad.lucy.gui.ILcyActiveSettable
getValue, isActive, isEnabled, putValue, setEnabled
-
Constructor Details
-
ALcyGXYNewControllerActiveSettable
protected ALcyGXYNewControllerActiveSettable(ALcyGXYNewControllerModel aControllerModel, ILcyLucyEnv aLucyEnv) Utility constructor that creates a new
ALcyGXYNewControllerActiveSettable
for the givenALcyGXYNewControllerModel
.It performs these steps automatically:
- The snappables (
setSnappables
) of the created controller is set toaControllerModel.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 controlleraLucyEnv
- The Lucy back-end
- The snappables (
-
ALcyGXYNewControllerActiveSettable
protected ALcyGXYNewControllerActiveSettable(ALcdGXYNewControllerModel2 aNewControllerModel, ILcyMapComponent aMapComponent, ILcyLucyEnv aLucyEnv) Utility constructor that creates a new
ALcyGXYNewControllerActiveSettable
for the givenALcdGXYNewControllerModel2
.It performs these steps automatically:
- The snappables (
setSnappables
) of the created controller is set toaControllerModel.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 controlleraMapComponent
- The map component on which the controller will be set when the active settable is activatedaLucyEnv
- The Lucy back-end
- The snappables (
-
ALcyGXYNewControllerActiveSettable
protected ALcyGXYNewControllerActiveSettable(T aNewController, ILcdGXYView aGXYView, ILcdAction aActionToTriggerAfterCreation, ILcyLucyEnv aLucyEnv) Constructor that creates a newALcyGXYNewControllerActiveSettable
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 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-end
-
ALcyGXYNewControllerActiveSettable
protected ALcyGXYNewControllerActiveSettable(T aNewController, ILcdGXYView aGXYView, ILcdAction aActionToTriggerAfterCreation, ILcdGXYController aControllerToSetToView, ILcyLucyEnv aLucyEnv) Constructor that creates a newALcyGXYNewControllerActiveSettable
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 setaActionToTriggerAfterCreation
- The action that is triggered after a new instance has been createdaControllerToSetToView
- The controller that is actually set to theILcdGXYView
. It can be different fromaNewController
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 thisILcyActiveSettable
(typically aJToggleButton
).- Specified by:
customizeRepresentation
in interfaceILcyCustomizableRepresentationActiveSettable
- 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 interfaceILcyActiveSettable
- Overrides:
setActive
in classTLcyGXYSetControllerActiveSettable
- Parameters:
aActive
- True if the new state is active, false if the new state is inactive.- See Also:
-
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
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
Returns the new controller. It can be different fromTLcyGXYSetControllerActiveSettable.getGXYController()
because the controller might for example wrap the new controller to provide navigation capabilities.- Returns:
- The new controller
-