Class TLcySLDDomainObjectSupplier
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:
- Creation of the domain object: it creates
TLcySLDDomainObjects. 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 associatedALcyShapeSupplier. - XML marshallers and unmarshallers: support is provided for SLD, the features, extrusion,
etc. The delegate
ALcyShapeSupplieronly needs to care about the shape itself. - Conversion of domain objects: conversion to an extruded version is supported, as well as
conversion to the delegate shape types, and conversion between models with different model
references. This functionality needs the
ALcyShapeCodecprovided by theALcyShapeSupplier. - Creation of adapter objects: adapting to the delegate shape type is supported. For example a
TLcySLDDomainObjectcontaining a circle can be adapted to the classILcdCircle.class. This allows to manipulate the properties of theILcdCircle, 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 theALcyShapeSupplier.createShapeCustomizerPanelFactoriesmethod. - Painters and editors: the style related functionality is provided by this class, painting
and editing the actual shape (without having to care about style) is provided by
ALcyShapeSupplier.createShapePainterProviderContainer.
- Since:
- 8.2
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTLcySLDDomainObjectSupplier(ALcyShapeSupplier aShapeSupplier, ALcyProperties aProperties, boolean aExtrusionSupported, ILcyLucyEnv aLucyEnv) Creates aTLcySLDDomainObjectSupplierobject. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanCreateDomainObject(ILcdModel aForModel) Indicates if this domain object supplier is capable of creating a domain object inaForModel.booleanChecks whether this domain object supplier is capable of providing several items foraDomainObject.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 featuresCreates 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.Returns a ILcyCustomizerPanelFactory that creates ILcyCustomizerPanels for this type of domain object.Creates the editor provider for the objects of this domain object supplier.Creates the painter provider for the objects of this domain object supplier.Creates the XML schema decoder libraries that will be used to load domain objects from the native format.Creates the XML schema encoder libraries that will be used to save domain objects to the native format.Returns the symbolizer type that should be used to decide with which style to create new shapes.Returns theILcyLucyEnvinstance which was set during the construction.Returns the shape supplier associated with this domain object suppliervoidsetShapeSupplier(ALcyShapeSupplier aShapeSupplier) Sets theALcyShapeSupplier.Methods inherited from class com.luciad.lucy.addons.drawing.format.ALcyDomainObjectSupplier
getDomainObjectID, getProperties
-
Constructor Details
-
TLcySLDDomainObjectSupplier
public TLcySLDDomainObjectSupplier(ALcyShapeSupplier aShapeSupplier, ALcyProperties aProperties, boolean aExtrusionSupported, ILcyLucyEnv aLucyEnv) Creates aTLcySLDDomainObjectSupplierobject.- Parameters:
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- TheALcyPropertiesinstance holding the configuration of this supplier. Must not benull.aExtrusionSupported-truewhen the shape can be extruded. SeecreateDomainObjectConverterfor more information on how this extrusion is provided.aLucyEnv- the Lucy backend for which this supplier is being created. Must not benull.- See Also:
-
-
Method Details
-
canCreateDomainObject
Description copied from class:ALcyDomainObjectSupplierIndicates if this domain object supplier is capable of creating a domain object inaForModel.- Specified by:
canCreateDomainObjectin classALcyDomainObjectSupplier- Parameters:
aForModel- TheILcdModelfor which this domain object supplier should create a domain object- Returns:
- if this domain object supplier can create a domain object in this model.
-
createDomainObject
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- Specified by:
createDomainObjectin classALcyDomainObjectSupplier- Parameters:
aForModel- TheILcdModelfor which the domain object is created.- Returns:
- a new instance of TLcySLDDomainObject, containing a shape retrieved from the associated shape supplier and the right number and type of features
-
canHandle
Description copied from class:ALcyDomainObjectSupplierChecks whether this domain object supplier is capable of providing several items for
aDomainObject. These items are:- XML marshallers and unmarshallers
- A painter provider
- An editor provider
- A domain object customizer panel factory
- A converter
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
ALcyDomainObjectSupplierit 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.- Specified by:
canHandlein classALcyDomainObjectSupplier- Parameters:
aDomainObject- the domain object- Returns:
trueif this domain object supplier can handleaDomainObject
-
createGXYPainterProvider
Description copied from class:ALcyDomainObjectSupplierCreates 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.
- Specified by:
createGXYPainterProviderin classALcyDomainObjectSupplier- Returns:
- The painter provider. Must not be
null.
-
createGXYEditorProvider
Description copied from class:ALcyDomainObjectSupplierCreates 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.
- Specified by:
createGXYEditorProviderin classALcyDomainObjectSupplier- Returns:
- The editor provider. Must not be
null.
-
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):- whether the SLD domain object is assignable to the requested class.
- whether the base shape is assignable to the requested class.
- whether the domain object converter of the associated shape supplier can adapt the base shape of this SLD domain object.
To
convert, the domain object converter created by this implementation tries to:- convert the
associatedsld domain objects to its delegate shapes when the source model is a drawing model and the target model is unknown. - convert a general shape to an SLD domain object if the target model is a drawing model and the domain object converter of the associated shape supplier can convert the given general shape to its own shape.
- convert an SLD domain object to an extruded SLD domain object by wrapping the delegate shape in an
ILcdEditableExtrudedShapeif the source and target model are both drawing models, theaCanAdaptToClassisILcdEditableExtrudedShape.classand if extrusion is supported by thisTLcySLDDomainObjectSupplier.
- Specified by:
createDomainObjectConverterin classALcyDomainObjectSupplier- Returns:
- The domain object converter of this domain object supplier. Must not be
null.
-
getDrawingSymbolizerType
Returns the symbolizer type that should be used to decide with which style to create new shapes.- Returns:
- the symbolizer type that should be used to decide with which style to create new
shapes. Must not be
null.
-
getLucyEnv
Returns theILcyLucyEnvinstance which was set during the construction.- Returns:
- the
ILcyLucyEnvinstance which was set during the construction.
-
getShapeSupplier
Returns the shape supplier associated with this domain object supplier- Returns:
- the shape supplier associated with this domain object supplier
-
setShapeSupplier
Sets theALcyShapeSupplier. This method should only be invoked during initialization, before this class is actually used.- Parameters:
aShapeSupplier- The shape supplier to set.
-
createXMLSchemaBasedEncoderLibraries
Description copied from class:ALcyDomainObjectSupplierCreates the XML schema encoder libraries that will be used to save domain objects to the native format.
- Specified by:
createXMLSchemaBasedEncoderLibrariesin classALcyDomainObjectSupplier- Returns:
- an array of XML schema encoder libraries that are capable of saving domain objects to the native format.
-
createXMLSchemaBasedDecoderLibraries
Description copied from class:ALcyDomainObjectSupplierCreates the XML schema decoder libraries that will be used to load domain objects from the native format.- Specified by:
createXMLSchemaBasedDecoderLibrariesin classALcyDomainObjectSupplier- Returns:
- an XML schema decoder libraries that are capable of loading domain objects from the native format.
-
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
ILcyCustomizerPanelinstances that are created by the returned factory are of typeILcyCompositeCustomizerPanel.- Specified by:
createDomainObjectCustomizerPanelFactoryin classALcyDomainObjectSupplier- Returns:
- a ILcyCustomizerPanelFactory that creates ILcyCustomizerPanels for this type of domain object.
-