Class TLspFXZoomNavigationControl

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

public class TLspFXZoomNavigationControl extends Pane
A Node to control the zoom level of a TLspFXView. The user can change the zoom level directly by clicking or dragging the slider or press the + and - buttons to increase and decrease the zoom level.

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 control.

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

  • zoom_slider_inactive.png: the main slider, when the control is inactive.
  • zoom_slider.png: the main slider, when the control is active.
  • zoom_indicator_inactive.png: The indicator that moves over the slider, when the control is inactive.
  • zoom_indicator.png: The indicator that moves over the slider, when the control is active.
  • zoom_plus_inactive.png: the plus button when the control is inactive.
  • zoom_min_inactive.png: the min button when the control is inactive.
  • zoom_plus.png: the plus button when the control is active.
  • zoom_min.png: the min button when the control is active.
  • zoom_plus_selected.png: the plus button when the mouse is hovering over the button.
  • zoom_min_selected.png: the min button when the mouse is hovering over the button.
To change the appearance of the control, you can replace these images with your own or you can specify the directory where your images are located with TLspFXZoomNavigationControl(TLspFXView, String).

Example

The following snippet adds the zoom control to the overlay panel of a view.
    //Create a zoom control for the view
    TLspFXZoomNavigationControl zoomControl = new TLspFXZoomNavigationControl(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(zoomControl, TLcdOverlayPane.Location.EAST));
Since:
2021.0
  • Field Details

    • ZOOM_COMPONENT_DIR

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

    • TLspFXZoomNavigationControl

      public TLspFXZoomNavigationControl(TLspFXView aView) throws IOException
      Constructor for the zoom component. The constructor also loads the necessary images and will initialize all the subcomponents of the component.

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

      public TLspFXZoomNavigationControl(TLspFXView aView, String aImagePath) throws IOException
      Constructor for the zoom component. The constructor also loads the necessary images and will initialize all the subcomponents of the component.

      The default image path is usually the path to the root folder of the navigation controls + ZOOM_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:
      aView - the view to interact with.
      aImagePath - The (relative or absolute) path to the directory where the images are stored. For relative paths, the classpath and the working directory are searched.
      Throws:
      IOException - when one of the necessary images is missing.