Class ALcdGXYController

java.lang.Object
com.luciad.view.gxy.controller.ALcdGXYController
All Implemented Interfaces:
ILcdStatusSource, ILcdGXYController, Serializable
Direct Known Subclasses:
ALcdGXYChainableController, ALcdGXYSmartController, TLcdGXYNavigateController, TLcdGXYNoopController, TLcdGXYZoomWheelController, TLcdMapGridRulerController

public abstract class ALcdGXYController extends Object implements ILcdGXYController, ILcdStatusSource
A base class of ILcdGXYController that interacts with one view at a time. It automatically sets the view's cursor and stores a reference to the view the controller is interacting with. A typical controller extends this class in the following way: This controller can also send out status events to its status listeners.
See Also:
  • Constructor Details

    • ALcdGXYController

      public ALcdGXYController()
  • Method Details

    • addStatusListener

      public void addStatusListener(ILcdStatusListener aStatusListener)
      Description copied from interface: ILcdStatusSource

      Registers the given listener so it will receive status events from this source.

      In case you need to register a listener which keeps a reference to an object with a shorter life-time than this status source, you can use a ALcdWeakStatusListener instance as status listener.

      Specified by:
      addStatusListener in interface ILcdStatusSource
      Parameters:
      aStatusListener - The listener to be notified when the status has changed.
    • removeStatusListener

      public void removeStatusListener(ILcdStatusListener aStatusListener)
      Description copied from interface: ILcdStatusSource
      Removes the specified listener so it is no longer notified.
      Specified by:
      removeStatusListener in interface ILcdStatusSource
      Parameters:
      aStatusListener - The listener to remove.
    • fireStatusEvent

      protected void fireStatusEvent(TLcdStatusEvent aStatusEvent)
    • setClassTraceOn

      public static void setClassTraceOn(boolean aClassTraceOn)
      Deprecated.
      This method has been deprecated. It is recommended to use the standard Java logging framework directly.
      Enables tracing for all instances of this class. If the argument is true then all log messages are recorded, otherwise only the informative, warning and error messages are recorded.
      Parameters:
      aClassTraceOn - if true then all log messages are recorded, otherwise only the informative, warning and error messages are recorded.
    • setTraceOn

      public void setTraceOn(boolean aTraceOn)
      Deprecated.
      This method has been deprecated. It is recommended to use the standard Java logging framework directly.
      Enables tracing for this class instance. Calling this method with either true or false as argument automatically turns off tracing for all other class instances for which setTraceOn has not been called. If the argument is false then only the informative, warning and error log messages are recorded.
      Parameters:
      aTraceOn - if true then all log messages are recorded for this instance. If false, then only the informative, warning and error log messages are recorded.
    • isTraceOn

      public boolean isTraceOn()
      Deprecated.
      This method has been deprecated. It is recommended to use the standard Java logging framework directly.
      Returns true if tracing is enabled for this class.
      Returns:
      true if tracing is enabled for this class, false otherwise.
    • asGXYController

      public ILcdGXYController asGXYController()
    • startInteraction

      public void startInteraction(ILcdGXYView aGXYView)
      Sets up the controller to receive input through the view passed.

      All ILcdGXYView implementations that support interaction call this method when the controller has been made active with setGXYController on the view, so this method shouldn't normally be called directly. Note that most view implementations add the controller as listener if appropriate before calling this method.

      Sets the cursor on the view and sets the view for which this controller is now active. Sends out a status event based on the short description.

      Specified by:
      startInteraction in interface ILcdGXYController
      Parameters:
      aGXYView - the ILcdGXYView this ILcdGXYController will interact with.
      See Also:
    • terminateInteraction

      public void terminateInteraction(ILcdGXYView aGXYView)
      Releases a few items. Can be redefined but this 'super' method should be called too.
      Specified by:
      terminateInteraction in interface ILcdGXYController
      Parameters:
      aGXYView - the ILcdGXYView this ILcdGXYController interacted with.
      See Also:
    • viewRepaint

      public void viewRepaint(ILcdGXYView aGXYView)
      Deprecated.
      Empty implementation.
      Specified by:
      viewRepaint in interface ILcdGXYController
      Parameters:
      aGXYView - the ILcdGXYView to draw on.
    • paint

      public void paint(Graphics aGraphics)
      Enables the controller to give visual feedback on the current user interactions. Note that the controller is responsible for repainting the view.

      Empty implementation. Redefine this method to render on the Graphics on which the view is rendered.

      Specified by:
      paint in interface ILcdGXYController
      Parameters:
      aGraphics - the Graphics on which the view was rendered.
    • getGXYView

      public ILcdGXYView getGXYView()
      Returns the ILcdGXYView the controller is interacting with.
      Returns:
      the ILcdGXYView the controller is interacting with, or null if the view is not interacting with a view
    • setGXYView

      protected void setGXYView(ILcdGXYView aGXYView)
      Sets the ILcdGXYView the controller is interacting with.

      This method is called when ILcdGXYView.setGXYController is used to set an ILcdGXYController active on an ILcdGXYView.

      Parameters:
      aGXYView - the view the controller is interacting with
      See Also:
    • retrieveGXYViewXYWorldTransformation

      protected ILcdGXYViewXYWorldTransformation retrieveGXYViewXYWorldTransformation()
      Convenience method to retrieve the ILcdGXYViewXYWorldTransformation for the ILcdGXYView this controller interacts with. The default implementation returns the view's own transformation.
      Returns:
      a ILcdGXYViewXYWorldTransformation for the ILcdGXYView this controller interacts with.
    • getCursor

      public Cursor getCursor()
      Description copied from interface: ILcdGXYController
      Returns the cursor that will be displayed on a view when this controller is active for that view.
      Specified by:
      getCursor in interface ILcdGXYController
      Returns:
      the Cursor set by setCursor, or Cursor.getDefaultCursor() if no Cursor has been set yet.
    • setCursor

      public void setCursor(Cursor aCursor)
      Parameters:
      aCursor - the Cursor to use when a user interacts with this ILcdGXYController on a ILcdGXYView.
    • setName

      public void setName(String aName)
      Parameters:
      aName - the name to associate to this ILcdGXYController
    • getName

      public String getName()
      Description copied from interface: ILcdGXYController
      Returns a name for this controller that enables to determine the interaction that can be performed with this controller. For example 'zoom' for a zoom controller.
      Specified by:
      getName in interface ILcdGXYController
      Returns:
      the name associated to this ILcdGXYController
    • setShortDescription

      public void setShortDescription(String aShortDescription)
      Parameters:
      aShortDescription - the short description to associate to this ILcdGXYController
    • getShortDescription

      public String getShortDescription()
      Description copied from interface: ILcdGXYController
      Returns a short description that enables to determine the interaction that can be performed with this controller. For example 'Zoom in and out on a view' for a zoom controller.
      Specified by:
      getShortDescription in interface ILcdGXYController
      Returns:
      the short description associated to this ILcdGXYController
    • setIcon

      public void setIcon(ILcdIcon aIcon)
      Parameters:
      aIcon - the ILcdIcon to associate to this ILcdGXYController
    • getIcon

      public ILcdIcon getIcon()
      Description copied from interface: ILcdGXYController
      Returns an icon to visualize the interaction implemented. For example, an icon of a magnifying glass for a zoom controller.
      Specified by:
      getIcon in interface ILcdGXYController
      Returns:
      the ILcdIcon associated to this ILcdGXYController
    • registerInstance

      protected void registerInstance()
      Deprecated.
      This method is not used.