public class TLspRulerDistanceFormatStyle extends ALspLabelTextProviderStyle
ALspLabelTextProviderStyle
. The label content when the domain
object is an instance of ALspRulerMeasurement
is equal to the
total
length of the ruler measurement, formatted using a
a distance format
.Modifier and Type | Class and Description |
---|---|
static class |
TLspRulerDistanceFormatStyle.Builder<B extends TLspRulerDistanceFormatStyle.Builder<B>>
Builder for the ruler distance format style styles.
|
Constructor and Description |
---|
TLspRulerDistanceFormatStyle(TLspRulerDistanceFormatStyle.Builder aBuilder) |
Modifier and Type | Method and Description |
---|---|
TLspRulerDistanceFormatStyle.Builder<?> |
asBuilder()
Creates a new builder initialized with all the properties of this style.
|
boolean |
equals(Object o) |
Format |
getDistanceFormat()
Returns the used distance 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() |
static TLspRulerDistanceFormatStyle.Builder<?> |
newBuilder()
Creates a new builder with the default value:
Distance format:
TLcdDistanceFormat with user unit metre.
|
clone, isTransparent
addStyleChangeListener, getZOrder, isCompatible, removeStyleChangeListener, style
public TLspRulerDistanceFormatStyle(TLspRulerDistanceFormatStyle.Builder aBuilder)
public static TLspRulerDistanceFormatStyle.Builder<?> newBuilder()
TLcdDistanceFormat
with user unit metre.public TLspRulerDistanceFormatStyle.Builder<?> asBuilder()
asBuilder
in class ALspLabelTextProviderStyle
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 ALspLabelTextProviderStyle
aDomainObject
- a domain object.aSubLabelID
- a sublabel ID.aContext
- the context.public Format getDistanceFormat()