public class TLcyGXYSetControllerActiveSettable extends ALcyActiveSettable
An active settable implementation which allows to activate a controller on a GXY view.
When calling setActive(true)
, the active settable will install the controller on the GXY view.
The active settable will de-activate itself when another controller is placed on the view.
Note: this active settable does nothing when calling setActive(false)
.
To de-activate it, you need to install another controller on the view.
This means that typically you use multiple instances of this class, allowing the user of your application to
switch between different controllers.
To ensure that this is reflected in the UI, you need to indicate that de-activation of this active settable is not
possible when inserting it into the UI.
For example by passing false
as last argument in TLcyActionBarUtil#insertInConfiguredActionBars
,
or ILcyActionBar#insertActiveSettable
.
TLcdGXYSetControllerAction
,
Serialized FormDEFAULT, LONG_DESCRIPTION, NAME, SHORT_DESCRIPTION, SHOW_ACTION_NAME, SMALL_ICON, SMALL_SELECTED_ICON, VISIBLE
Constructor and Description |
---|
TLcyGXYSetControllerActiveSettable(ILcdGXYController aGXYController,
ILcdGXYView aGXYView,
ILcyLucyEnv aLucyEnv)
Creates a new
TLcyGXYSetControllerActiveSettable for the given controller and the given view. |
Modifier and Type | Method and Description |
---|---|
static TLcdGXYCompositeController |
combineWithNavigateController(ILcyMapComponent aMap,
ILcdGXYController aOriginal)
Combines the given controller with the
navigate controller.
|
ILcdGXYController |
getGXYController()
Returns the controller of this active settable.
|
ILcdGXYView |
getGXYView()
Returns the view the associated controller will be set on.
|
protected ILcyLucyEnv |
getLucyEnv()
Returns the current Lucy environment.
|
boolean |
isActive()
Returns true if the state of this object is active, false if the state is inactive.
|
void |
setActive(boolean aActive)
Sets the active state of this object.
|
void |
setGXYController(ILcdGXYController aGXYController)
Sets the controller of this active settable.
|
void |
setGXYView(ILcdGXYView aGXYView)
Sets the view the associated controller will be set on.
|
addPropertyChangeListener, firePropertyChange, getDisplayName, getIcon, getLongDescription, getName, getShortDescription, getValue, isEnabled, putValue, removePropertyChangeListener, setDisplayName, setEnabled, setIcon, setLongDescription, setName, setShortDescription
public TLcyGXYSetControllerActiveSettable(ILcdGXYController aGXYController, ILcdGXYView aGXYView, ILcyLucyEnv aLucyEnv)
TLcyGXYSetControllerActiveSettable
for the given controller and the given view.aGXYController
- The controller to activate. If null
is provided, a controller
must be set before using this active settable.aGXYView
- The view to set the controller on. If null
is provided, a viewaLucyEnv
- The current Lucy environmentpublic boolean isActive()
ILcyActiveSettable
ILcyActiveSettable.setActive(boolean)
).ILcyActiveSettable.setActive(boolean)
public void setActive(boolean aActive)
ILcyActiveSettable
aActive
- True if the new state is active, false if the new state is inactive.ILcyActiveSettable.isActive()
public ILcdGXYController getGXYController()
public void setGXYController(ILcdGXYController aGXYController)
aGXYController
- The controller to work on.protected ILcyLucyEnv getLucyEnv()
public ILcdGXYView getGXYView()
public void setGXYView(ILcdGXYView aGXYView)
aGXYView
- The new view to set the controller to.public static TLcdGXYCompositeController combineWithNavigateController(ILcyMapComponent aMap, ILcdGXYController aOriginal)
aMap
- The map.aOriginal
- The controller to combine the navigate controller with. Note that this controller shouldn't
be using the mouse wheel, as that will conflict with the navigate controller.