public class TLspRulerLabelStyler extends ALspLabelStyler implements ILspCustomizableStyler
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:
TLspTextStyle
, a TLspLabelBoxStyle
and a
TLspRulerSegmentLabelContentStyle
.TLspTextStyle
, a TLspLabelBoxStyle
and a
TLspRulerDistanceFormatStyle
.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.
TLspRulerController.setLabelStyler(com.luciad.view.lightspeed.style.styler.ILspStyler)
Modifier and Type | Field and Description |
---|---|
static String |
SEGMENT
A constant accepted by
setStyles(String, com.luciad.view.lightspeed.style.ALspStyle...)
to indicate that the provided styles should be used to style the individual segment labels. |
static String |
TOTAL
A constant accepted by
setStyles(String, com.luciad.view.lightspeed.style.ALspStyle...)
to indicate that the provided styles should be used to style the label totalling the distance. |
Constructor and Description |
---|
TLspRulerLabelStyler()
Creates a new TLspRulerLabelStyler with a default blue and white style for both segment and
total labels.
|
Modifier and Type | Method and Description |
---|---|
Collection<TLspCustomizableStyle> |
getStyles()
Returns the styler's customizable styles.
|
void |
style(Collection<?> aObjects,
ALspLabelStyleCollector aStyleCollector,
TLspContext aContext)
Convenience method that takes an
ALspLabelStyleCollector as argument instead of
an ALspStyleCollector . |
void |
style(Collection<?> aObjects,
ALspStyleCollector aStyleCollector,
TLspContext aContext)
Implementation of
ILspStyler.style that either casts the ALspStyleCollector
to ALspLabelStyleCollector if possible, or adapts it otherwise. |
addStyleChangeListener, fireStyleChangeEvent, fireStyleChangeEvent, removeStyleChangeListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addStyleChangeListener, removeStyleChangeListener
public static final String SEGMENT
setStyles(String, com.luciad.view.lightspeed.style.ALspStyle...)
to indicate that the provided styles should be used to style the individual segment labels.public static final String TOTAL
setStyles(String, com.luciad.view.lightspeed.style.ALspStyle...)
to indicate that the provided styles should be used to style the label totalling the distance.public TLspRulerLabelStyler()
public void style(Collection<?> aObjects, ALspStyleCollector aStyleCollector, TLspContext aContext)
ALspLabelStyler
Implementation of ILspStyler.style
that either casts the ALspStyleCollector
to ALspLabelStyleCollector
if possible, or adapts it otherwise. In the latter case, the labeling-specific
calls (label
, anchorLabel
,
algorithm
, ...) are ignored. The ALspLabelStyleCollector
is then
passed to the style(Collection,ALspLabelStyleCollector,TLspContext)
method.
style
in interface ILspStyler
style
in class ALspLabelStyler
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.public void style(Collection<?> aObjects, ALspLabelStyleCollector aStyleCollector, TLspContext aContext)
ALspLabelStyler
Convenience method that takes an ALspLabelStyleCollector
as argument instead of
an ALspStyleCollector
. This method is called from
ALspLabelStyler.style(Collection, ALspStyleCollector, TLspContext)
.
style
in class ALspLabelStyler
aObjects
- The set of domain objects to provide information foraStyleCollector
- The label style collector to submit the information to.aContext
- The contextALspLabelStyleCollector
,
ILspStyler
public Collection<TLspCustomizableStyle> getStyles()
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:
ALspStyle
in the TLspCustomizableStyle
may be replacedidentifier
of the
TLspCustomizableStyle
to recognize and order the styles.getStyles
in interface ILspCustomizableStyler
style
method