Interface ILcdGXYController

All Superinterfaces:
Serializable
All Known Subinterfaces:
ILcdGXYChainableController
All Known Implementing Classes:
ALcdGXYChainableController, ALcdGXYConfinedTouchChainableController, ALcdGXYController, ALcdGXYSmartController, ALcdGXYTouchChainableController, TLcdAdvancedMapRulerController, TLcdAzimuthRangeController, TLcdGRIBGXYController, TLcdGXYCenterRasterController, TLcdGXYCompositeController, TLcdGXYContinuousPanController, TLcdGXYDragRectangleController, TLcdGXYEditController, TLcdGXYEditController2, TLcdGXYInteractiveLabelsController, TLcdGXYMagnifierController, TLcdGXYNavigateController, TLcdGXYNewController, TLcdGXYNewController2, TLcdGXYNoopController, TLcdGXYOverviewController, TLcdGXYPanController, TLcdGXYRotateController, TLcdGXYSelectController, TLcdGXYSelectController2, TLcdGXYTouchNavigateController, TLcdGXYTouchNewController, TLcdGXYTouchSelectEditController, TLcdGXYZoomController, TLcdGXYZoomWheelController, TLcdMagneticNorthGXYController, TLcdMapGridRulerController, TLcdMapRulerController, TLcdMapTouchRulerController, TLcdTerrainProfileController, TLcdTerrainRulerController

public interface ILcdGXYController extends Serializable
Interprets user interaction on an ILcdGXYView.

When a controller is assigned to a view (using ILcdGXYView.setGXYController), startInteraction is called. From then on the controller is responsible for interpreting the user interaction on the view, until terminateInteraction is called for that view. The user interaction can originate from a key stroke, the mouse, or any other input device. The controller implementation can therefore be a MouseListener, MouseMotionListener, KeyListener, ... implementation.

Interpreting the user interaction may consist of changing the internal state of the view or any of its constituents. For example, a zoom controller may change the views scale, while a select controller may change the selection state of an object in a layer which is part of the view. Note that consumption of user interaction is not part of this interface, but is part of other interfaces the controller may implement, such as MouseListener, MouseMotionListener, ... .

The controller may indicate how user interaction is interpreted by rendering visual feedback on the view using the paint method. Note that the controller is responsible for repainting the view as needed.

To distinguish between controllers, each controller has a name, a short description and an ILcdIcon.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the cursor that will be displayed on a view when this controller is active for that view.
    Returns an icon to visualize the interaction implemented.
    default ILcdLayered
    Returns the layers associated with this controller.
    Returns a name for this controller that enables to determine the interaction that can be performed with this controller.
    Returns a short description that enables to determine the interaction that can be performed with this controller.
    void
    paint(Graphics aGraphics)
    Enables the controller to give visual feedback on the current user interactions.
    void
    Sets up the controller to receive input through the view passed.
    void
    Configures the controller to no longer receive input through the view passed.
    void
    Deprecated.
    Use the method paint(java.awt.Graphics).
  • Method Details

    • startInteraction

      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.

      Parameters:
      aGXYView - the ILcdGXYView this ILcdGXYController will interact with.
      See Also:
    • terminateInteraction

      void terminateInteraction(ILcdGXYView aGXYView)
      Configures the controller to no longer receive input through the view passed.

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

      Parameters:
      aGXYView - the ILcdGXYView this ILcdGXYController interacted with.
      See Also:
    • viewRepaint

      void viewRepaint(ILcdGXYView aGXYView)
      Deprecated.
      Use the method paint(java.awt.Graphics).
      This method shall be called by an ILcdGXYView after painting/drawing all its ILcdGXYLayers. It allows this ILcdGXYController to draw specific information on top of the ILcdGXYView it is set to.
      Parameters:
      aGXYView - the ILcdGXYView to draw on.
    • paint

      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.
      Parameters:
      aGraphics - the Graphics to paint on.
    • getLayered

      default ILcdLayered getLayered()
      Returns the layers associated with this controller. A view using this controller should visualize the layers of its active controller and take them into account for label placement.

      Custom implementations of this method should take care to return the same ILcdLayered instance every time this method is called to guarantee correct working of the ILcdLayered interface.

      Returns:
      an ILcdLayered object with GXY layers, or null if this controller has no layers.
      Since:
      2020.1
    • getCursor

      Cursor getCursor()
      Returns the cursor that will be displayed on a view when this controller is active for that view.
      Returns:
      the cursor that will be displayed on a view when this controller is active for that view.
    • getName

      String getName()
      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.
      Returns:
      a name for this controller
    • getShortDescription

      String getShortDescription()
      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.
      Returns:
      a short description for this ILcdGXYController.
    • getIcon

      ILcdIcon getIcon()
      Returns an icon to visualize the interaction implemented. For example, an icon of a magnifying glass for a zoom controller.
      Returns:
      an icon to visualize the interaction implemented.