Class TLcyLspDrawingFormat


public class TLcyLspDrawingFormat extends ALcyLspFormatWrapper

ALcyLspFormat for the TLcyLspDrawingAddOn. It is responsible for the creation of all Lightspeed layer related functionality of the drawing add-on:

  • The layer factory and layer workspace support.
  • The ALcyLspDomainObjectSupplier instances, which are the Lightspeed equivalent of the ALcyDomainObjectSuppliers.
  • The ALcyFormatBarFactory which typically contains actions to create new shapes, to change the style, ... (see TLcyLspDrawingFormatBarFactory).

This class keeps track of all the ALcyLspDomainObjectSupplier instances registered to the add-on. Adding or removing a certain ALcyLspDomainObjectSupplier instance is done through the methods addLspDomainObjectSupplier and removeLspDomainObjectSupplier. If you add an extra ALcyLspDomainObjectSupplier, make sure to add the matching ALcyDomainObjectSupplier to the TLcyDrawingFormat of the TLcyDrawingAddOn as well.

The layer factory creates ILspLayer instances that are rendered with maximum quality. This might have a performance impact.

Since:
2012.1
  • Field Details

  • Constructor Details

  • Method Details

    • getDrawingFormat

      public final TLcyDrawingFormat getDrawingFormat()

      Returns the associated TLcyDrawingFormat.

      Returns:
      the associated TLcyDrawingFormat. Never null
    • getLspDomainObjectSuppliers

      public List<ALcyLspDomainObjectSupplier> getLspDomainObjectSuppliers()

      Returns an unmodifiable List of all the ALcyLspDomainObjectSupplier instances of this format. The order of the suppliers in the list is determined by their priority.

      Returns:
      The Collection of all the associated ALcyLspDomainObjectSupplier instances. Is never null and does not contain any null-references. It is an unmodifiable List. The order of the suppliers in the list is determined by their priority.
    • addLspDomainObjectSupplier

      public void addLspDomainObjectSupplier(ALcyLspDomainObjectSupplier aLspDomainObjectSupplier)
      Shortcut for addLspDomainObjectSupplier(aLspDomainObjectSupplier, ILcyLucyEnv.PRIORITY_DEFAULT)
      Parameters:
      aLspDomainObjectSupplier - The domain object supplier to add. Must not be null
      See Also:
    • addLspDomainObjectSupplier

      public void addLspDomainObjectSupplier(ALcyLspDomainObjectSupplier aLspDomainObjectSupplier, int aPriority)

      Adds the specified ALcyLspDomainObjectSupplier to the List of instances that are used to visualize and edit the domain objects in the Lightspeed view. Its position in that 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.

      Parameters:
      aLspDomainObjectSupplier - The ALcyLspDomainObjectSupplier instance to add. Must not be null.
      aPriority - The priority of the given ALcyLspDomainObjectSupplier. Lower values mean higher priorities. This priority defines the order of the supplier in the List of suppliers. If no specific priority is desired, this value should be ILcyLucyEnv.PRIORITY_DEFAULT.
      See Also:
    • removeLspDomainObjectSupplier

      public void removeLspDomainObjectSupplier(ALcyLspDomainObjectSupplier aLspDomainObjectSupplier)

      Removes the specified ALcyLspDomainObjectSupplier from the collection of instances that are used to visualize and edit the domain objects in the Lightspeed view

      Parameters:
      aLspDomainObjectSupplier - The ALcyLspDomainObjectSupplier to remove. If this supplier was not in the list of suppliers, no action is taken.
    • createLspDomainObjectSupplier

      protected ALcyLspDomainObjectSupplier createLspDomainObjectSupplier(ALcyDomainObjectSupplier aDomainObjectSupplier)

      Creates the ALcyLspDomainObjectSupplier for the specified ALcyDomainObjectSupplier. The created ALcyLspDomainObjectSupplier must be able to visualize and edit the same domain objects as the given ALcyDomainObjectSupplier. If the given ALcyDomainObjectSupplier supports extruded shapes, the ALcyLspDomainObjectSupplier created by this method must also support these extruded shapes.

      The default implementation will create a TLcyLspSLDDomainObjectSupplier when aDomainObjectSupplier is a TLcySLDDomainObjectSupplier. Similar as in GXY, the TLcyLspSLDDomainObjectSupplier consists of a geometry part (the ALcyLspShapeSupplier created in createLspShapeSupplier) and a part responsible for the styling (the TLcyLspSLDDomainObjectSupplier). In case you only want to modify the geometry part, it is recommended to override the createLspShapeSupplier method instead of this method.

      Parameters:
      aDomainObjectSupplier - The ALcyDomainObjectSupplier for which to create the Lightspeed counterpart. Never null
      Returns:
      The ALcyLspDomainObjectSupplier corresponding to the given ALcyDomainObjectSupplier. May be null if no Lightspeed support is desired for the given supplier.
      See Also:
    • createLspShapeSupplier

      protected ALcyLspShapeSupplier createLspShapeSupplier(TLcySLDDomainObjectSupplier aDomainObjectSupplier)
      Creates the ALcyLspShapeSupplier for the specified TLcySLDDomainObjectSupplier.
      Parameters:
      aDomainObjectSupplier - The TLcySLDDomainObjectSupplier for which a Lightspeed shape supplier must be created. Will never be null
      Returns:
      The created ALcyLspShapeSupplier. May be null if no Lightspeed support is desired for the given supplier.
      See Also:
    • createLayerFactory

      public ILspLayerFactory createLayerFactory()

      Creates the layer factory for this format. The default implementation returns null.

      This implementations returns the instance created by the decorated format.

      It is the responsibility of this layer factory to create an ILspEditor, ILspShapeDiscretizer and ILspStyler using the available instances created in the available ALcyLspDomainObjectSupplier instances.

      Overrides:
      createLayerFactory in class ALcyLspFormatWrapper
      Returns:
      The ILspLayerFactory for this format. May be null
      See Also:
    • 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 TLcyLspDrawingAddOn for more information.

      Overrides:
      createFormatBarFactory in class ALcyLspFormatWrapper
      Returns:
      An ALcyFormatBarFactory. May be null.
    • createGUIFactory

      protected ALcyGUIFactory<Component> createGUIFactory()
      Creates the factory that creates the content for the ALcyFormatBar. A TLcyLspDrawingToolBarFactory can for example be returned, to create the default drawing tool bar.
      Returns:
      the factory that creates the content for the ALcyFormatBar, or null when no format bar is needed.