Class OnPathLabelStyle.Builder

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

public static final class OnPathLabelStyle.Builder extends Object implements AutoCloseable
A builder class for creating an OnPathLabelStyle.
  • Constructor Details

  • Method Details

    • finalize

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

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

      @NotNull public OnPathLabelStyle build()
      Returns A newly created style, based on the properties set on this builder.
      Returns:
      A newly created style, based on the properties set on this builder.
    • verticalPosition

      @NotNull public OnPathLabelStyle.Builder verticalPosition(@NotNull PathLabelPosition verticalPosition)
      Sets the alignment of the label perpendicular to the line.

      For example, if this value is PathLabelPosition#Above, the label is displayed above the curve.

      By default the vertical position is PathLabelPosition#Center.

      Parameters:
      verticalPosition - the alignment of the label perpendicular to the line.
      Returns:
      this builder.
    • relativeLocation

      @NotNull public OnPathLabelStyle.Builder relativeLocation(double relativeLocation)
      Sets the relative location of the label along the path.

      This value should 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. By default the relative location is 0.5 and the label is placed at the middle of the curve.

      This method is optional. If this method is not called, the label can be placed anywhere along the path.

      Parameters:
      relativeLocation - the relative location of the label along the path. This value should in the interval [0,1].
      Returns:
      this builder.
    • verticalOffset

      @NotNull public OnPathLabelStyle.Builder verticalOffset(double verticalOffset)
      Moves the label some distance along a straight line orthogonal to the curve that the label is placed on, expressed in device independent pixels.

      This offset is applied in the direction determined by Builder#verticalPosition.

      By default the vertical offset is 0.

      Parameters:
      verticalOffset - the distance to move the label orthogonally to the curve, in device independent pixels.
      Returns:
      this builder.
    • horizontalOffset

      @NotNull public OnPathLabelStyle.Builder horizontalOffset(double horizontalOffset)
      Moves the label some distance along a straight line tangential to the curve that the label is placed on, expressed in device independent pixels.

      This offset is applied in the direction determined by Builder#horizontalAlignment.

      By default the horizontal offset is 0.

      This method only has an effect when Builder#relativeLocation is also called.

      Parameters:
      horizontalOffset - the distance to move the label along the tangent, in device independent pixels.
      Returns:
      this builder.
    • horizontalAlignment

      @NotNull public OnPathLabelStyle.Builder horizontalAlignment(@NotNull HorizontalAlignment horizontalAlignment)
      Sets The horizontal anchor of the label with respect to the location on the line.

      By default the horizontal alignment is HorizontalAlignment#Center.

      This method only has an effect when Builder#relativeLocation is also called.

      Parameters:
      horizontalAlignment - The horizontal anchor of the label with respect to the location on the line.
      Returns:
      this builder.