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.
ALcyGXYNewControllerActiveSettable
,
Serialized FormDEFAULT, LONG_DESCRIPTION, NAME, SHORT_DESCRIPTION, SHOW_ACTION_NAME, SMALL_ICON, SMALL_SELECTED_ICON, VISIBLE
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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. |
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. |
static TLcyLspCreateControllerActiveSettable |
createTouchControllerActiveSettable(ALspCreateControllerModel aCreateControllerModel,
ILcyLspMapComponent aLspMapComponent,
ILcyLucyEnv aLucyEnv)
Factory method to create a
TLcyLspCreateControllerActiveSettable which allows to create
new shapes through touch interaction. |
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 ). |
TLspCreateController |
getCreateController()
Returns the create 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.
|
getController, getLucyEnv, getValue, getView, isActive, isEnabled, putValue, setController, setEnabled, setView
addPropertyChangeListener, firePropertyChange, getDisplayName, getIcon, getLongDescription, getName, getShortDescription, removePropertyChangeListener, setDisplayName, setIcon, setLongDescription, setName, setShortDescription
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getValue, isActive, isEnabled, putValue, setEnabled
addPropertyChangeListener, removePropertyChangeListener
public TLcyLspCreateControllerActiveSettable(TLspCreateController aCreateController, ILspController aControllerToSetOnView, ILspView aView, ILcdAction aActionToTriggerAfterCreation, ILcyLucyEnv aLucyEnv)
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-endpublic static TLcyLspCreateControllerActiveSettable createMouseControllerActiveSettable(ALspCreateControllerModel aCreateControllerModel, ILcyLspMapComponent aLspMapComponent, ILcyLucyEnv aLucyEnv)
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
.aCreateControllerModel
- The controller modelaLspMapComponent
- The map component.aLucyEnv
- The Lucy back-endTLcyLspCreateControllerActiveSettable
public static TLcyLspCreateControllerActiveSettable createTouchControllerActiveSettable(ALspCreateControllerModel aCreateControllerModel, ILcyLspMapComponent aLspMapComponent, ILcyLucyEnv aLucyEnv)
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
.aCreateControllerModel
- The controller modelaLspMapComponent
- The map component.aLucyEnv
- The Lucy back-endTLcyLspCreateControllerActiveSettable
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.
aCreateControllerModel
- The controller modelaLspMapComponent
- The map componentaProperties
- The relevant (addon) propertiesaConfigPrefix
- The configuration prefix for this active settable.aLucyEnv
- The Lucy back-endTLcyLspCreateControllerActiveSettable
which allows to create new shapes
through touch interaction.public 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 TLcyLspSetControllerActiveSettable
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 final TLspCreateController getCreateController()
TLcyLspSetControllerActiveSettable.getController()
because the
controller on the view can be a chain of controllers containing the create controller, for
example to provide navigation capabilities.