Class ALcyShapeSupplier
java.lang.Object
com.luciad.lucy.addons.drawing.format.ALcyShapeSupplier
- Direct Known Subclasses:
ALcyShapeSupplierWrapper
Provides the shape specific functionality to a
TLcySLDDomainObjectSupplier
. This shape specific functionality consists of:
- Creating of an
ILcdShape
for specificILcdModel
s - Creating xml marshallers and unmarshallers
- Providing a painting and editing support for the shape
- Providing an
ALcyShapeCodec
- Providing an
ILcyCustomizerPanelFactory
which can create a GUI element, allowing the user to change the specific properties of the shape.
- Since:
- 8.2
-
Constructor Summary
ConstructorDescriptionALcyShapeSupplier
(String aShapeID, String aDisplayName, TLcyDrawingSymbolizerType aDrawingSymbolizerType, ALcyProperties aProperties) Creates a newALcyShapeSupplier
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canCreateShape
(ILcdModel aForModel) Indicates whether this supplier can create a shape for the modelaForModel
abstract boolean
Checks whether this supplier can handle the shapeaShape
Creates the domain object converter that can convert the shapes of this supplier instance to other shapes or, conversely, import the data of other flavors to the shapes of this supplier.abstract ILcdShape
createShape
(ILcdModel aForModel) Creates the shape of the domain object.abstract ALcyShapeCodec
Returns aALcyShapeCodec
for shapes which can be handled by this shape supplierabstract ILcyCustomizerPanelFactory[]
Returns a ILcyCustomizerPanelFactory that creates ILcyCustomizerPanels for the shapes created by this class.abstract TLcyShapePainterProviderContainer
Creates the painters and editors that can paint and edit the shape returned bycreateShape(com.luciad.model.ILcdModel)
.abstract ILcdXMLSchemaBasedDecoderLibrary
Creates the XML decoder library which will be used to load shapes from the native format.abstract ILcdXMLSchemaBasedEncoderLibrary
Creates the XML marshaller library which will be used to save shapes to the native format.Returns the untranslated (US English) display name for this shapeReturns the symbolizer type that should be used to decide with which style to create new shapes.Returns theALcyProperties
holding the configuration of this shape supplier.Returns the ID of this supplier.
-
Constructor Details
-
ALcyShapeSupplier
public ALcyShapeSupplier(String aShapeID, String aDisplayName, TLcyDrawingSymbolizerType aDrawingSymbolizerType, ALcyProperties aProperties) Creates a newALcyShapeSupplier
.- Parameters:
aShapeID
- Unique ID of thisALcyShapeSupplier
. It is also used as the domain object ID of theTLcySLDDomainObjectSupplier
.aDisplayName
- The untranslated (US English) display name for this shapeaDrawingSymbolizerType
- a type-safe enumeration. The symbolizer type that should be used to decide with which style new shapes will be created.aProperties
- TheALcyProperties
holding the configuration of this shape supplier. Must not benull
.
-
-
Method Details
-
canCreateShape
Indicates whether this supplier can create a shape for the modelaForModel
- Parameters:
aForModel
- The target model, for which this shape supplier should create a shape- Returns:
- if this supplier can create a shape for this model. The default implementation
returns
true
.
-
createShape
Creates the shape of the domain object. This method is allowed to interact with the UI: it should be able to pop up a dialog asking for details. (eg as is the case with MS2525b) This method is always called from the EDT thread All this means that this method must not be called during workspace decoding or model decoding- Parameters:
aForModel
- TheILcdModel
for which the shape is created. The implementation of this method can use this model to determine, for instance, the model reference or the ILcdDataModelDescriptor. Nevernull
. The implementation of this method should not insert the created shape in thisILcdModel
.- Returns:
- A new instance of the domain object represented by this domain object supplier implementation.
Must not be
null
.
-
canHandle
Checks whether this supplier can handle the shapeaShape
- Parameters:
aShape
- theILcdShape
to check- Returns:
true
when this shape is capable of handling the shapeaShape
-
createXMLSchemaBasedEncoderLibrary
Creates the XML marshaller library which will be used to save shapes to the native format. An XML marshaller library should typically implement the following actions:- An XML element should be registered for this supplier's XML geometry property type.
- An XML element should be registered for this supplier's XML geometry type.
- A type marshaller for the [supplier's shape class, XML geometry property type] pair should be registered.
- A type marshaller for the [supplier's shape class, XML geometry type] pair should be registered.
ILcdXMLSchemaBasedEncoderLibrary.configureEncoder
method:public void configureEncoder( TLcdXMLSchemaBasedEncoder aEncoder ) { TLcdXMLSchemaSet schema = aEncoder.getMapping().getSchemaSet(); schema.registerElement( MY_GEOMETRY_PROPERTY_ELEMENT ); schema.registerElement( MY_GEOMETRY_ELEMENT ); TLcdXMLTypeMarshallerProvider provider = aEncoder.getTypeMarshallerProvider(); provider.registerTypeMarshaller( MY_GEOMETRY_PROPERTY_ELEMENT.getType(), MyShape.class, new MyShapePropertyMarshaller( aMarshallerContext ) ); provider.registerTypeMarshaller( MY_GEOMETRY_ELEMENT.getType(), MyShape.class, new MyShapeMarshaller( aMarshallerContext ) ); }
- Returns:
- an XML encoder library that is capable of saving shapes to the native format.
-
createXMLSchemaBasedDecoderLibrary
Creates the XML decoder library which will be used to load shapes from the native format. An XML decoder library should typically implement the following actions:- An XML element should be registered for this supplier's XML geometry property type.
- An XML element should be registered for this supplier's XML geometry type.
- A type unmarshaller for the [supplier's shape class, XML geometry property type] pair should be registered.
- A type unmarshaller for the [supplier's shape class, XML geometry type] pair should be registered.
ILcdXMLSchemaBasedDecoderLibrary.configureDecoder
method:public void configureDecoder( TLcdXMLSchemaBasedDecoder aDecoder ) { TLcdXMLSchemaSet schema = aDecoder.getMapping().getSchemaSet(); schema.registerElement( MY_GEOMETRY_PROPERTY_ELEMENT ); schema.registerElement( MY_GEOMETRY_ELEMENT ); TLcdXMLTypeUnmarshallerProvider provider = aDecoder.getTypeUnmarshallerProvider(); provider.registerTypeUnmarshaller( MY_GEOMETRY_PROPERTY_ELEMENT.getType(), MyShape.class, new MyShapePropertyUnmarshaller( aDecoder ) ); provider.registerTypeUnmarshaller( MY_GEOMETRY_ELEMENT.getType(), MyShape.class, new MyShapeUnmarshaller( aDecoder ) ); }
- Returns:
- an XML decoder library that is capable of loading shapes from the native format.
-
createShapeCustomizerPanelFactories
Returns a ILcyCustomizerPanelFactory that creates ILcyCustomizerPanels for the shapes created by this class.
The objects set on the customizer panels are instances of
TLcyShapeContext
. This context also contains a reference to the shape and an ILcdModel, but the shape is not an element of this model.- Returns:
- a ILcyCustomizerPanelFactory that creates ILcyCustomizerPanels for the shapes created by this class.
-
createShapePainterProviderContainer
Creates the painters and editors that can paint and edit the shape returned bycreateShape(com.luciad.model.ILcdModel)
. These painters don't have to perform any styling, seeTLcyShapePainterProviderContainer
for more details.- Returns:
- The
TLcyShapePainterProviderContainer
that can paint the delegate shape. Must not benull
.
-
createShapeCodec
Returns aALcyShapeCodec
for shapes which can be handled by this shape supplier- Returns:
- A
ALcyShapeCodec
for shapes which can be handled by this shape supplier. Must not benull
.
-
getShapeID
Returns the ID of this supplier. Can for example be used to find out which 2D domain object suppliers match with which 3D domain object suppliers.- Returns:
- the ID of this supplier
- See Also:
-
getDisplayName
Returns the untranslated (US English) display name for this shape- Returns:
- The untranslated (US English) display name for this shape
-
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
.
-
createDomainObjectConverter
Creates the domain object converter that can convert the shapes of this supplier instance to other shapes or, conversely, import the data of other flavors to the shapes of this supplier.
The default implementation returns a domain object converter based on theALcyShapeCodec
.- Returns:
- The shape converter of this supplier. Must not be
null
.
-
getProperties
Returns the
ALcyProperties
holding the configuration of this shape supplier.- Returns:
- The
ALcyProperties
holding the configuration. Nevernull
.
-