Class OnPathLabelStyle

java.lang.Object
com.luciad.layers.styles.OnPathLabelStyle
All Implemented Interfaces:
AutoCloseable

public final class OnPathLabelStyle extends Object implements AutoCloseable
This class contains styling properties to determine how a label is placed on a path.

It can be used as parameter to the FeatureCanvas.LabelDrawCommand#onPath method.

This label style defines the location of a label with respect to its anchor point located somewhere along the curve. Labels can have an offset in both a horizontal and a vertical axis. These axes are defined as the tangent and the normal to the curve respectively, at the point on the curve where the label is anchored.

OnPathLabelStyle horizontal and vertical axis
OnPathLabelStyle horizontal and vertical axis
  • Method Details

    • finalize

      protected void finalize()
      Overrides:
      finalize in class Object
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • newBuilder

      @NotNull public static OnPathLabelStyle.Builder newBuilder()
      Returns a new builder for creating a OnPathLabelStyle.
      Returns:
      a new builder for creating a OnPathLabelStyle.
    • getRelativeLocation

      @Nullable public Double getRelativeLocation()
      Returns the relative location on the curve.

      This value is in the interval [0,1]. A value of 0 represents the start of the curve and a value of 1 represents the end of the curve.

      If this value is null, then the label can be placed anywhere along the path.

      Returns:
      the relative location on the curve.
    • getVerticalOffset

      public double getVerticalOffset()
      Returns the vertical offset in device independent pixels.
      Returns:
      the vertical offset in device independent pixels.
    • getHorizontalOffset

      public double getHorizontalOffset()
      Returns the horizontal offset in device independent pixels.
      Returns:
      the horizontal offset in device independent pixels.
    • getVerticalPosition

      @NotNull public PathLabelPosition getVerticalPosition()
      Returns the vertical position of the label relative to the curve.
      Returns:
      the vertical position of the label relative to the curve.
    • getHorizontalAlignment

      @NotNull public HorizontalAlignment getHorizontalAlignment()
      Returns the horizontal alignment of the label relative to the curve.
      Returns:
      the horizontal alignment of the label relative to the curve.
    • asBuilder

      @NotNull public OnPathLabelStyle.Builder asBuilder()
      Returns a new builder that has all properties of this instance.
      Returns:
      a new builder that has all properties of this instance.