public class TLspRulerSegmentLabelContentStyle extends TLspRulerDistanceFormatStyle
TLspRulerDistanceFormatStyle
that adds support for displaying the
azimuth of a segment (if available). The segment is identified by an Integer
passed
as aSubLabelId
along side an domain object that is an instance of
ALspRulerMeasurement
.Modifier and Type | Class and Description |
---|---|
static class |
TLspRulerSegmentLabelContentStyle.Builder<B extends TLspRulerSegmentLabelContentStyle.Builder<B>>
Builder for the ruler segment label content style.
|
Modifier | Constructor and Description |
---|---|
protected |
TLspRulerSegmentLabelContentStyle(TLspRulerSegmentLabelContentStyle.Builder aBuilder) |
Modifier and Type | Method and Description |
---|---|
TLspRulerSegmentLabelContentStyle.Builder<?> |
asBuilder()
Creates a new builder initialized with all the properties of this style.
|
boolean |
equals(Object o) |
Format |
getAzimuthFormat()
Returns the used azimuth format.
|
String[] |
getText(Object aDomainObject,
Object aSubLabelID,
TLspContext aContext)
Returns text (one or more strings) for the given domain object and sublabel ID.
|
int |
hashCode() |
boolean |
isDisplayAzimuth()
Returns whether or not the azimuth is displayed in the segment labels.
|
static TLspRulerSegmentLabelContentStyle.Builder<?> |
newBuilder()
Creates a new builder with the default values:
Distance format:
TLcdDistanceFormat with user unit metre.
Azimuth format: a DecimalFormat with pattern "0.0°" .
Display azimuth: false.
|
getDistanceFormat
clone, isTransparent
addStyleChangeListener, getZOrder, isCompatible, removeStyleChangeListener, style
protected TLspRulerSegmentLabelContentStyle(TLspRulerSegmentLabelContentStyle.Builder aBuilder)
public static TLspRulerSegmentLabelContentStyle.Builder<?> newBuilder()
TLcdDistanceFormat
with user unit metre.DecimalFormat
with pattern "0.0°"
.public TLspRulerSegmentLabelContentStyle.Builder<?> asBuilder()
asBuilder
in class TLspRulerDistanceFormatStyle
public Format getAzimuthFormat()
public boolean isDisplayAzimuth()
public String[] getText(Object aDomainObject, Object aSubLabelID, TLspContext aContext)
ALspLabelTextProviderStyle
Returns text (one or more strings) for the given domain object and sublabel ID. When no label should be painted,
this method should return null
or an empty array.
By default, this method returns an array containing only the result of the toString() method of the given domain object.
When overriding this method, the implementation should make sure that the returned text is consistent for
the given label. I.e. it should not return a different String
every time it is called for a given label.
Not doing so may lead to worse performance and incorrectly visualized labels.
getText
in class TLspRulerDistanceFormatStyle
aDomainObject
- a domain object.aSubLabelID
- a sublabel ID.aContext
- the context.public boolean equals(Object o)
equals
in class TLspRulerDistanceFormatStyle
public int hashCode()
hashCode
in class TLspRulerDistanceFormatStyle