Class TLspFXScaleIndicator

java.lang.Object
com.luciad.view.swing.ALcdScaleIndicator
com.luciad.view.lightspeed.javafx.TLspFXScaleIndicator
All Implemented Interfaces:
ILcdIcon, ILcdChangeSource, ILcdCloneable, Serializable, Cloneable

public class TLspFXScaleIndicator extends ALcdScaleIndicator implements ILcdChangeSource

A JavaFX ALcdScaleIndicator implementation for ILspView.

The BAR representation of the scale indicator
The BAR representation of the scale indicator.

The FRACTION representation of the scale indicator
The FRACTION representation of the scale indicator.

By default the indicator will only change if you zoom, not if you pan. Call ALcdScaleIndicator.setScaleAtCenterOfMap(boolean) to change this behavior.

The following snippet shows how to create a scale indicator:
    //Create a scale indicator for the view
    TLspFXScaleIndicator scaleIndicator = new TLspFXScaleIndicator(view);
    //Optionally, change some settings on the scale indicator.
    //Check the javadoc for all available customization options
    scaleIndicator.setBarColor(Color.DARK_GRAY);
    scaleIndicator.setAlternateBarColor(Color.LIGHT_GRAY);
which is then added, together with the TLspFXView, to the south-east corner of an AnchorPane.
    //Add the view and the scale indicator to the same pane
    //This ensures that the scale label is placed on top of the map
    AnchorPane pane = new AnchorPane(view.getHostNode(), scaleIndicator.getNode());
    AnchorPane.setTopAnchor(view.getHostNode(), 0.0);
    AnchorPane.setBottomAnchor(view.getHostNode(), 0.0);
    AnchorPane.setLeftAnchor(view.getHostNode(), 0.0);
    AnchorPane.setRightAnchor(view.getHostNode(), 0.0);
    AnchorPane.setRightAnchor(scaleIndicator.getNode(), 10.0);
    AnchorPane.setBottomAnchor(scaleIndicator.getNode(), 10.0);
    //The AnchorPane now can be shown on a javafx.scene.Scene instance
Since:
2019.0
See Also: