Class TLcyLspAPP6AAddOn


public class TLcyLspAPP6AAddOn extends ALcyLspFormatAddOn

This add-on registers the Lightspeed related functionality of the TLcyAPP6AAddOn. It creates a format which creates the necessary factories. This format can be modified by overriding the createBaseFormat() method.

As an ALcyFormatBarFactory is used for the UI to create new domain objects, this add-on requires the TLcyFormatBarAddOn (or equivalent) to show its tool bar for drawing new symbols. Without such add-on, that UI will never become visible to the end-user.

UI customization options

Besides the traditional customization options of an ALcyLspFormatAddOn, this add-on offers some extra customization options by exposing certain parts of the UI as sample code.

Adjusting the format bar

The format bar, which contains the UI elements to create new domain objects, is available as sample code. See the LspAPP6FormatBarFactory sample class. If you want to make modifications to our format bar, you can start from the source code of this class.

Plugging in the custom format bar factory is done by returning it from ALcyLspFormat.createFormatBarFactory():


   @Override
   protected ALcyLspFormat createBaseFormat(){
     return new ALcyLspFormatWrapper(super.createBaseFormat()){
       @Override
       protected ALcyFormatBarFactory createFormatBarFactory(){
         return new CustomLspAPP6FormatBarFactory();
       }
     }
   }
 

Adjusting the object properties panel

The object properties panel, which contains the UI to modify an existing domain object, is also available as sample code. However, the object properties panel is shared between GXY and Lightspeed as it has no view-specific dependency. Therefore it is provided by the TLcyAPP6AAddOn. Consult the class javadoc of that add-on for more information on how to customize it.

Since:
2013.1
  • Constructor Details

  • Method Details

    • plugInto

      public void plugInto(ILcyLucyEnv aLucyEnv)
      Description copied from class: ALcyLspFormatAddOn
      Creates and plugs in the add-on's format and preferences tool.
      Overrides:
      plugInto in class ALcyLspFormatAddOn
      Parameters:
      aLucyEnv - the Lucy environment to plug into
      See Also:
    • unplugFrom

      public void unplugFrom(ILcyLucyEnv aLucyEnv)
      Description copied from class: ALcyLspFormatAddOn
      Unplugs the add-on's format and preferences tool.
      Overrides:
      unplugFrom in class ALcyLspFormatAddOn
      Parameters:
      aLucyEnv - the Lucy environment
      See Also:
    • createBaseFormat

      protected ALcyLspFormat createBaseFormat()
      Description copied from class: ALcyLspFormatAddOn

      Returns a new data format for this add-on. Override this method to extend the default format with new functionality.

      For example, to alter the icon of the layers of this format, you can decorate the layer factory created in the format:

      
       @Override
       protected ALcyLspFormat createBaseFormat() {
         return new ALcyLspFormatWrapper(super.createBaseFormat()){
           @Override
           protected ILspLayerFactory createLayerFactory(){
             final ILspLayerFactory delegate = super.createLayerFactory();
             return new ILspLayerFactory(){
               @Override
               public boolean canCreateLayers(ILcdModel aModel){
                 return delegate.canCreateLayers(aModel);
               }
      
               @Override
               public Collection<ILspLayer> createLayers(ILcdModel aModel){
                 Collection<ILspLayer> layers = delegate.createLayers(aModel);
                 for(ILspLayer layer : layers){
                   ILcdIcon icon = ...;
                   layer.setIcon(icon)
                 }
                 return layers;
               }
             }
           }
         }
       }
       
      Specified by:
      createBaseFormat in class ALcyLspFormatAddOn
      Returns:
      a new format for this add-on
    • createFormatWrapper

      protected final ALcyLspFormat createFormatWrapper(ALcyLspFormat aBaseFormat)
      Description copied from class: ALcyLspFormatAddOn

      Returns a new data format wrapper for this add-on. A format wrapper extends the base format with aspects such as safe guarding, etc.

      Overriding this method of an existing add-on should be done with extreme care as add-ons typically rely on the wrappers that should be present (e.g. a safe guard).

      Specified by:
      createFormatWrapper in class ALcyLspFormatAddOn
      Parameters:
      aBaseFormat - the base format to wrap
      Returns:
      a new format for this add-on
      See Also: