Class TLspRulerLabelStyler
- All Implemented Interfaces:
ILspCustomizableStyler
,ILspStyler
TLspRulerController
. When the domain object to style
is an ALspRulerMeasurement
, this styler will style a segment label for each line segment
and a total distance label at the end of the entire polyline.
This class uses six customizable styles to style these labels:
- Three styles with identifier SEGMENT used for the individual
segment labels, a
TLspTextStyle
, aTLspLabelBoxStyle
and aTLspRulerSegmentLabelContentStyle
. - Three styles with identifier TOTAL used for the total distance
label, a
TLspTextStyle
, aTLspLabelBoxStyle
and aTLspRulerDistanceFormatStyle
.
getStyles()
, and replace the style you want to change
by another style. At least a TLspTextStyle
and a
ALspLabelTextProviderStyle
must be present and active for (useful) labels to appear.
- Since:
- 2012.0
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
A constant accepted bysetStyles(String, com.luciad.view.lightspeed.style.ALspStyle...)
to indicate that the provided styles should be used to style the individual segment labels.static final String
A constant accepted bysetStyles(String, com.luciad.view.lightspeed.style.ALspStyle...)
to indicate that the provided styles should be used to style the label totalling the distance. -
Constructor Summary
ConstructorDescriptionCreates a new TLspRulerLabelStyler with a default blue and white style for both segment and total labels. -
Method Summary
Modifier and TypeMethodDescriptionReturns the styler's customizable styles.void
style
(Collection<?> aObjects, ALspLabelStyleCollector aStyleCollector, TLspContext aContext) Convenience method that takes anALspLabelStyleCollector
as argument instead of anALspStyleCollector
.void
style
(Collection<?> aObjects, ALspStyleCollector aStyleCollector, TLspContext aContext) Implementation ofILspStyler.style
that either casts theALspStyleCollector
toALspLabelStyleCollector
if possible, or adapts it otherwise.Methods inherited from class com.luciad.view.lightspeed.style.styler.ALspStyler
addStyleChangeListener, fireStyleChangeEvent, fireStyleChangeEvent, removeStyleChangeListener
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.view.lightspeed.style.styler.ILspStyler
addStyleChangeListener, removeStyleChangeListener
-
Field Details
-
SEGMENT
A constant accepted bysetStyles(String, com.luciad.view.lightspeed.style.ALspStyle...)
to indicate that the provided styles should be used to style the individual segment labels.- See Also:
-
TOTAL
A constant accepted bysetStyles(String, com.luciad.view.lightspeed.style.ALspStyle...)
to indicate that the provided styles should be used to style the label totalling the distance.- See Also:
-
-
Constructor Details
-
TLspRulerLabelStyler
public TLspRulerLabelStyler()Creates a new TLspRulerLabelStyler with a default blue and white style for both segment and total labels. Both labels only contain the the distance formatted in meters.
-
-
Method Details
-
style
Description copied from class:ALspLabelStyler
Implementation of
ILspStyler.style
that either casts theALspStyleCollector
toALspLabelStyleCollector
if possible, or adapts it otherwise. In the latter case, the labeling-specific calls (label
,anchorLabel
,algorithm
, ...) are ignored. TheALspLabelStyleCollector
is then passed to thestyle(Collection,ALspLabelStyleCollector,TLspContext)
method.- Specified by:
style
in interfaceILspStyler
- Overrides:
style
in classALspLabelStyler
- Parameters:
aObjects
- The objects to be styled.aStyleCollector
- A style collector to which all styling information should be passed, this collector is only valid within this method call, and can no longer be used afterwards.aContext
- Provides context information that may affect styling, such as view specific properties.
-
style
public void style(Collection<?> aObjects, ALspLabelStyleCollector aStyleCollector, TLspContext aContext) Description copied from class:ALspLabelStyler
Convenience method that takes an
ALspLabelStyleCollector
as argument instead of anALspStyleCollector
. This method is called fromALspLabelStyler.style(Collection, ALspStyleCollector, TLspContext)
.- Specified by:
style
in classALspLabelStyler
- Parameters:
aObjects
- The set of domain objects to provide information foraStyleCollector
- The label style collector to submit the information to.aContext
- The context- See Also:
-
getStyles
Description copied from interface:ILspCustomizableStyler
Returns the styler's customizable styles. When modifications are made to the styles, the styler will automatically inform its listeners about the change. The following changes can be made:
- Styles can be enabled or disabled. Only the enabled styles will be set in the style method.
- The
ALspStyle
in theTLspCustomizableStyle
may be replaced
identifier
of theTLspCustomizableStyle
to recognize and order the styles.- Specified by:
getStyles
in interfaceILspCustomizableStyler
- Returns:
- An immutable collection containing all styles which will be set in the
style
method
-