Class ALcyFormatAddOn

Direct Known Subclasses:
com.luciad.internal.lucy.addons.app6a.ALinAPP6AAddOn, com.luciad.internal.lucy.addons.milstd2525b.ALinMS2525bAddOn, TLcyAIXM51AddOn, TLcyAIXMAddOn, TLcyArcInfoASCIIGridFormatAddOn, TLcyARINCAddOn, TLcyBingMapsAddOn, TLcyBUFRFormatAddOn, TLcyContourAddOn, TLcyCSVAddOn, TLcyDAFIFFormatAddOn, TLcyDrawingAddOn, TLcyE57AddOn, TLcyECRGFormatAddOn, TLcyExtremePointAddOn, TLcyFusionRasterFormatAddOn, TLcyFusionVectorFormatAddOn, TLcyGDALFormatAddOn, TLcyGEERasterFormatAddOn, TLcyGeoJsonAddOn, TLcyGeoPackageAddOn, TLcyGeospatialPDFAddOn, TLcyHypsometryAddon, TLcyIFCAddOn, TLcyJPIPDecoderAddOn, TLcyKML22AddOn, TLcyLASAddOn, TLcyLOSAddOn, TLcyLOSCoverageAddOn, TLcyLRDBAddOn, TLcyLVDBAddOn, TLcyMBTilesFormatAddOn, TLcyMGCPFormatAddOn, TLcyMSSQLDecoderAddOn, TLcyNetCDFFormatAddOn, TLcyNVGFormatAddOn, TLcyOBJDecoderAddOn, TLcyOGC3DTilesAddOn, TLcyOSGBAddOn, TLcyPointCloudAddOn, TLcyPostGISDecoderAddOn, TLcyS57DecoderAddOn, TLcyS63FormatAddOn, TLcyShapeVisibilityAddOn, TLcySpatiaLiteDecoderAddOn, TLcyViewshedAddOn, TLcyVisibilityAddOn, TLcyVPFFormatAddOn, TLcyWCSClientAddOn, TLcyWFSClientAddOn, TLcyWMSClientAddOn, TLcyWMSClientGetFeatureInfoAddOn, TLcyWMTSClientAddOn, TLcyWMTSClientGetFeatureInfoAddOn

public abstract class ALcyFormatAddOn extends ALcyPreferencesAddOn

Extension of ALcyPreferencesAddOn that is also equipped with an ALcyFormat. The format is created by createBaseFormat(), than wrapped with createFormatWrapper and eventually plugged into ILcyLucyEnv using a TLcyFormatTool created in createFormatTool.

  • Constructor Details

    • ALcyFormatAddOn

      protected ALcyFormatAddOn(String aLongPrefix, String aShortPrefix)
      Creates a new ALcyFormatAddOn. See the constructor of the super class for more information.
      Parameters:
      aLongPrefix - The long prefix. This prefix must be globally unique. It is stored in workspace files, so if backward compatibility is a concern (e.g. read an old workspace file), this prefix must never change.
      aShortPrefix - The short prefix, see also TLcyPreferencesTool. It might be stored in workspace files, so if backward compatibility is a concern (e.g. read an old workspace file), this prefix must never change.
  • Method Details

    • getFormat

      public ALcyFormat getFormat()

      Returns the ALcyFormat class that encapsulates this add-on's data format. See the createBaseFormat() method if you want to override or extend the data format. Note that the format instance returned here is different from the one created by createBaseFormat() as it is wrapped by createFormatWrapper(com.luciad.lucy.format.ALcyFormat).

      Returns:
      the add-on's data format
      See Also:
    • plugInto

      public void plugInto(ILcyLucyEnv aLucyEnv)

      Creates and plugs in the add-on's format.

      Overrides:
      plugInto in class ALcyPreferencesAddOn
      Parameters:
      aLucyEnv - the Lucy environment to plug into
      See Also:
    • unplugFrom

      public void unplugFrom(ILcyLucyEnv aLucyEnv)
      Unplugs the add-on's format.
      Overrides:
      unplugFrom in class ALcyPreferencesAddOn
      Parameters:
      aLucyEnv - the Lucy environment
      See Also:
    • createFormatTool

      protected TLcyFormatTool createFormatTool(ALcyFormat aFormat)

      Creates a new format tool for the given format. It is used to plug all parts of the format ( e.g. ILcdGXYLayerFactory, ILcdModelDecoder, etc.) into ILcyLucyEnv.

      Parameters:
      aFormat - the format for which to create a tool
      Returns:
      the created TLcyFormatTool
    • createBaseFormat

      protected abstract ALcyFormat createBaseFormat()

      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 ALcyFormat createBaseFormat() {
         return new ALcyFormatWrapper(super.createBaseFormat()){
           @Override
           protected ILcdGXYLayerFactory createGXYLayerFactory(){
             final ILcdGXYLayerFactory delegate = super.createGXYLayerFactory();
             return new ILcdGXYLayerFactory(){
               @Override
               public ILcdGXYLayer createGXYLayer(ILcdModel aModel){
                 ILcdGXYLayer layer = delegate.createGXYLayer(aModel);
                 if (layer != null){
                   ILcdIcon icon = ...;
                   layer.setIcon(icon);
                 }
                 return layer;
               }
             }
           }
         }
       }
       
      Returns:
      a new format for this add-on
    • createFormatWrapper

      protected abstract ALcyFormat createFormatWrapper(ALcyFormat aBaseFormat)

      Returns a new data format wrapper for this add-on. A format wrapper extends the base format with aspects such as asynchronous painting, mutable file behavior, 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).

      Parameters:
      aBaseFormat - the base format to wrap
      Returns:
      a new format for this add-on
      See Also: