Class TLspCustomizableStyler
- All Implemented Interfaces:
ILspCustomizableStyler
,ILspStyler
Default implementation of ILspCustomizableStyler
. When asked to specify styling
for any object, it will use all the enabled styles contained in getStyles()
.
- Since:
- 2012.0
- See Also:
-
Constructor Summary
ConstructorDescriptionTLspCustomizableStyler
(ALspStyle... aStyles) Create anILspStyler
which will set all instances inaStyles
as style to every object passed in its ILspStyler#style method.TLspCustomizableStyler
(TLspCustomizableStyle... aCustomizableStyles) Create anILspStyler
which will set all style instances inaCustomizableStyles
as style to every object passed in itsILspStyler#style
method.TLspCustomizableStyler
(Map<? extends ALspStyleTargetProvider, ? extends Collection<TLspCustomizableStyle>> aCustomizableStyles) Create anILspStyler
which will set all style instances and the correspondingALspStyleTargetProvider
inaCustomizableStyles
as style to every object passed in itsILspStyler#style
method. -
Method Summary
Modifier and TypeMethodDescriptionReturns the styler's customizable styles.void
style
(Collection<?> aObjects, ALspStyleCollector aStyleCollector, TLspContext aContext) Styles the objects or labels contained inaObjects
using the methods provided byALspStyleCollector
.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
-
Constructor Details
-
TLspCustomizableStyler
Create an
ILspStyler
which will set all instances inaStyles
as style to every object passed in its ILspStyler#style method.- Parameters:
aStyles
- The styles to use. Can be customized later on by using thegetStyles()
method.
-
TLspCustomizableStyler
Create an
ILspStyler
which will set all style instances inaCustomizableStyles
as style to every object passed in itsILspStyler#style
method.- Parameters:
aCustomizableStyles
- The styles to use.
-
TLspCustomizableStyler
public TLspCustomizableStyler(Map<? extends ALspStyleTargetProvider, ? extends Collection<TLspCustomizableStyle>> aCustomizableStyles) Create an
ILspStyler
which will set all style instances and the correspondingALspStyleTargetProvider
inaCustomizableStyles
as style to every object passed in itsILspStyler#style
method.- Parameters:
aCustomizableStyles
- A map of style target providers and the corresponding styles to use.
-
-
Method Details
-
style
Description copied from interface:ILspStyler
Styles the objects or labels contained in
aObjects
using the methods provided byALspStyleCollector
.Example usages for object styling:
// Same style for all objects: aStyleCollector.objects(aObjects).style(myStyle).submit(); // Object specific styling: aStyleCollector.object(myObject1).style(myStyle1).submit(); aStyleCollector.object(myObject2).style(myStyle2).submit();
Example usages for label styling:
if (aStyleCollector instanceof ALspLabelStyleCollector) { ALspLabelStyleCollector labelStyleCollector = (ALspLabelStyleCollector)aStyleCollector; // Specify a priority for all labels of all objects: labelStyleCollector.objects(aDomainObjects).allLabels().priority(3).styles(...).submit(); // Specify an algorithm for a specific label: labelStyleCollector.object(myObject1).label(123).algorithm(...).styles(...).submit(); }
The objects that are provided to
aStyleCollector
must be objects that are contained inaObjects
. Note that not all objects have to be styled. Objects that are not submitted inaStyleCollector
will not be painted.This method can be called very frequently, depending on the (amount of) data. If this method is not implemented efficiently, painting performance may be affected.
- 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.
-
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.- Returns:
- An immutable collection containing all styles which will be set in the
style
method
-