Class TLspLabelStyler
- All Implemented Interfaces:
ILspCustomizableStyler
,ILspStyler
A label styler that applies the same styling and label location information to all objects.
This styler implements ILspCustomizableStyler
. So all styles that
are added to this styler are wrapped with a TLspCustomizableStyle
,
and returned by the getStyles()
method. As an alternative, it is possible to
explicitly add customizable styles to this styler, see setCustomizableStyles
or Builder.customizableStyles
.
newBuilder()
allows you to easily create a new TLspLabelStyler
.
By default, this styler applies a TLspTextStyle
to all objects and no
specific labeling configuration.
Note that if you don't need any labeling-specific
settings, you can also use a regular ILspStyler
.
- Since:
- 2012.0
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Builder for static label styler. -
Method Summary
Modifier and TypeMethodDescriptionCreates a new builder initialized with all the properties of this styler.Returns the labeling algorithm to be used for the label(s).Returns the labeling algorithm provider to be used for the label(s).getGroup()
Returns the declutter group the label(s) should be in.Returns the fixed priority for the label(s).Returns the priority provider for the label(s).Returns the delegate styler.Returns the styler's customizable styles.static TLspLabelStyler.Builder
Creates a new builder with the default values: No styles Default declutter group (DEFAULT_DECLUTTER_GROUP
) Default labeling algorithm Default priorities, which isInteger.MAX_VALUE
, lowest priorityvoid
setAlgorithm
(ILspLabelingAlgorithm aAlgorithm) Specifies the labeling algorithm to be used for the label(s).void
setAlgorithmProvider
(ILspLabelingAlgorithmProvider aAlgorithmProvider) Specifies the labeling algorithm provider to be used for the label(s).void
setCustomizableStyles
(TLspCustomizableStyle... aStyles) Specifies a list of styles to be applied to all objects.void
Specifies the declutter group the label(s) should be in.void
setLocations
(int aShift, TLspLabelLocationProvider.Location... aLocations) Specifies a set of fixed locations to be used for the label(s).void
setLocations
(TLspLabelLocationProvider.Location... aLocations) Specifies a set of fixed locations to be used for the label(s).void
setPriority
(Integer aPriority) Specifies a fixed priority for the label(s).void
setPriorityProvider
(ILspLabelPriorityProvider aPriorityProvider) Specifies a priority provider for the label(s).void
setStyler
(ILspStyler aDelegateStyler) Sets a delegate styler.void
Specifies a list of styles to be applied to all objects.void
style
(Collection<?> aDomainObjects, ALspLabelStyleCollector aCollector, TLspContext aContext) Convenience method that takes anALspLabelStyleCollector
as argument instead of anALspStyleCollector
.Methods inherited from class com.luciad.view.lightspeed.style.styler.ALspLabelStyler
style
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, style
-
Method Details
-
newBuilder
Creates a new builder with the default values:- No styles
- Default declutter group (
DEFAULT_DECLUTTER_GROUP
) - Default labeling algorithm
- Default priorities, which is
Integer.MAX_VALUE
, lowest priority
- Returns:
- the new builder.
-
asBuilder
Creates a new builder initialized with all the properties of this styler.- Returns:
- the new builder.
-
style
public void style(Collection<?> aDomainObjects, ALspLabelStyleCollector aCollector, 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:
aDomainObjects
- The set of domain objects to provide information foraCollector
- The label style collector to submit the information to.aContext
- The context- See Also:
-
setLocations
Specifies a set of fixed locations to be used for the label(s).- Parameters:
aShift
- the amount of pixels the labels must be removed from the object anchor point.aLocations
- a list of possible locations to place the labels.
-
setLocations
Specifies a set of fixed locations to be used for the label(s).- Parameters:
aLocations
- a list of possible locations to place the labels.
-
setAlgorithm
Specifies the labeling algorithm to be used for the label(s).- Parameters:
aAlgorithm
- The algorithm to be used.
-
getAlgorithm
Returns the labeling algorithm to be used for the label(s).- Returns:
- the labeling algorithm to be used for the label(s).
-
setAlgorithmProvider
Specifies the labeling algorithm provider to be used for the label(s).- Parameters:
aAlgorithmProvider
- The algorithm provider to be used.
-
getAlgorithmProvider
Returns the labeling algorithm provider to be used for the label(s).- Returns:
- the labeling algorithm provider to be used for the label(s).
-
setStyler
Sets a delegate styler.This styler will be called for all objects.
- Parameters:
aDelegateStyler
- the delegate styler.
-
getStyler
Returns the delegate styler.- Returns:
- the delegate styler.
-
setStyles
Specifies a list of styles to be applied to all objects.Note that
getStyles()
returns these styles, wrapped with aTLspCustomizableStyle
.- Parameters:
aStyles
- The styles to apply.
-
setCustomizableStyles
Specifies a list of styles to be applied to all objects.- Parameters:
aStyles
- The styles to apply.
-
setGroup
Specifies the declutter group the label(s) should be in.By default,
DEFAULT_DECLUTTER_GROUP
is used.- Parameters:
aGroup
- The desired declutter group.- See Also:
-
getGroup
Returns the declutter group the label(s) should be in.- Returns:
- the declutter group the label(s) should be in.
- See Also:
-
setPriority
Specifies a fixed priority for the label(s).By default, labels have priority
Integer.MAX_VALUE
, low priority.- Parameters:
aPriority
- The desired priority, 0 being highest priority.
-
getPriority
Returns the fixed priority for the label(s).- Returns:
- the fixed priority for the label(s).
-
setPriorityProvider
Specifies a priority provider for the label(s).- Parameters:
aPriorityProvider
- The priority provider that can specify priorities.
-
getPriorityProvider
Returns the priority provider for the label(s).- Returns:
- the priority provider for the label(s).
-
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
-