Class TLcyGXYSetControllerActiveSettable

java.lang.Object
com.luciad.lucy.gui.ALcyActiveSettable
com.luciad.lucy.map.action.TLcyGXYSetControllerActiveSettable
All Implemented Interfaces:
ILcyActiveSettable, ILcdPropertyChangeSource, Serializable
Direct Known Subclasses:
ALcyGXYNewControllerActiveSettable

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.

See Also:
  • Constructor Details

    • TLcyGXYSetControllerActiveSettable

      public TLcyGXYSetControllerActiveSettable(ILcdGXYController aGXYController, ILcdGXYView aGXYView, ILcyLucyEnv aLucyEnv)
      Creates a new TLcyGXYSetControllerActiveSettable for the given controller and the given view.
      Parameters:
      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 view
      aLucyEnv - The current Lucy environment
  • Method Details

    • isActive

      public boolean isActive()
      Description copied from interface: ILcyActiveSettable
      Returns true if the state of this object is active, false if the state is inactive. As for every property: whenever the return value of this method changes, a property change event must be fired (see ILcyActiveSettable.setActive(boolean)).
      Returns:
      true if the state of this object is active, false if the state is inactive.
      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.

      Parameters:
      aActive - True if the new state is active, false if the new state is inactive.
      See Also:
    • getGXYController

      public ILcdGXYController getGXYController()
      Returns the controller of this active settable.
      Returns:
      the controller of this active settable.
    • setGXYController

      public void setGXYController(ILcdGXYController aGXYController)
      Sets the controller of this active settable.
      Parameters:
      aGXYController - The controller to work on.
    • getLucyEnv

      protected ILcyLucyEnv getLucyEnv()
      Returns the current Lucy environment.
      Returns:
      the current Lucy environment
    • getGXYView

      public ILcdGXYView getGXYView()
      Returns the view the associated controller will be set on.
      Returns:
      the view the associated controller will be set on.
    • setGXYView

      public void setGXYView(ILcdGXYView aGXYView)
      Sets the view the associated controller will be set on.
      Parameters:
      aGXYView - The new view to set the controller to.
    • combineWithNavigateController

      public static TLcdGXYCompositeController combineWithNavigateController(ILcyMapComponent aMap, ILcdGXYController aOriginal)
      Combines the given controller with the navigate controller. The navigate controller allows to pan and zoom using the mouse wheel.
      Parameters:
      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.
      Returns:
      The combined controller having both the original and the navigate behavior.