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.
Constructor and Description |
---|
TLspPathLabelLocation()
Creates a new path label location with the default parameters.
|
TLspPathLabelLocation(int aPathIndex,
double aPathParameter)
Creates a new path location with the given path index and path parameter.
|
Modifier and Type | Method and Description |
---|---|
TLspPathLabelLocation |
clone()
Makes
Object.clone() public. |
void |
copyFrom(ALspLabelLocation aLabelLocation)
Copies the location settings from the given label location.
|
boolean |
equals(Object o) |
int |
getPathIndex()
Returns the index used to identify the sub-path of a path.
|
double |
getPathParameter()
Returns the parameter used to identify a location on a sub-path of a world path.
|
int |
hashCode() |
void |
setPathIndex(int aPathIndex)
Sets the index used to identify the sub-path of a path.
|
void |
setPathParameter(double aPathParameter)
Set the parameter used to identify a location on a sub-path of a world path.
|
String |
toString() |
isEditedByEditor, isEditedByPlacer, isSticky, setEditedByEditor, setEditedByPlacer, setSticky
public TLspPathLabelLocation()
public TLspPathLabelLocation(int aPathIndex, double aPathParameter)
aPathIndex
- a path index.aPathParameter
- a path parameter.public int getPathIndex()
setPathIndex(int)
public void setPathIndex(int aPathIndex)
aPathIndex
- the index used to identify the sub-path of a path.getPathIndex()
public double getPathParameter()
setPathParameter(double)
public void setPathParameter(double aPathParameter)
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
.
aPathParameter
- the parameter used to identify a location on a sub-path of
a world path.getPathParameter()
public void copyFrom(ALspLabelLocation aLabelLocation)
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.
copyFrom
in class ALspLabelLocation
aLabelLocation
- the label location to copy properties from.public TLspPathLabelLocation clone()
ILcdCloneable
Makes Object.clone()
public.
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 );
}
}
clone
in interface ILcdCloneable
clone
in class ALspLabelLocation
Object.clone()
public String toString()
toString
in class ALspLabelLocation
public boolean equals(Object o)
equals
in class ALspLabelLocation
public int hashCode()
hashCode
in class ALspLabelLocation