Class JPanelPixelExclusionSelector

All Implemented Interfaces:
ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible

public class JPanelPixelExclusionSelector extends JPanel implements ActionListener
A dialog to permits choosing a range (positive or negative, and floating-point) of values with the intention of the selection indicating a range of values. Includes "Between" cut-off value ranges. It is coded to display the ranges as values for exclusion, but minor rewriting this class to allow operation specific titles.
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Use serialVersionUID for interoperability.
      See Also:
    • boundA

      private JTextField boundA
      The lower bound of the exclusion
    • boundB

      private JTextField boundB
      The upper bound of the exclusion
    • boundLR

      private JTextField boundLR
      The lower red bound of the exclusion
    • boundUR

      private JTextField boundUR
      The upper red bound of the exclusion
    • boundLG

      private JTextField boundLG
      The lower green bound of the exclusion
    • boundUG

      private JTextField boundUG
      The upper green bound of the exclusion
    • boundLB

      private JTextField boundLB
      The lower blue bound of the exclusion
    • boundUB

      private JTextField boundUB
      The upper blue bound of the exclusion
    • excludeSelection

      private final JComboBox excludeSelection
      Lists available exclusion types
    • lowerLimit

      private Float lowerLimit
      The lower limit of the exclusion
    • lowerLimitR

      private Float lowerLimitR
    • lowerLimitG

      private Float lowerLimitG
    • lowerLimitB

      private Float lowerLimitB
    • permitExclusion

      private final JCheckBox permitExclusion
      Whether pixels will be excluded from a calculation based on intensity values
    • upperLimit

      private Float upperLimit
      held for switching between states of the exclusion.
    • upperLimitR

      private Float upperLimitR
    • upperLimitG

      private Float upperLimitG
    • upperLimitB

      private Float upperLimitB
    • rangeFlag

      The range type that this pixel exclusion selector covers.
    • checkBoxPanel

      private final JPanelStatisticsList checkBoxPanel
      A reference to the JDialogVOIStatistic or JDialogVOIStats check box panel.
    • doColor

      private final boolean doColor
  • Constructor Details

    • JPanelPixelExclusionSelector

      public JPanelPixelExclusionSelector(JPanelStatisticsList checkBoxPanel, boolean doColor)
      Creates an exclusion panel which has a checkbox to make the range controls available, a selector to choose the range controls ("Between", "Above" and "Below"), and the range inputs for these controls.
  • Method Details

    • actionPerformed

      public void actionPerformed(ActionEvent e)
      When state changes in some elements of the panel, the panel must make display changes; these changes are registered here. When state the state of the checkbox changes (from checked to un- or vice-versa), the excluded selection's state is changed and the Exclusion range property is reset.

      Checks state of:

      • Enables or disables the exclusion drop-down and the text boxes based on the state of the checkbox
      • Changes the visibility of the text-boxes based on the state of the exclusion dropdown; "Between" displays both text boxes, "Above" only displays the lower cutoff box, and "Below" displays only the upper cutoff box.
      Specified by:
      actionPerformed in interface ActionListener
      Parameters:
      e - the ChangeEvent to watch.
    • getLowerBound

      public Float getLowerBound()
      Returns the lower bound text as a number. May be too negative for some applications.

      There is a side-effect in that when the permitExclusion checkbox is unchecked, the lower bound returned is null. This means that relying on the upperbound also means relying on the text fields being editable as well.

      Returns:
      lower bound text as a Float; null is returned if the panel is not set to be used or one of the text entries is empty or not a number.
    • getLowerBoundR

      public Float getLowerBoundR()
      Returns the lower bound text as a number. May be too negative for some applications.

      There is a side-effect in that when the permitExclusion checkbox is unchecked, the lower bound returned is null. This means that relying on the upperbound also means relying on the text fields being editable as well.

      Returns:
      lower bound text as a Float; null is returned if the panel is not set to be used or one of the text entries is empty or not a number.
    • getLowerBoundG

      public Float getLowerBoundG()
      Returns the lower bound text as a number. May be too negative for some applications.

      There is a side-effect in that when the permitExclusion checkbox is unchecked, the lower bound returned is null. This means that relying on the upperbound also means relying on the text fields being editable as well.

      Returns:
      lower bound text as a Float; null is returned if the panel is not set to be used or one of the text entries is empty or not a number.
    • getLowerBoundB

      public Float getLowerBoundB()
      Returns the lower bound text as a number. May be too negative for some applications.

      There is a side-effect in that when the permitExclusion checkbox is unchecked, the lower bound returned is null. This means that relying on the upperbound also means relying on the text fields being editable as well.

      Returns:
      lower bound text as a Float; null is returned if the panel is not set to be used or one of the text entries is empty or not a number.
    • getRangeFlag

      Returns:
      the range type
    • getUpperBound

      public Float getUpperBound()
      Returns the upper bound text as a number. May be too positive for some applications.

      There is a side-effect in that when the permitExclusion checkbox is unchecked, the upper bound returned is null. This means that relying on the upperbound also means relying on the text fields being editable as well.

      Returns:
      upper bound text as a Float; null is returned if the panel is not set to be used or one of the text entries is empty or not a number.
    • getUpperBoundR

      public Float getUpperBoundR()
      Returns the upper bound text as a number. May be too positive for some applications.

      There is a side-effect in that when the permitExclusion checkbox is unchecked, the upper bound returned is null. This means that relying on the upperbound also means relying on the text fields being editable as well.

      Returns:
      upper bound text as a Float; null is returned if the panel is not set to be used or one of the text entries is empty or not a number.
    • getUpperBoundG

      public Float getUpperBoundG()
      Returns the upper bound text as a number. May be too positive for some applications.

      There is a side-effect in that when the permitExclusion checkbox is unchecked, the upper bound returned is null. This means that relying on the upperbound also means relying on the text fields being editable as well.

      Returns:
      upper bound text as a Float; null is returned if the panel is not set to be used or one of the text entries is empty or not a number.
    • getUpperBoundB

      public Float getUpperBoundB()
      Returns the upper bound text as a number. May be too positive for some applications.

      There is a side-effect in that when the permitExclusion checkbox is unchecked, the upper bound returned is null. This means that relying on the upperbound also means relying on the text fields being editable as well.

      Returns:
      upper bound text as a Float; null is returned if the panel is not set to be used or one of the text entries is empty or not a number.
    • selectRangeInput

      public void selectRangeInput()
      Sets the fields' value and accessability based on the state of the drop-down. "Above" will display an uneditable "max" value and the lesser of the two values, "Below" will display an uneditable "min" value and the larger of the two values and "Between" will display the largest possible values, if the fields have not been set, or will reset the fields to the stored values.
    • setLowerBound

      public void setLowerBound(String floatValue)
      Set the lower bound from the script dialog.
      Parameters:
      floatValue - lower bound string
    • setLowerBoundR

      public void setLowerBoundR(String floatValue)
      Set the lower red bound from the script dialog.
      Parameters:
      floatValue - lower red bound string
    • setLowerBoundG

      public void setLowerBoundG(String floatValue)
      Set the lower green bound from the script dialog.
      Parameters:
      floatValue - lower green bound string
    • setLowerBoundB

      public void setLowerBoundB(String floatValue)
      Set the lower blue bound from the script dialog.
      Parameters:
      floatValue - lower blue bound string
    • setUpperBound

      public void setUpperBound(String floatValue)
      Set the upper bound from the script dialog.
      Parameters:
      floatValue - Maximum value string
    • setUpperBoundR

      public void setUpperBoundR(String floatValue)
      Set the upper red bound from the script dialog.
      Parameters:
      floatValue - Maximum red value string
    • setUpperBoundG

      public void setUpperBoundG(String floatValue)
      Set the upper green bound from the script dialog.
      Parameters:
      floatValue - Maximum green value string
    • setUpperBoundB

      public void setUpperBoundB(String floatValue)
      Set the upper blue bound from the script dialog.
      Parameters:
      floatValue - Maximum blue value string
    • storeLimitValues

      protected void storeLimitValues()
      Tries to store the values held in the text areas to temporary storage. It only does so if there are valid (that is, numbers and that they are neither infinite nor at the maximum or minimum value.
      See Also: