Class TLcyLspCreateControllerActiveSettable
- All Implemented Interfaces:
ILcyActiveSettable
,ILcyCustomizableRepresentationActiveSettable
,ILcdPropertyChangeSource
,Serializable
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:
-
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
ConstructorDescriptionTLcyLspCreateControllerActiveSettable
(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. -
Method Summary
Modifier and TypeMethodDescriptioncreateMouseControllerActiveSettable
(ALspCreateControllerModel aCreateControllerModel, ILcyLspMapComponent aLspMapComponent, ILcyLucyEnv aLucyEnv) Factory method to create aTLcyLspCreateControllerActiveSettable
which allows to create new shapes through interaction with the mouse.createTouchControllerActiveSettable
(ALspCreateControllerModel aCreateControllerModel, ILcyLspMapComponent aLspMapComponent, ILcyLucyEnv aLucyEnv) Factory method to create aTLcyLspCreateControllerActiveSettable
which allows to create new shapes through touch interaction.createTouchControllerActiveSettable
(ALspCreateControllerModel aCreateControllerModel, ILcyLspMapComponent aLspMapComponent, ALcyProperties aProperties, String aConfigPrefix, ILcyLucyEnv aLucyEnv) Similar tocreateTouchControllerActiveSettable
, but this method also adds commit and cancel actions to the action bars when they are configured in the given properties object.customizeRepresentation
(Component aDefaultComponent, ILcyActiveSettable aWrapperActiveSettable, ILcyActionBar aActionBar) Allows to customize or replace the default component that is used to represent thisILcyActiveSettable
(typically aJToggleButton
).final TLspCreateController
Returns the create 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.lightspeed.TLcyLspSetControllerActiveSettable
getController, getLucyEnv, getValue, getView, isActive, isEnabled, putValue, setController, setEnabled, setView
Methods inherited from class com.luciad.lucy.gui.ALcyActiveSettable
addPropertyChangeListener, firePropertyChange, getDisplayName, getIcon, getLongDescription, getName, getShortDescription, removePropertyChangeListener, setDisplayName, 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
-
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 benull
aControllerToSetOnView
- The actual controller which will be set on the view. This might be different fromaCreateController
, for example ifaCreateController
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 benull
aActionToTriggerAfterCreation
- The action to trigger when the creation is complete. May benull
aLucyEnv
- The Lucy back-end
-
-
Method Details
-
createMouseControllerActiveSettable
public static TLcyLspCreateControllerActiveSettable createMouseControllerActiveSettable(ALspCreateControllerModel aCreateControllerModel, ILcyLspMapComponent aLspMapComponent, ILcyLucyEnv aLucyEnv) Factory method to create aTLcyLspCreateControllerActiveSettable
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 forTLcyLspMapComponent
instances which contain aTLcyLspMapComponentFactory.PAN_CONTROLLER
.- Parameters:
aCreateControllerModel
- The controller modelaLspMapComponent
- 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 aTLcyLspCreateControllerActiveSettable
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 forTLcyLspMapComponent
instances which contain aTLcyLspMapComponentFactory.PAN_TOUCH_CONTROLLER
.- Parameters:
aCreateControllerModel
- The controller modelaLspMapComponent
- 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 (seeALcyPreferencesAddOn.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 modelaLspMapComponent
- The map componentaProperties
- The relevant (addon) propertiesaConfigPrefix
- 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 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 classTLcyLspSetControllerActiveSettable
- 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.
-
getCreateController
Returns the create controller. It can be different fromTLcyLspSetControllerActiveSettable.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
-