Class TLcyExtremePointAddOn


public class TLcyExtremePointAddOn extends ALcyFormatAddOn
Add-on to calculate points with minumum and maximum elevation and visualize the results on a GXY map. It provides a terrain analysis back-end, format and GUI.

The back-end performs the actual calculation. It can be used independently of the used GUI.

The GUI's application pane is built by a ALcyApplicationPaneTool, using the add-on's GUI factory. By default, this GUI uses the composite workspace preferences of the add-on's preferences tool.

The add-on's functionality can be changed by extending the back-end, or by extending the GUI builder and tapping into the latter preferences object. See the TEA developer's guide for more information on using and extending TEA add-ons.

Note that this add-on depends on the LuciadLightspeed Terrain Analysis Engine component.

See Also:
  • Field Details

    • SHAPE_LIST_KEY

      public static final String SHAPE_LIST_KEY
      Property name for the shapes to calculate extreme points for. The associated property value is an array of String objects.
      See Also:
    • SELECTED_SHAPE_KEY

      public static final String SELECTED_SHAPE_KEY
      Property name for the currently selected shape to calculate extreme points from. The associated value is of type String, and denotes the ID that can be used to retrieve the shape's sub-properties. The sub-property suffixes are defined in TLcyExtremePointBackEnd.

      For example, the domain object for the shape "Shape23" can be found in the property named "TLcyExtremePointAddOn.layer.tea.list." + "Shape23" + "." + TLcyExtremePointBackEnd.DOMAIN_OBJECT_CONTEXT_KEY

    • EXTREME_POINT_MODE_KEY

      public static final String EXTREME_POINT_MODE_KEY
      Property name defining the kind of extreme points. Its associated value can be one of TLcdExtremePointFinder.Type.HIGHEST_POINTS or TLcdExtremePointFinder.Type.LOWEST_POINTS.
      See Also:
    • EXTREME_POINT_MODE_VALUE_DEFAULT

      public static final TLcdExtremePointFinder.Type EXTREME_POINT_MODE_VALUE_DEFAULT
      Default value for the EXTREME_POINT_MODE_KEY property.
    • EXTREME_POINT_COUNT_KEY

      public static final String EXTREME_POINT_COUNT_KEY
      Property name for the number of extreme points to calculate. Its associated value is of type int.
      See Also:
    • EXTREME_POINT_COUNT_VALUE_DEFAULT

      public static final int EXTREME_POINT_COUNT_VALUE_DEFAULT
      Default value for the EXTREME_POINT_COUNT_KEY property.
      See Also:
    • QUALITY_KEY

      public static final String QUALITY_KEY
      Quality property for calculations, expressed in meters per discretization step. The corresponding property value is of type double.
      See Also:
    • QUALITY_VALUE_DEFAULT

      public static final double QUALITY_VALUE_DEFAULT
      Default value for the QUALITY_KEY property.
      See Also:
    • QUALITY_ITEMS_KEY

      public static final String QUALITY_ITEMS_KEY
      Property name for predefined quality levels to choose from. The values are sorted by increasing accuracy.
      See Also:
    • QUALITY_ITEMS_VALUE_DEFAULT

      public static final double[] QUALITY_ITEMS_VALUE_DEFAULT
      Default value for the QUALITY_ITEMS_KEY property.
    • QUALITY_DESCRIPTIONS_KEY

      public static final String QUALITY_DESCRIPTIONS_KEY
      Property name for descriptions of the predefined quality levels to choose from.
      See Also:
    • QUALITY_DESCRIPTIONS_VALUE_DEFAULT

      public static final String[] QUALITY_DESCRIPTIONS_VALUE_DEFAULT
      Default value for the QUALITY_DESCRIPTIONS_KEY property.
    • SEPARATION_HEIGHT_KEY

      public static final String SEPARATION_HEIGHT_KEY
      Property name for the relative value difference which indicates how "distinct" the peaks should be from one another. The associated value is of type double and must be positive or Double.POSITIVE_INFINITY.
      See Also:
    • SEPARATION_HEIGHT_VALUE_DEFAULT

      public static final double SEPARATION_HEIGHT_VALUE_DEFAULT
      Default value for the SEPARATION_HEIGHT_KEY property.
      See Also:
    • SEPARATION_DISTANCE_KEY

      public static final String SEPARATION_DISTANCE_KEY
      Property name for the minimum distance between two peaks defined in meters. With this value a circle is defined around the peak in which no other peak can be found. The associated value is of type double and must be positive or Double.POSITIVE_INFINITY.
      See Also:
    • SEPARATION_DISTANCE_VALUE_DEFAULT

      public static final double SEPARATION_DISTANCE_VALUE_DEFAULT
      Default value for the SEPARATION_DISTANCE_KEY property.
      See Also:
    • LINKED_LAYER_KEY

      public static final String LINKED_LAYER_KEY
      The ILcdGXYLayer that is linked to the GUI panel. This value is automatically set when selecting a contour layer in the active map's layer panel. The corresponding property value is of type ILcdGXYLayer
      See Also:
    • LINKED_LAYER_VALUE_DEFAULT

      public static final ILcdGXYLayer LINKED_LAYER_VALUE_DEFAULT
      Default value for the LINKED_LAYER_VALUE_DEFAULT property.
    • AUTO_UPDATE_KEY

      public static final String AUTO_UPDATE_KEY
      Determines whether GUI changes should be automatically propagated to the layer and start a new contour calculation. The corresponding property value is a boolean.
      See Also:
    • AUTO_UPDATE_VALUE_DEFAULT

      public static final boolean AUTO_UPDATE_VALUE_DEFAULT
      Default value for the AUTO_UPDATE_KEY property.
      See Also:
  • Constructor Details

    • TLcyExtremePointAddOn

      public TLcyExtremePointAddOn()
      Default constructor for the extreme point add-on.
  • Method Details

    • plugInto

      public void plugInto(ILcyLucyEnv aLucyEnv)
      Builds a GUI, back-end and file format for extreme point calculations and plugs in the GUI and file format.
      Parameters:
      aLucyEnv - the Lucy instance to plug into
      See Also:
    • unplugFrom

      public void unplugFrom(ILcyLucyEnv aLucyEnv)
      Unplugs the add-on's format, preferences tool and application pane tool.
      Parameters:
      aLucyEnv - the Lucy environment
      See Also:
    • createExtremePointBackEnd

      protected TLcyExtremePointBackEnd createExtremePointBackEnd()
      Returns a new back-end for extreme point calculations. Override this method to extend the default back-end with new functionality.
      Returns:
      a new back-end for extreme point calculations
    • getExtremePointBackEnd

      public TLcyExtremePointBackEnd getExtremePointBackEnd()
      The back-end that the GUI can use to calculate extreme points.

      Override createExtremePointBackEnd() to extend the back-end.

      Returns:
      a TLcyExtremePointBackEnd object for performing extreme point calculations
      See Also:
    • createGUIFactory

      protected ALcyGUIFactory<Component> createGUIFactory()
      Returns a new GUI factory for this add-on. Override this method to extend the default GUI with new functionality.

      For example, this add-on could return a new instance of TLcyExtremePointGUIFactory

      Returns:
      a new GUI factory for this add-on
    • createBaseFormat

      protected 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;
               }
             }
           }
         }
       }
       

      Note that the created format is at least wrapped by a TLcySafeGuardFormatWrapper (or equivalent) before it is plugged in ILcyLucyEnv (using e.g. TLcyFormatTool). So it is safe to rely on the safety checks performed by that wrapper.

      A contour model contains a collection of ILcdPoint instances. See ALcyTEABackEnd.createModelDescriptor(com.luciad.lucy.util.properties.ALcyProperties) for the features offered by these objects.

      Returns:
      a new file format for this add-on
    • createFormatWrapper

      public final ALcyFormat createFormatWrapper(ALcyFormat aBaseFormat)
      Description copied from class: ALcyFormatAddOn

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

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

      protected ALcyApplicationPaneTool createApplicationPaneTool()
      Returns the add-on's application pane tool. Override this method to add to the default application pane tool's functionality.

      This add-on's application pane tool initializes the GUI factory with the add-on's composite workspace preferences. It also ensures that the panel is updated from the selected TEA layer's stored GUI properties.

      Returns:
      the add-on's application pane tool
      See Also:
    • getGUIFactory

      public ALcyGUIFactory<Component> getGUIFactory()
      Returns the GUI factory to create the add-on's application pane. See createGUIFactory() if you want to override or extend the add-on's factory.
      Returns:
      the add-on's GUI factory
    • getApplicationPaneTool

      public ALcyApplicationPaneTool getApplicationPaneTool()
      Returns the tool that creates the add-on's application pane. See createApplicationPaneTool() if you want to override or extend the add-on's application pane tool.
      Returns:
      the tool that creates the add-on's application pane
    • createPreferencesTool

      protected TLcyPreferencesTool createPreferencesTool()
      Creates the TLcyPreferencesTool to be used by this add-on. Overwriting this method for example allows to register additional ILcyPropertyConverters for (complex) custom properties, to make sure they are correctly decoded from the add-on's configuration file and/or saved to the workspace. Note that this isn't required for simple properties such as String, int, double, etc.
      Overrides:
      createPreferencesTool in class ALcyPreferencesAddOn
      Returns:
      the created TLcyPreferencesTool.