Class TLspPathLabelLocation

java.lang.Object
com.luciad.view.lightspeed.label.location.ALspLabelLocation
com.luciad.view.lightspeed.painter.label.location.TLspPathLabelLocation
All Implemented Interfaces:
ILcdCloneable, Cloneable

public class TLspPathLabelLocation extends ALspLabelLocation

This label location contains two fields used to identify the position of a label on a path.

TLspCurvedPathLabelingAlgorithm uses this label location extension in order to place curved text labels on a path. TLspLabelPainter can paint labels with path label locations.

The path index is used to identify the 'sub-path' of a path. The path parameter is used to identify a location on that sub-path. The parameter lies in the interval [0, 1], or is -1 if it is invalid. The path parameter should be used for paths in world coordinates.

Since:
2012.0
  • Constructor Details

    • TLspPathLabelLocation

      public TLspPathLabelLocation()
      Creates a new path label location with the default parameters.
    • TLspPathLabelLocation

      public TLspPathLabelLocation(int aPathIndex, double aPathParameter)
      Creates a new path location with the given path index and path parameter.
      Parameters:
      aPathIndex - a path index.
      aPathParameter - a path parameter.
  • Method Details

    • getPathIndex

      public int getPathIndex()
      Returns the index used to identify the sub-path of a path.
      Returns:
      the index used to identify the sub-path of a path.
      See Also:
    • setPathIndex

      public void setPathIndex(int aPathIndex)
      Sets the index used to identify the sub-path of a path. This index determines the subpath on which this label will be placed.
      Parameters:
      aPathIndex - the index used to identify the sub-path of a path.
      See Also:
    • getPathParameter

      public double getPathParameter()
      Returns the parameter used to identify a location on a sub-path of a world path.
      Returns:
      the parameter used to identify a location on a sub-path of a world path.
      See Also:
    • setPathParameter

      public void setPathParameter(double aPathParameter)
      Set the parameter used to identify a location on a sub-path of a world path.

      The parameter should lie in the interval [0, 1]. If it lies outside the interval [0, 1], this label location should be handled as a regular TLcdLabelLocation.

      Parameters:
      aPathParameter - the parameter used to identify a location on a sub-path of a world path.
      See Also:
    • copyFrom

      public void copyFrom(ALspLabelLocation aLabelLocation)
      Description copied from class: ALspLabelLocation

      Copies the location settings from the given label location.

      When creating an extension of this class, also overwrite this method to make sure your extra properties are copied.

      Overrides:
      copyFrom in class ALspLabelLocation
      Parameters:
      aLabelLocation - the label location to copy properties from.
    • clone

      public TLspPathLabelLocation clone()
      Description copied from interface: ILcdCloneable

      Makes Object.clone() public.

      When for example extending from java.lang.Object, it can be implemented like this:
      
       public Object clone() {
         try {
           return super.clone();
         } catch ( CloneNotSupportedException e ) {
           // Cannot happen: extends from Object and implements Cloneable (see also Object.clone)
           throw new RuntimeException( e );
         }
       }
       
      Specified by:
      clone in interface ILcdCloneable
      Overrides:
      clone in class ALspLabelLocation
      See Also:
    • toString

      public String toString()
      Overrides:
      toString in class ALspLabelLocation
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class ALspLabelLocation
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class ALspLabelLocation