Class TLcyDrawingFormat


public class TLcyDrawingFormat extends ALcyFormatWrapper

This class keeps track of all the ALcyDomainObjectSupplier instances registered to the addon. Adding or removing a certain ALcyDomainObjectSupplier instance is done calling the methods addDomainObjectSupplier(ALcyDomainObjectSupplier) and removeDomainObjectSupplier(ALcyDomainObjectSupplier).

A specific ALcyDomainObjectSupplier instance can be retrieved by passing the unique ID to the getDomainObjectSupplierWithID(String) method. The IDs of the default domain object suppliers are available through the public fields of this class.

Since this class knows of all the domain object suppliers it can be used to:

  • Create a domain object model for a specific ILcdShape by passing the call to the appropriate ALcyDomainObjectSupplier
  • Convert a shape by providing a ALcyDomainObjectConverter
  • Providing the correct model encoders and decoders

The last function of this class is the creation of a ILcdGXYLayerFactory for the default drawing model.

Since:
8.2
See Also:
  • Field Details

    • MAP_COMPONENT_KEY

      public static final String MAP_COMPONENT_KEY
      Key used for the mapcomponent property in the ALcyProperties object used in the ALcyDrawingToolBarFactory.createGUI(com.luciad.lucy.util.properties.ALcyProperties) method. The value for this key must be an instance of ILcyMapComponent.
      See Also:
    • FORMAT_BAR_KEY

      public static final String FORMAT_BAR_KEY
      Key used for the format bar property in the ALcyProperties object used in the ALcyDrawingToolBarFactory.createGUI(com.luciad.lucy.util.properties.ALcyProperties) method. The value for this key must be an instanceof ALcyFormatBar.
      See Also:
    • GROUP_DOMAIN_OBJECT_ID

      public static final String GROUP_DOMAIN_OBJECT_ID
      Unique ID of the domain object supplier, capable of handling groups.
      See Also:
    • MERIDIAN_DOMAIN_OBJECT_ID

      public static final String MERIDIAN_DOMAIN_OBJECT_ID
      Unique ID of the domain object supplier, capable of handling meridians.
      See Also:
    • PARALLEL_DOMAIN_OBJECT_ID

      public static final String PARALLEL_DOMAIN_OBJECT_ID
      Unique ID of the domain object supplier, capable of handling parallels.
      See Also:
    • NORTH_ARROW_DOMAIN_OBJECT_ID

      public static final String NORTH_ARROW_DOMAIN_OBJECT_ID
      Unique ID of the domain object supplier, capable of handling north arrows.
      See Also:
    • POINT_DOMAIN_OBJECT_ID

      public static final String POINT_DOMAIN_OBJECT_ID
      Unique ID of the domain object supplier, capable of handling points.
      See Also:
    • POLYGON_DOMAIN_OBJECT_ID

      public static final String POLYGON_DOMAIN_OBJECT_ID
      Unique ID of the domain object supplier, capable of handling polygons.
      See Also:
    • COMPLEX_POLYGON_DOMAIN_OBJECT_ID

      public static final String COMPLEX_POLYGON_DOMAIN_OBJECT_ID
      Unique ID of the domain object supplier, capable of handling complex polygons.
      See Also:
    • POLYGON_3D_DOMAIN_OBJECT_ID

      public static final String POLYGON_3D_DOMAIN_OBJECT_ID
      Unique ID of the domain object supplier, capable of handling 3D polygons.
      See Also:
    • RHUMB_POLYGON_DOMAIN_OBJECT_ID

      public static final String RHUMB_POLYGON_DOMAIN_OBJECT_ID
      Unique ID of the domain object supplier, capable of handling rhumb polygons.
      See Also:
    • POLYLINE_DOMAIN_OBJECT_ID

      public static final String POLYLINE_DOMAIN_OBJECT_ID
      Unique ID of the domain object supplier, capable of handling polylines.
      See Also:
    • POLYLINE_3D_DOMAIN_OBJECT_ID

      public static final String POLYLINE_3D_DOMAIN_OBJECT_ID
      Unique ID of the domain object supplier, capable of handling 3D polylines.
      See Also:
    • RHUMB_POLYLINE_DOMAIN_OBJECT_ID

      public static final String RHUMB_POLYLINE_DOMAIN_OBJECT_ID
      Unique ID of the domain object supplier, capable of handling rhumb polylines.
      See Also:
    • SPHERE_DOMAIN_OBJECT_ID

      public static final String SPHERE_DOMAIN_OBJECT_ID
      Unique ID of the domain object supplier, capable of handling spheres.
      See Also:
    • TEXT_DOMAIN_OBJECT_ID

      public static final String TEXT_DOMAIN_OBJECT_ID
      Unique ID of the domain object supplier, capable of handling textshapes.
      See Also:
    • ELLIPSE_DOMAIN_OBJECT_ID

      public static final String ELLIPSE_DOMAIN_OBJECT_ID
      Unique ID of the domain object supplier, capable of handling ellipses.
      See Also:
    • DOME_DOMAIN_OBJECT_ID

      public static final String DOME_DOMAIN_OBJECT_ID
      Unique ID of the domain object supplier, capable of handling domes.
      See Also:
    • CIRCLE_DOMAIN_OBJECT_ID

      public static final String CIRCLE_DOMAIN_OBJECT_ID
      Unique ID of the domain object supplier, capable of handling circles.
      See Also:
    • CIRCLE_BY_3_POINTS_DOMAIN_OBJECT_ID

      public static final String CIRCLE_BY_3_POINTS_DOMAIN_OBJECT_ID
      Unique ID of the domain object supplier, capable of handling circles.
      See Also:
    • BUFFER_DOMAIN_OBJECT_ID

      public static final String BUFFER_DOMAIN_OBJECT_ID
      Unique ID of the domain object supplier, capable of handling buffers.
      See Also:
    • BUFFER_3D_DOMAIN_OBJECT_ID

      public static final String BUFFER_3D_DOMAIN_OBJECT_ID
      Unique ID of the domain object supplier, capable of handling 3D buffers.
      See Also:
    • VARIABLE_BUFFER_3D_DOMAIN_OBJECT_ID

      public static final String VARIABLE_BUFFER_3D_DOMAIN_OBJECT_ID
      Unique ID of the domain object supplier, capable of handling variable buffers.
      See Also:
    • BOUNDS_DOMAIN_OBJECT_ID

      public static final String BOUNDS_DOMAIN_OBJECT_ID
      Unique ID of the domain object supplier, capable of handling bounds.
      See Also:
    • ARC_DOMAIN_OBJECT_ID

      public static final String ARC_DOMAIN_OBJECT_ID
      Unique ID of the domain object supplier, capable of handling arcs.
      See Also:
    • ARC_BAND_DOMAIN_OBJECT_ID

      public static final String ARC_BAND_DOMAIN_OBJECT_ID
      Unique ID of the domain object supplier, capable of handling arc bands.
      See Also:
    • CIRCULAR_ARC_BY_3_POINTS_DOMAIN_OBJECT_ID

      public static final String CIRCULAR_ARC_BY_3_POINTS_DOMAIN_OBJECT_ID
      Unique ID of the domain object supplier, capable of handling circular arcs by 3 points.
      See Also:
    • CIRCULAR_ARC_BY_BULGE_DOMAIN_OBJECT_ID

      public static final String CIRCULAR_ARC_BY_BULGE_DOMAIN_OBJECT_ID
      Unique ID of the domain object supplier, capable of handling circular arcs by bulge.
      See Also:
    • CIRCULAR_ARC_BY_CENTER_POINT_DOMAIN_OBJECT_ID

      public static final String CIRCULAR_ARC_BY_CENTER_POINT_DOMAIN_OBJECT_ID
      Unique ID of the domain object supplier, capable of handling circular arcs by center point.
      See Also:
    • COMPOSITE_CURVE_DOMAIN_OBJECT_ID

      public static final String COMPOSITE_CURVE_DOMAIN_OBJECT_ID
      Unique ID of the domain object supplier, capable of handling composite curves.
      See Also:
    • COMPOSITE_RING_DOMAIN_OBJECT_ID

      public static final String COMPOSITE_RING_DOMAIN_OBJECT_ID
      Unique ID of the domain object supplier, capable of handling composite curves.
      See Also:
  • Constructor Details

    • TLcyDrawingFormat

      public TLcyDrawingFormat(TLcyDrawingAddOn aDrawingAddOn)
      Construct a drawing format which supports drawing models, which are encoded/decoded in/from an extension of OGC's GML.
      Parameters:
      aDrawingAddOn - the drawing addon to register this format to
    • TLcyDrawingFormat

      public TLcyDrawingFormat(ILcyLucyEnv aLucyEnv, TLcyDrawingAddOn aDrawingAddOn, ALcyProperties aProperties)
      Construct a drawing format which supports drawing models, which are encoded/decoded in/from an extension of OGC's GML.
      Parameters:
      aLucyEnv - the Lucy environment in which the backend is plugged
      aDrawingAddOn - the drawing addon to register this format to
      aProperties - the Lucy properties
  • Method Details

    • createAll

      public void createAll()
      This method will initialize the domain object customizers and as such adding domain object suppliers is no longer possible.
      Overrides:
      createAll in class ALcyFormatWrapper
    • createDomainObjectSupplier

      protected ALcyDomainObjectSupplier createDomainObjectSupplier(String aDomainObjectID)

      Creates the ALcyDomainObjectSupplier for the specified ID. This support instance is responsible for providing all 2D support for the specified shape: painters and editors, customizer panels, XML encoders, ...

      Parameters:
      aDomainObjectID - The domain object ID for which to create a domain object supplier. One of the constants in this class that end with ID.
      Returns:
      The ALcyDomainObjectSupplier that provides the support for the shape identified by aID. May be null.
      See Also:
    • isExtrusionSupported

      protected boolean isExtrusionSupported(String aDomainObjectID)
      Returns true if extrusion is supported by default.
      Parameters:
      aDomainObjectID - The domain object ID for which to check if extrusion is supported. One of the constants in this class that end with ID.
      Returns:
      true if extrusion is supported by default for the given domain object ID, false otherwise.
    • createGeometrySupplier

      protected ALcyShapeSupplier createGeometrySupplier(String aDomainObjectID)
      Creates the ALcyShapeSupplier for the given domain object ID.
      Parameters:
      aDomainObjectID - The domain object ID for which to create an ALcyShapeSupplier.
      Returns:
      The created ALcyShapeSupplier.
      See Also:
    • addDomainObjectSupplier

      public void addDomainObjectSupplier(ALcyDomainObjectSupplier aDomainObjectSupplier)

      Shortcut for addDomainObjectSupplier( aDomainObjectSupplier, ILcyLucyEnv.PRIORITY_DEFAULT );.

      Parameters:
      aDomainObjectSupplier - The ALcyDomainObjectSupplier to add. Must not be null.
      See Also:
    • addDomainObjectSupplier

      public void addDomainObjectSupplier(ALcyDomainObjectSupplier aDomainObjectSupplier, int aPriority)

      Adds the specified ALcyDomainObjectSupplier to the List of suppliers that are used to create, paint and encode/decode domain objects in the Drawing layers.

      The position of this supplier in the List is determined by the given priority value: the lower the value, the more important the supplier and the earlier the supplier comes in the List.

      This method should be called before this format is plugged into the Lucy backend. This means you need to create an extension of this format class in order to add a supplier.

      Parameters:
      aDomainObjectSupplier - The ALcyDomainObjectSupplier to add. Must not be null.
      aPriority - The priority of the given supplier. The lower the value, the higher the priority of the supplier and the earlier it is in the List. If no specific priority is desired, this value should be ILcyLucyEnv.PRIORITY_DEFAULT.
      Throws:
      IllegalStateException - when calling this method after this format has been plugged in.
      NullPointerException - when the specified ALcyDomainObjectSupplier is null.
      See Also:
    • removeDomainObjectSupplier

      public boolean removeDomainObjectSupplier(ALcyDomainObjectSupplier aDomainObjectSupplier)
      Removes a domain object supplier. This operation should only be executed during initialization of add-ons, before any drawing layer is constructed.
      Parameters:
      aDomainObjectSupplier - The domain object supplier to remove.
      Returns:
      true if the domain object supplier was actually removed
    • getDomainObjectSupplierCount

      public int getDomainObjectSupplierCount()
      Returns the number of registered domain object suppliers.
      Returns:
      the number of registered domain object suppliers
    • getDomainObjectSupplier

      public ALcyDomainObjectSupplier getDomainObjectSupplier(int aIndex)
      Returns the ALcyDomainObjectSupplier at index aIndex.
      Parameters:
      aIndex - the index of the domain object supplier to be retrieved
      Returns:
      the ALcyDomainObjectSupplier at index aIndex
    • getDomainObjectSuppliers

      public List<ALcyDomainObjectSupplier> getDomainObjectSuppliers()
      Returns a list containing all the registered ALcyDomainObjectSupplier instances.
      Returns:
      a list containing all the registered ALcyDomainObjectSupplier instances.
    • getDomainObjectConverter

      public ALcyDomainObjectConverter getDomainObjectConverter()

      The default implementation returns a composite shape converter, which will automatically loop over all the shape converters of the registered domain object suppliers.

      See also TLcyCompositeDomainObjectConverter
      Returns:
      by default a composite domain object converter
    • getDomainObjectSupplierWithID

      public ALcyDomainObjectSupplier getDomainObjectSupplierWithID(String aDomainObjectID)
      Retrieve a domain object supplier by its unique ID.
      Parameters:
      aDomainObjectID - the unique ID of the shape support
      Returns:
      the ALcyDomainObjectSupplier with ID aDomainObjectID, or null when no such domain object supplier is registered to this class.
    • getProperties

      public ALcyProperties getProperties()

      Returns the ALcyProperties holding the configuration of this format.

      Returns:
      The ALcyProperties holding the configuration. Never null.
    • createFormatBarFactory

      protected ALcyFormatBarFactory createFormatBarFactory()

      Creates the ALcyFormatBarFactory that can create a bar to manipulate layers of this format.

      Normally you do not need to override this method. If you want to customize the contents of the format bars for drawing layers, it is easier to override the createGUIFactory() method instead. Consult the class javadoc of the TLcyDrawingAddOn for more information.

      Overrides:
      createFormatBarFactory in class ALcyFormatWrapper
      Returns:
      An ALcyFormatBarFactory. May be null.
      See Also:
    • createGUIFactory

      protected ALcyGUIFactory<Component> createGUIFactory()
      Creates the factory that creates the content for the ALcyFormatBar. A TLcyDrawingToolBarFactory can for example be returned, to create the default drawing tool bar.
      Returns:
      the factory that creates the content for the ALcyFormatBar.