public abstract class ALspStyleTargetProvider extends Object
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.
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.Modifier and Type | Class and Description |
---|---|
static class |
ALspStyleTargetProvider.StyleTargetType
Deprecated.
This enum has no functional meaning.
|
Constructor and Description |
---|
ALspStyleTargetProvider() |
Modifier and Type | Method and Description |
---|---|
void |
getEditTargetsSFCT(Object aObject,
TLspContext aContext,
List<Object> aResultSFCT)
Returns the list of objects that can be edited by an editor.
|
ILcdModelReference |
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.
|
Set<ALspStyleTargetProvider.StyleTargetType> |
getStyleTargetTypes()
Deprecated.
Value returned by this method has no functional effect.
|
public Set<ALspStyleTargetProvider.StyleTargetType> getStyleTargetTypes()
ALspStyleTargetProvider
can convert objects.
By default it returns a set of all available geometry types.ALspStyleTargetProvider
.public abstract void getStyleTargetsSFCT(Object aObject, TLspContext aContext, List<Object> aResultSFCT)
aContext
triggers a change in the style targets,
the ILspStyler
that provided this provider should use a style
change event to notify its users, and a new ALspStyleTargetProvider
that is not
equal to the current one should be returned upon querying the updated
style.
It is allowed to leave aResultSFCT
empty. In this case nothing will
be visualized for aObject
, allowing this method to be used as a basic filter.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 the ILspStyler
has been configured. In case the
object itself should be visualized, aObject
should be
added to the list. List should not contain null
values.public void getEditTargetsSFCT(Object aObject, TLspContext aContext, List<Object> aResultSFCT)
aResultSFCT
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 the aContext
triggers a change in the style targets,
the ILspStyler
that provided this provider should use a style
change event to notify its users, and a new ALspStyleTargetProvider
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 the getStyleTargetsSFCT
method. By default this method simply calls getStyleTargetsSFCT
.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 by getStyleTargetsSFCT
)
that indicate which style targets are editable.
In case the input object itself is editable, it should be added to the list.public ILcdModelReference getStyleTargetReference(TLspContext aContext)
return aContext.getModelReference();
If the geometry is defined in screen coordinates, return null
.
aContext
- The context for which the reference needs to be returned.