Class TLcySLDDomainObjectSupplier

java.lang.Object
com.luciad.lucy.addons.drawing.format.ALcyDomainObjectSupplier
com.luciad.lucy.addons.drawing.format.TLcySLDDomainObjectSupplier

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:

  • 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 associated ALcyShapeSupplier.
  • XML marshallers and unmarshallers: support is provided for SLD, the features, extrusion, etc. The delegate ALcyShapeSupplier only 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 ALcyShapeCodec provided by the ALcyShapeSupplier.
  • Creation of adapter objects: adapting to the delegate shape type is supported. For example a 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.
  • 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 Details

    • TLcySLDDomainObjectSupplier

      public TLcySLDDomainObjectSupplier(ALcyShapeSupplier aShapeSupplier, ALcyProperties aProperties, boolean aExtrusionSupported, ILcyLucyEnv aLucyEnv)
      Creates a TLcySLDDomainObjectSupplier object.
      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 - 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.
      See Also:
  • Method Details

    • canCreateDomainObject

      public boolean canCreateDomainObject(ILcdModel aForModel)
      Description copied from class: ALcyDomainObjectSupplier
      Indicates if this domain object supplier is capable of creating a domain object in aForModel.
      Specified by:
      canCreateDomainObject in class ALcyDomainObjectSupplier
      Parameters:
      aForModel - The ILcdModel for 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

      public 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
      Specified by:
      createDomainObject in class ALcyDomainObjectSupplier
      Parameters:
      aForModel - The ILcdModel for 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

      public boolean canHandle(Object aDomainObject)
      Description copied from class: ALcyDomainObjectSupplier

      Checks 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 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.

      Specified by:
      canHandle in class ALcyDomainObjectSupplier
      Parameters:
      aDomainObject - the domain object
      Returns:
      true if this domain object supplier can handle aDomainObject
    • createGXYPainterProvider

      public ILcdGXYPainterProvider createGXYPainterProvider()
      Description copied from class: 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.

      Specified by:
      createGXYPainterProvider in class ALcyDomainObjectSupplier
      Returns:
      The painter provider. Must not be null.
    • createGXYEditorProvider

      public ILcdGXYEditorProvider createGXYEditorProvider()
      Description copied from class: 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.

      Specified by:
      createGXYEditorProvider in class ALcyDomainObjectSupplier
      Returns:
      The editor provider. Must not be null.
    • createDomainObjectConverter

      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):

      • 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 associated sld 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 ILcdEditableExtrudedShape if the source and target model are both drawing models, the aCanAdaptToClass is ILcdEditableExtrudedShape.class and if extrusion is supported by this TLcySLDDomainObjectSupplier.
      Specified by:
      createDomainObjectConverter in class ALcyDomainObjectSupplier
      Returns:
      The domain object converter of this domain object supplier. Must not be null.
    • getDrawingSymbolizerType

      public TLcyDrawingSymbolizerType 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

      public ILcyLucyEnv getLucyEnv()
      Returns the ILcyLucyEnv instance which was set during the construction.
      Returns:
      the ILcyLucyEnv instance which was set during the construction.
    • getShapeSupplier

      public ALcyShapeSupplier getShapeSupplier()
      Returns the shape supplier associated with this domain object supplier
      Returns:
      the shape supplier associated with this domain object supplier
    • setShapeSupplier

      public void setShapeSupplier(ALcyShapeSupplier aShapeSupplier)
      Sets the ALcyShapeSupplier. This method should only be invoked during initialization, before this class is actually used.
      Parameters:
      aShapeSupplier - The shape supplier to set.
    • createXMLSchemaBasedEncoderLibraries

      public ILcdXMLSchemaBasedEncoderLibrary[] createXMLSchemaBasedEncoderLibraries()
      Description copied from class: ALcyDomainObjectSupplier

      Creates the XML schema encoder libraries that will be used to save domain objects to the native format.

      Specified by:
      createXMLSchemaBasedEncoderLibraries in class ALcyDomainObjectSupplier
      Returns:
      an array of XML schema encoder libraries that are capable of saving domain objects to the native format.
    • createXMLSchemaBasedDecoderLibraries

      public ILcdXMLSchemaBasedDecoderLibrary[] createXMLSchemaBasedDecoderLibraries()
      Description copied from class: ALcyDomainObjectSupplier
      Creates the XML schema decoder libraries that will be used to load domain objects from the native format.
      Specified by:
      createXMLSchemaBasedDecoderLibraries in class ALcyDomainObjectSupplier
      Returns:
      an XML schema decoder libraries that are capable of loading domain objects from the native format.
    • createDomainObjectCustomizerPanelFactory

      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.

      Specified by:
      createDomainObjectCustomizerPanelFactory in class ALcyDomainObjectSupplier
      Returns:
      a ILcyCustomizerPanelFactory that creates ILcyCustomizerPanels for this type of domain object.