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
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder 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.BuilderCreates 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 priorityvoidsetAlgorithm(ILspLabelingAlgorithm aAlgorithm) Specifies the labeling algorithm to be used for the label(s).voidsetAlgorithmProvider(ILspLabelingAlgorithmProvider aAlgorithmProvider) Specifies the labeling algorithm provider to be used for the label(s).voidsetCustomizableStyles(TLspCustomizableStyle... aStyles) Specifies a list of styles to be applied to all objects.voidSpecifies the declutter group the label(s) should be in.voidsetLocations(int aShift, TLspLabelLocationProvider.Location... aLocations) Specifies a set of fixed locations to be used for the label(s).voidsetLocations(TLspLabelLocationProvider.Location... aLocations) Specifies a set of fixed locations to be used for the label(s).voidsetPriority(Integer aPriority) Specifies a fixed priority for the label(s).voidsetPriorityProvider(ILspLabelPriorityProvider aPriorityProvider) Specifies a priority provider for the label(s).voidsetStyler(ILspStyler aDelegateStyler) Sets a delegate styler.voidSpecifies a list of styles to be applied to all objects.voidstyle(Collection<?> aDomainObjects, ALspLabelStyleCollector aCollector, TLspContext aContext) Convenience method that takes anALspLabelStyleCollectoras argument instead of anALspStyleCollector.Methods inherited from class com.luciad.view.lightspeed.style.styler.ALspLabelStyler
styleMethods 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, 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:ALspLabelStylerConvenience method that takes an
ALspLabelStyleCollectoras argument instead of anALspStyleCollector. This method is called fromALspLabelStyler.style(Collection, ALspStyleCollector, TLspContext).- Specified by:
stylein 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_GROUPis 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: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
-