Class EnhancementChooser

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, TabComponent

public class EnhancementChooser extends JPanel implements TabComponent

An enhancement chooser is a panel that allows the user to select the specifications of a data enhancement function. An enhancement function is typically used in conjunction with a 2D data variable to normalize a set of data values to the range [0..1] for mapping to a colour palette.

The enhancement chooser signals a change in the enhancement function specifications by firing a PropertyChangeEvent whose property name is EnhancementChooser.FUNCTION_PROPERTY, and new value contains an object of type EnhancementFunction.

The chooser alsp uses the EnhancementChooser.SAVE_PROPERTY to signal that the preferences should be updated for the current variable using the active palette and function.

Since:
3.1.6
Author:
Peter Hollemans
See Also:
  • Field Details

  • Constructor Details

    • EnhancementChooser

      public EnhancementChooser()
      Creates a new enhancement chooser panel. If the system property debug is set to true, the enhancement chooser is setup with initial default properties to make testing more interesting.
    • EnhancementChooser

      public EnhancementChooser(EnhancementFunction func)
      Creates a new enhancement chooser panel with the specified function.
      Parameters:
      func - the function to initialize the panel.
  • Method Details

    • getRange

      public double[] getRange()
      Gets the allowed slider range.
      Returns:
      the slider range as [min, max].
    • getFunction

      public EnhancementFunction getFunction()
      Gets the current enhancement function.
      Returns:
      the function.
    • setFunction

      public void setFunction(EnhancementFunction newFunc)
      Sets the enhancement function.
      Parameters:
      newFunc - the enhancement function.
    • setStatistics

      public void setStatistics(Statistics stats)
      Sets the statistics for use in the histogram plot.
      Parameters:
      stats - the statistics, or null for no histogram display.
    • setPalette

      public void setPalette(Palette palette)
      Sets the palette for use in the palette stripe.
      Parameters:
      palette - the palette, or null for no palette display.
    • setRange

      public void setRange(double[] range)
      Sets the range for use in the enhancement sliders.
      Parameters:
      range - the slider range as either [min, max] or [max,min].
    • getValueIsAdjusting

      public boolean getValueIsAdjusting()
      Determines if the enhancement function is adjusting by checking to see if the range sliders are adjusting
      Returns:
      true if the range sliders are adjusting, or false if not.
    • getIcon

      public Icon getIcon()
      Description copied from interface: TabComponent
      Gets the tab icon.
      Specified by:
      getIcon in interface TabComponent
      Returns:
      the icon to be used if the tab is to have an icon beside the title label, or null if no icon is required.
    • getToolTip

      public String getToolTip()
      Description copied from interface: TabComponent
      Gets the tab tooltip.
      Specified by:
      getToolTip in interface TabComponent
      Returns:
      the tooltip text if the tab is to have an appearing tooltip when the mouse hovers over the tab, or null if no tooltip is required.
    • getTitle

      public String getTitle()
      Description copied from interface: TabComponent
      Gets the tab title.
      Specified by:
      getTitle in interface TabComponent
      Returns:
      the title to be used if the tab is to have a text label as a title, or null if no title is required.