Class ALspStyleTargetProvider
java.lang.Object
com.luciad.view.lightspeed.style.styler.ALspStyleTargetProvider
This abstract class is used by
ILspStyler
implementations that want
to convert an object into a list of targets to which the styles should be
applied. Objects for which no geometry is returned will not be painted, in
which case this interface acts as a filter.
The possible uses of this interface are very broad, so we can only list a few
examples.
- Applying different icon style to points in a point list.
- Applying styles to complex objects that do not implement ILcdShape directly.
- Creating entirely different geometries from objects (e.g. pie charts from countries)
- Moving points to the height of the terrain before painting.
- Filtering objects for which a style should not be applied. This can be
more efficient compared to applying the filtering in the
ILspStyler
.
Object.equals(Object)
and
Object.hashCode()
method to ensure that two providers with the same
behavior are recognized as such.
These providers can be considered immutable by its users.- Since:
- 2012.0
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Deprecated.This enum has no functional meaning. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
getEditTargetsSFCT
(Object aObject, TLspContext aContext, List<Object> aResultSFCT) Returns the list of objects that can be edited by an editor.getStyleTargetReference
(TLspContext aContext) Returns the reference of the style targets used by this provider.abstract void
getStyleTargetsSFCT
(Object aObject, TLspContext aContext, List<Object> aResultSFCT) Returns the list of objects to which styles can be applied by a painter.Deprecated.Value returned by this method has no functional effect.
-
Constructor Details
-
ALspStyleTargetProvider
public ALspStyleTargetProvider()
-
-
Method Details
-
getStyleTargetTypes
Deprecated.Value returned by this method has no functional effect.Returns all geometry target types to which thisALspStyleTargetProvider
can convert objects. By default it returns a set of all available geometry types.- Returns:
- all geometry target types, supported by this
ALspStyleTargetProvider
.
-
getStyleTargetsSFCT
public abstract void getStyleTargetsSFCT(Object aObject, TLspContext aContext, List<Object> aResultSFCT) Returns the list of objects to which styles can be applied by a painter. When applied to the same object twice, the result should always be the same. If a change in theaContext
triggers a change in the style targets, theILspStyler
that provided this provider should use a style change event to notify its users, and a newALspStyleTargetProvider
that is not equal to the current one should be returned upon querying the updated style. It is allowed to leaveaResultSFCT
empty. In this case nothing will be visualized foraObject
, allowing this method to be used as a basic filter.- Parameters:
aObject
- The object from which the style targets should be derivedaContext
- The current context in which the objects will be styled.aResultSFCT
- A list of objects that are supported by the painter or layer on which theILspStyler
has been configured. In case the object itself should be visualized,aObject
should be added to the list. List should not containnull
values.
-
getEditTargetsSFCT
Returns the list of objects that can be edited by an editor. When applied to the same object twice, the results should always be the same. (Meaning that the resulting objects should have instance equality) This method acts as a filter for editable style targets. Only the objects that are included in theaResultSFCT
parameter will be editable. By default, all objects are editable. Override this method to customize this behavior, and fine-tune which style targets are editable or not. If a change in theaContext
triggers a change in the style targets, theILspStyler
that provided this provider should use a style change event to notify its users, and a newALspStyleTargetProvider
that is not equal to the current one should be returned upon querying the updated style. Returning an empty list indicates that none of the targets of the object should be editable. Note: The list of object should be a subset of thegetStyleTargetsSFCT
method. By default this method simply callsgetStyleTargetsSFCT
.- Parameters:
aObject
- The object from which the edit targets should be derivedaContext
- The current context in which the objects will be styled.aResultSFCT
- A list of objects (that is a subset of the objects generated bygetStyleTargetsSFCT
) that indicate which style targets are editable. In case the input object itself is editable, it should be added to the list.
-
getStyleTargetReference
Returns the reference of the style targets used by this provider. In most cases, this will be the model reference. The current default implementation is the following:
return aContext.getModelReference();
If the geometry is defined in screen coordinates, return
null
.- Parameters:
aContext
- The context for which the reference needs to be returned.- Returns:
- A valid reference
-