public class TLcySLDDomainObjectSupplier extends ALcyDomainObjectSupplier
Implementation of ALcyDomainObjectSupplier
that works with SLD (Styled Layer
Descriptor) styling. All functionality specific to the actual shape (e.g. circle, polygon, ...)
is split off in a separate class: ALcyShapeSupplier
. All common functionality such as
styling, providing properties (see ILcdDataObject
), supporting extruded shapes, etc.
is provided by this class. As such, it is very easy to add support for a new shape (e.g. see
samples.lucy.drawing.hippodrome.DrawingHippodromeAddOn
).
This supplier handles:
TLcySLDDomainObject
s. In order to
achieve the split, these objects have a shape (e.g. circle, polygon, ...) instead of being a
shape themselves. The delegate shape is created by the associated
ALcyShapeSupplier
.ALcyShapeSupplier
only needs to care about the shape itself.ALcyShapeCodec
provided by the
ALcyShapeSupplier
.TLcySLDDomainObject
containing a circle can be adapted to the class
ILcdCircle.class
. This allows to manipulate the properties of the
ILcdCircle
, for example the radius.ILcyCustomizerPanel
: a user interface is provided to manipulate the features,
and the properties of the extruded shape. Changing the properties of the containing shape is
provided by the ALcyShapeSupplier.createShapeCustomizerPanelFactories
method.ALcyShapeSupplier.createShapePainterProviderContainer
.ALcyShapeSupplier
,
ALcyDomainObjectConverter
Constructor and Description |
---|
TLcySLDDomainObjectSupplier(ALcyShapeSupplier aShapeSupplier,
ALcyProperties aProperties,
boolean aExtrusionSupported,
ILcyLucyEnv aLucyEnv)
Creates a
TLcySLDDomainObjectSupplier object. |
Modifier and Type | Method and Description |
---|---|
boolean |
canCreateDomainObject(ILcdModel aForModel)
Indicates if this domain object supplier is capable of creating a domain object in
aForModel . |
boolean |
canHandle(Object aDomainObject)
Checks whether this domain object supplier is capable of providing several items for
aDomainObject . |
ILcdShape |
createDomainObject(ILcdModel aForModel)
Creates a new domain object that matches with the given ILcdModel, containing a shape retrieved
from the associated shape supplier and the right number and type of features
|
ALcyDomainObjectConverter |
createDomainObjectConverter()
Creates the domain object converter that can export the domain objects of this supplier to
other models or, conversely, import the data of other models as domain objects supported
by this domain object supplier.
|
ILcyCustomizerPanelFactory |
createDomainObjectCustomizerPanelFactory()
Returns a ILcyCustomizerPanelFactory that creates ILcyCustomizerPanels for this type of
domain object.
|
ILcdGXYEditorProvider |
createGXYEditorProvider()
Creates the editor provider for the objects of this domain object supplier.
|
ILcdGXYPainterProvider |
createGXYPainterProvider()
Creates the painter provider for the objects of this domain object supplier.
|
ILcdXMLSchemaBasedDecoderLibrary[] |
createXMLSchemaBasedDecoderLibraries()
Creates the XML schema decoder libraries that will be used to load domain objects from the native
format.
|
ILcdXMLSchemaBasedEncoderLibrary[] |
createXMLSchemaBasedEncoderLibraries()
Creates the XML schema encoder libraries that will be used to save domain objects to the native
format.
|
TLcyDrawingSymbolizerType |
getDrawingSymbolizerType()
Returns the symbolizer type that should be used to decide with which style to create new
shapes.
|
ILcyLucyEnv |
getLucyEnv()
Returns the
ILcyLucyEnv instance which was set during the construction. |
ALcyShapeSupplier |
getShapeSupplier()
Returns the shape supplier associated with this domain object supplier
|
void |
setShapeSupplier(ALcyShapeSupplier aShapeSupplier)
Sets the
ALcyShapeSupplier . |
getDomainObjectID, getProperties
public TLcySLDDomainObjectSupplier(ALcyShapeSupplier aShapeSupplier, ALcyProperties aProperties, boolean aExtrusionSupported, ILcyLucyEnv aLucyEnv)
TLcySLDDomainObjectSupplier
object.aShapeSupplier
- Delegate support for the geometrical part. This shape supplier is
used to create, paint, encode and decode the geometry of the SLD
domain object, while this class takes care of the SLD styling of
that geometry.aProperties
- The ALcyProperties
instance holding the configuration
of this supplier. Must not be null
.aExtrusionSupported
- true
when the shape can be extruded. See
createDomainObjectConverter
for more information on how
this extrusion is provided.aLucyEnv
- the Lucy backend for which this supplier is being created. Must not
be null
.createDomainObjectConverter()
public boolean canCreateDomainObject(ILcdModel aForModel)
ALcyDomainObjectSupplier
aForModel
.canCreateDomainObject
in class ALcyDomainObjectSupplier
aForModel
- The ILcdModel
for which this domain object supplier should create a domain objectpublic ILcdShape createDomainObject(ILcdModel aForModel)
createDomainObject
in class ALcyDomainObjectSupplier
aForModel
- The ILcdModel
for which the domain object is created.public boolean canHandle(Object aDomainObject)
ALcyDomainObjectSupplier
Checks whether this domain object supplier is capable of providing several items for
aDomainObject
. These items are:
This method is mainly used to find the correct supplier from a list of suppliers, or from a composite supplier. If for example a painter provider is requested from a composite supplier, the composite supplier will iterate through its known suppliers and check first if the supplier can handle the domain object, before actually asking for the painter provider.
Before requesting for example marshallers, painter providers, ... directly from an
ALcyDomainObjectSupplier
it is appropriate to call this
method to make sure the marshallers, painter providers, ... which are returned are actually capable
of dealing with a certain domain object.
canHandle
in class ALcyDomainObjectSupplier
aDomainObject
- the domain objecttrue
if this domain object supplier can handle aDomainObject
public ILcdGXYPainterProvider createGXYPainterProvider()
ALcyDomainObjectSupplier
Creates the painter provider for the objects of this domain object supplier.
The provided painters are responsible for painting the geometry of the domain object as well as the style.
createGXYPainterProvider
in class ALcyDomainObjectSupplier
null
.public ILcdGXYEditorProvider createGXYEditorProvider()
ALcyDomainObjectSupplier
Creates the editor provider for the objects of this domain object supplier.
The provided editors are responsible for editing the geometry of the domain object as well as the style.
createGXYEditorProvider
in class ALcyDomainObjectSupplier
null
.public ALcyDomainObjectConverter createDomainObjectConverter()
Creates the domain object converter that can export the domain objects of this supplier to other models or, conversely, import the data of other models as domain objects supported by this domain object supplier.
This domain object supplier must be able to provide all facilities (ie. painting, editing, encoding, decoding etc.) for a converted domain object if the target model is a drawing model.
To adapt
, the domain object converter created by this implementation
checks (in the given order):
To convert
, the domain object converter created by this implementation
tries to:
associated
sld domain objects to its delegate shapes when the source
model is a drawing model and the target model is unknown.ILcdEditableExtrudedShape
if the source and target model are both drawing models, the
aCanAdaptToClass
is ILcdEditableExtrudedShape.class
and if extrusion is supported by this
TLcySLDDomainObjectSupplier
.createDomainObjectConverter
in class ALcyDomainObjectSupplier
null
.public TLcyDrawingSymbolizerType getDrawingSymbolizerType()
null
.public ILcyLucyEnv getLucyEnv()
ILcyLucyEnv
instance which was set during the construction.ILcyLucyEnv
instance which was set during the construction.public ALcyShapeSupplier getShapeSupplier()
public void setShapeSupplier(ALcyShapeSupplier aShapeSupplier)
ALcyShapeSupplier
. This method should only be invoked during
initialization, before this class is actually used.aShapeSupplier
- The shape supplier to set.public ILcdXMLSchemaBasedEncoderLibrary[] createXMLSchemaBasedEncoderLibraries()
ALcyDomainObjectSupplier
Creates the XML schema encoder libraries that will be used to save domain objects to the native format.
createXMLSchemaBasedEncoderLibraries
in class ALcyDomainObjectSupplier
public ILcdXMLSchemaBasedDecoderLibrary[] createXMLSchemaBasedDecoderLibraries()
ALcyDomainObjectSupplier
createXMLSchemaBasedDecoderLibraries
in class ALcyDomainObjectSupplier
public ILcyCustomizerPanelFactory createDomainObjectCustomizerPanelFactory()
Returns a ILcyCustomizerPanelFactory that creates ILcyCustomizerPanels for this type of domain object.
This factory is wrapped by a factory that filters for TLcyDomainObjectContext instances.
The ILcyCustomizerPanel
instances that are created by the returned factory are of
type ILcyCompositeCustomizerPanel
.
createDomainObjectCustomizerPanelFactory
in class ALcyDomainObjectSupplier