Class ALcyLspFormatAddOn

Direct Known Subclasses:
TLcyLsp3DTilesB3DMFormatAddOn, TLcyLsp3DTilesPNTSFormatAddOn, TLcyLspAIXM51FormatAddOn, TLcyLspAIXMFormatAddOn, TLcyLspAPP6AAddOn, TLcyLspArcInfoASCIIGridFormatAddOn, TLcyLspARINCFormatAddOn, TLcyLspASDIFormatAddOn, TLcyLspASTERIXFormatAddOn, TLcyLspBCIFormatAddOn, TLcyLspBILFormatAddOn, TLcyLspBingMapsFormatAddOn, TLcyLspBUFRFormatAddOn, TLcyLspCADRGFormatAddOn, TLcyLspCSVFormatAddOn, TLcyLspDAFIFFormatAddOn, TLcyLspDEMFormatAddOn, TLcyLspDIMAPFormatAddOn, TLcyLspDMEDFormatAddOn, TLcyLspDrawingAddOn, TLcyLspDTEDFormatAddOn, TLcyLspE57FormatAddOn, TLcyLspEarthFormatAddOn, TLcyLspECRGFormatAddOn, TLcyLspECWFormatAddOn, TLcyLspETOPOFormatAddOn, TLcyLspFusionRasterFormatAddOn, TLcyLspFusionVectorFormatAddOn, TLcyLspGDALFormatAddOn, TLcyLspGEERasterFormatAddOn, TLcyLspGeoJsonFormatAddOn, TLcyLspGeoPackageFormatAddOn, TLcyLspGeorefGridAddOn, TLcyLspGeospatialPDFFormatAddOn, TLcyLspGeoSPOTFormatAddOn, TLcyLspGeoTIFFFormatAddOn, TLcyLspGMLFormatAddOn, TLcyLspGRIBFormatAddOn, TLcyLspGridAddOn, TLcyLspIFCFormatAddOn, TLcyLspJAIFormatAddOn, TLcyLspJPEG2000FormatAddOn, TLcyLspJPIPFormatAddOn, TLcyLspKML22FormatAddOn, TLcyLspLASFormatAddOn, TLcyLspLOSAddOn, TLcyLspMagneticNorthAddOn, TLcyLspMBTilesFormatAddOn, TLcyLspMGCPFormatAddOn, TLcyLspMGRSGridAddOn, TLcyLspMIFFormatAddOn, TLcyLspMrSidFormatAddOn, TLcyLspMS2525bAddOn, TLcyLspMSSQLFormatAddOn, TLcyLspNetCDFFormatAddOn, TLcyLspNITFFormatAddOn, TLcyLspNVGFormatAddOn, TLcyLspOBJFormatAddOn, TLcyLspOpenFlightFormatAddOn, TLcyLspOracleGeoRasterFormatAddOn, TLcyLspOracleLocatorFormatAddOn, TLcyLspOSGBFormatAddOn, TLcyLspPointCloudFormatAddOn, TLcyLspPOLFormatAddOn, TLcyLspPostGISFormatAddOn, TLcyLspRSTFormatAddOn, TLcyLspS57FormatAddOn, TLcyLspShapeVisibilityFormatAddOn, TLcyLspSHPFormatAddOn, TLcyLspSpatiaLiteFormatAddOn, TLcyLspSwissDHMMatrixFormatAddOn, TLcyLspUSRPFormatAddOn, TLcyLspVPFFormatAddOn, TLcyLspWCSClientAddOn, TLcyLspWFSClientAddOn, TLcyLspWMSClientAddOn, TLcyLspWMSClientGetFeatureInfoAddOn, TLcyLspWMTSClientAddOn, TLcyLspWMTSClientGetFeatureInfoAddOn, TLcyLspXYGridAddOn

public abstract class ALcyLspFormatAddOn extends ALcyPreferencesAddOn

Extension of ALcyPreferencesAddOn that is also equipped with an ALcyLspFormat. The format is created by createBaseFormat(), then wrapped with createFormatWrapper(com.luciad.lucy.format.lightspeed.ALcyLspFormat) and eventually plugged into ILcyLucyEnv using a TLcyLspFormatTool created in createFormatTool.

Since:
2012.0
  • Constructor Details

    • ALcyLspFormatAddOn

      protected ALcyLspFormatAddOn(String aLongPrefix, String aShortPrefix)
      Creates a new ALcyLspFormatAddOn
      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

    • plugInto

      public void plugInto(ILcyLucyEnv aLucyEnv)
      Creates and plugs in the add-on's format and preferences tool.
      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 and preferences tool.
      Overrides:
      unplugFrom in class ALcyPreferencesAddOn
      Parameters:
      aLucyEnv - the Lucy environment
      See Also:
    • getFormat

      public ALcyLspFormat getFormat()

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

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

      protected abstract ALcyLspFormat 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 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;
               }
             }
           }
         }
       }
       
      Returns:
      a new format for this add-on
    • createFormatWrapper

      protected abstract ALcyLspFormat createFormatWrapper(ALcyLspFormat aBaseFormat)

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

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

      protected TLcyLspFormatTool createFormatTool(ALcyLspFormat aFormat)

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

      Generally it is not needed to override this method. A possible use case is when you want to plug in certain services with a different priority.

      Parameters:
      aFormat - the format for which to create a tool
      Returns:
      the created TLcyLspFormatTool