public abstract class ALcyDomainObjectSupplier
extends java.lang.Object
Groups all functionality related to a specific domain object, in order to easily allow adding new domain objects to the drawing addon.
This class offers support for everything that needs to be done for a domain object:
ILcdCircle
. Altering the
adapter object will also change the original object.ILcyCustomizerPanel
to customize the domain object.
In order to have undo/redo functionality these panels should generate the necessary
TLcdUndoableEvent
s. More information on this can be found in the developer
guide.Note: the painter and editor should be able to handle converted
domain objects as well. See createDomainObjectConverter
for more information
about converted domain objects.
Adding or removing support for a domain object can be done by adding or removing the corresponding
instance of this class from TLcyDrawingFormat
by using the methods addDomainObjectSupplier
and removeDomainObjectSupplier
.
TLcySLDDomainObjectSupplier
,
ALcyShapeSupplier
Modifier | Constructor and Description |
---|---|
protected |
ALcyDomainObjectSupplier(java.lang.String aDomainObjectID,
ALcyProperties aProperties)
Create a new domain object supplier with unique ID
aDomainObjectID . |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
canCreateDomainObject(ILcdModel aForModel)
Indicates if this domain object supplier is capable of creating a domain object in
aForModel . |
abstract boolean |
canHandle(java.lang.Object aDomainObject)
Checks whether this domain object supplier is capable of providing several items for
aDomainObject . |
abstract ILcdShape |
createDomainObject(ILcdModel aForModel)
Creates a new domain object that matches with the given
ILcdModel . |
abstract 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.
|
abstract ILcyCustomizerPanelFactory |
createDomainObjectCustomizerPanelFactory()
Returns a ILcyCustomizerPanelFactory that creates ILcyCustomizerPanels for this type of
domain object.
|
abstract ILcdGXYEditorProvider |
createGXYEditorProvider()
Creates the editor provider for the objects of this domain object supplier.
|
abstract ILcdGXYPainterProvider |
createGXYPainterProvider()
Creates the painter provider for the objects of this domain object supplier.
|
abstract ILcdXMLSchemaBasedDecoderLibrary[] |
createXMLSchemaBasedDecoderLibraries()
Creates the XML schema decoder libraries that will be used to load domain objects from the native
format.
|
abstract ILcdXMLSchemaBasedEncoderLibrary[] |
createXMLSchemaBasedEncoderLibraries()
Creates the XML schema encoder libraries that will be used to save domain objects to the native
format.
|
java.lang.String |
getDomainObjectID()
Returns the unique ID of this domain object supplier.
|
ALcyProperties |
getProperties()
Returns the ALcyProperties that holds the configuration of this domain object supplier instance.
|
protected ALcyDomainObjectSupplier(java.lang.String aDomainObjectID, ALcyProperties aProperties)
aDomainObjectID
.aDomainObjectID
- a unique ID for this supplier.aProperties
- The properties object that holds the configuration of this domain object supplier
instance.public java.lang.String getDomainObjectID()
Returns the unique ID of this domain object supplier. Can for example be used to find out which 2D domain object suppliers match with which 3D domain object suppliers.
The IDs of the default supported domain objects and their corresponding suppliers can be accessed
through the constants on the TLcyDrawingFormat
class.
public ALcyProperties getProperties()
ALcyProperties
that holds the configuration. May be
null
.public abstract boolean canHandle(java.lang.Object aDomainObject)
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.
aDomainObject
- the domain objecttrue
if this domain object supplier can handle aDomainObject
public abstract boolean canCreateDomainObject(ILcdModel aForModel)
aForModel
.aForModel
- The ILcdModel
for which this domain object supplier should create a domain objectpublic abstract ILcdShape createDomainObject(ILcdModel aForModel)
ILcdModel
.aForModel
- The ILcdModel
for which the domain object is created. The
implementation of this method can use this model to determine, for instance,
the model reference or the ILcdDataModelDescriptor. Never null
.
The implementation of this method should not insert the
created domain object in this ILcdModel
.null
.public abstract ILcdXMLSchemaBasedEncoderLibrary[] createXMLSchemaBasedEncoderLibraries()
Creates the XML schema encoder libraries that will be used to save domain objects to the native format.
public abstract ILcdXMLSchemaBasedDecoderLibrary[] createXMLSchemaBasedDecoderLibraries()
public abstract 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.
public abstract ILcdGXYPainterProvider createGXYPainterProvider()
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.
null
.public abstract ILcdGXYEditorProvider createGXYEditorProvider()
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.
null
.public abstract 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.
null
.