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, aTLspLabelBoxStyleand aTLspRulerSegmentLabelContentStyle. - Three styles with identifier TOTAL used for the total distance
label, a
TLspTextStyle, aTLspLabelBoxStyleand 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
FieldsModifier and TypeFieldDescriptionstatic final StringA 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 StringA 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
ConstructorsConstructorDescriptionCreates 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.voidstyle(Collection<?> aObjects, ALspLabelStyleCollector aStyleCollector, TLspContext aContext) Convenience method that takes anALspLabelStyleCollectoras argument instead of anALspStyleCollector.voidstyle(Collection<?> aObjects, ALspStyleCollector aStyleCollector, TLspContext aContext) Implementation ofILspStyler.stylethat either casts theALspStyleCollectortoALspLabelStyleCollectorif possible, or adapts it otherwise.Methods inherited from class com.luciad.view.lightspeed.style.styler.ALspStyler
addStyleChangeListener, fireStyleChangeEvent, fireStyleChangeEvent, removeStyleChangeListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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 distance formatted in meters.
-
-
Method Details
-
style
Description copied from class:ALspLabelStylerImplementation of
ILspStyler.stylethat either casts theALspStyleCollectortoALspLabelStyleCollectorif possible, or adapts it otherwise. In the latter case, the labeling-specific calls (label,anchorLabel,algorithm, ...) are ignored. TheALspLabelStyleCollectoris then passed to thestyle(Collection,ALspLabelStyleCollector,TLspContext)method.- Specified by:
stylein interfaceILspStyler- Overrides:
stylein 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:ALspLabelStylerConvenience method that takes an
ALspLabelStyleCollectoras argument instead of anALspStyleCollector. This method is called fromALspLabelStyler.style(Collection, ALspStyleCollector, TLspContext).- Specified by:
stylein 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:ILspCustomizableStylerReturns 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
ALspStylein theTLspCustomizableStylemay be replaced
identifierof theTLspCustomizableStyleto recognize and order the styles.- Specified by:
getStylesin interfaceILspCustomizableStyler- Returns:
- An immutable collection containing all styles which will be set in the
stylemethod
-