Class TLspDataObjectLabelTextProviderStyle
- All Implemented Interfaces:
ILcdCloneable
,ILspStyler
,Cloneable
ALspLabelTextProviderStyle
that retrieves the label
content through the ILcdDataObject
interface. When the domain object
of the given label does not implement ILcdDataObject
,
object.toString()
is used instead.
When the object of the label implements the ILcdDataObject
interface, it computes the value of the expression specified in the constructor.
Expressions are converted into strings using this object's data object expression language. The default data object language expression of this label
painter is TLcdDataObjectExpressionLanguage
.
In many cases, the default data object language is sufficient. For example, the following code specifies
two properties that should be used for a label:
TLspDataObjectLabelTextProviderStyle.newBuilder().expressions( "name", "population" ).build();
- Since:
- 2012.0
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
TLspDataObjectLabelTextProviderStyle.Builder<B extends TLspDataObjectLabelTextProviderStyle.Builder<B>>
Builder for data object text provider using expressions. -
Constructor Summary
ModifierConstructorDescriptionprotected
Creates a newTLspDataObjectLabelTextProviderStyle
based on the provided builder. -
Method Summary
Modifier and TypeMethodDescriptionCreates a new builder initialized with all the properties of this style.boolean
Returns the data object expression language used by this label painter.String[]
Returns the expressions that are evaluated to compute the label of the object.String[]
getText
(Object aDomainObject, Object aSubLabelID, TLspContext aContext) Returns text (one or more strings) for the given domain object and sublabel ID.int
hashCode()
Creates a new builder with the default values.Methods inherited from class com.luciad.view.lightspeed.painter.label.style.ALspLabelTextProviderStyle
clone, isTransparent
Methods inherited from class com.luciad.view.lightspeed.style.ALspStyle
addStyleChangeListener, getZOrder, isCompatible, removeStyleChangeListener, style
-
Constructor Details
-
TLspDataObjectLabelTextProviderStyle
protected TLspDataObjectLabelTextProviderStyle(TLspDataObjectLabelTextProviderStyle.Builder aBuilder) Creates a newTLspDataObjectLabelTextProviderStyle
based on the provided builder.- Parameters:
aBuilder
- a builder which provides the necessary data for constructing aTLspDataObjectLabelTextProviderStyle
-
-
Method Details
-
newBuilder
Creates a new builder with the default values.- Returns:
- the new builder.
-
asBuilder
Creates a new builder initialized with all the properties of this style.- Overrides:
asBuilder
in classALspLabelTextProviderStyle
- Returns:
- the new builder.
-
getExpressions
Returns the expressions that are evaluated to compute the label of the object. The returned expressions can be an empty array, but nevernull
.- Returns:
- the expressions
-
getDataObjectExpressionLanguage
Returns the data object expression language used by this label painter.- Returns:
- the data object expression language used by this label painter
-
getText
Description copied from class: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.- Overrides:
getText
in classALspLabelTextProviderStyle
- Parameters:
aDomainObject
- a domain object.aSubLabelID
- a sublabel ID.aContext
- the context.- Returns:
- text for the given identifier.
-
equals
-
hashCode
public int hashCode()
-