Class TLspFXPanNavigationControl

java.lang.Object
javafx.scene.Node
javafx.scene.Parent
javafx.scene.layout.Region
javafx.scene.layout.Pane
com.luciad.view.lightspeed.javafx.navigationcontrols.TLspFXPanNavigationControl
All Implemented Interfaces:
Styleable, EventTarget

public class TLspFXPanNavigationControl extends Pane
A Node to pan a TLspFXView in any direction. The user can pan the map by clicking near the border of the navigation control, dragging further away will increase the panning speed.

Customizing the appearance

The appearance of this control is specified by a number of images. The active appearance is only used when the mouse hovers over the component.

The exact appearance is specified by the following images in png format:

  • pan_inactive.png: the main image, when the pan control is inactive.
  • pan.png: the main image, when the pan control is active.
  • pan_direction.png: the direction indicator when dragging or pressing the mouse over the panel.
All the images should be square and should have the same dimensions. The dimension of the images will also be the dimension of the control. Also keep in mind that 'pan_direction.png' will be rotated around the center of the images.

Example

The following snippet adds the pan control to the overlay panel of a view.
    //Create a pan control for the view
    TLspFXPanNavigationControl panControl = new TLspFXPanNavigationControl(view);

    //Get the overlay panel from the view and add the control to it
    view.getOverlayNodes().stream()
        .filter(TLcdOverlayPane.class::isInstance)
        .map(TLcdOverlayPane.class::cast)
        .findFirst()
        .ifPresent(aOverlayPane -> aOverlayPane.add(panControl, TLcdOverlayPane.Location.SOUTH_EAST));
Since:
2021.0
  • Field Details

    • PAN_COMPONENT_DIR

      public static final String PAN_COMPONENT_DIR
      Default name of the subfolder in the navigationcontrols image folder containing all pan panel images.
      See Also:
  • Constructor Details

    • TLspFXPanNavigationControl

      public TLspFXPanNavigationControl(TLspFXView aView) throws IOException
      A constructor for the pan component of the navigation controls for a TLspFXView. The constructor also loads the necessary images and will initialize all the subcomponents of the panel.

      Parameters:
      aView - the view to interact with.
      Throws:
      IOException - when one of the necessary images is missing.
    • TLspFXPanNavigationControl

      public TLspFXPanNavigationControl(String aImagePath, TLspFXView aView) throws IOException
      A constructor for the pan component of the navigation controls for a TLspFXView using the given image path and view. The constructor also loads the necessary images and will initialize all the subcomponents of the panel.

      The default image path is usually the path to the root folder of the navigation controls + PAN_COMPONENT_DIR. This constant can be used by factory methods to create a complete set of navigation controls with a single path to a root folder.

      Parameters:
      aImagePath - The (relative or absolute) path to the directory where the images are stored.
      aView - The view to interact with.
      Throws:
      IOException - when one of the necessary images is missing.