Class ALspLabelTextProviderStyle
- All Implemented Interfaces:
ILcdCloneable
,ILspStyler
,Cloneable
- Direct Known Subclasses:
TLspDataObjectLabelTextProviderStyle
,TLspRulerDistanceFormatStyle
This style provides a method to retrieve the text to use for a label. Styles extending from
this class should implement the getText
method.
Note that if the text to be painted starts with <html>
,
TLspLabelPainter
uses HTML to
format and paint the text.
- Since:
- 2012.0
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Builder for text provider styles. -
Constructor Summary
ModifierConstructorDescriptionprotected
Creates a new ALspLabelTextProviderStyle. -
Method Summary
Modifier and TypeMethodDescriptionCreates a new builder initialized with all the properties of this style.clone()
MakesObject.clone()
public.String[]
getText
(Object aDomainObject, Object aSubLabelID, TLspContext aContext) Returns text (one or more strings) for the given domain object and sublabel ID.boolean
Determines whether this style is transparent.Methods inherited from class com.luciad.view.lightspeed.style.ALspStyle
addStyleChangeListener, equals, getZOrder, hashCode, isCompatible, removeStyleChangeListener, style
-
Constructor Details
-
ALspLabelTextProviderStyle
protected ALspLabelTextProviderStyle()Creates a new ALspLabelTextProviderStyle.
-
-
Method Details
-
isTransparent
public boolean isTransparent()Description copied from class:ALspStyle
Determines whether this style is transparent. Shapes that are transparent can be painted in a different paint phase than shapes that are not transparent.- Specified by:
isTransparent
in classALspStyle
- Returns:
- whether or not this style is transparent
-
getText
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.- Parameters:
aDomainObject
- a domain object.aSubLabelID
- a sublabel ID.aContext
- the context.- Returns:
- text for the given identifier.
-
clone
Description copied from interface:ILcdCloneable
Makes
When for example extending fromObject.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 ); } }
- Specified by:
clone
in interfaceILcdCloneable
- Overrides:
clone
in classObject
- See Also:
-
asBuilder
Creates a new builder initialized with all the properties of this style.
-