Class JPanelColorChannels

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class JPanelColorChannels extends JPanel
A panel containing checkboxes which allow the user to indicate which channels of a color image should be processed.
Author:
mccreedy
See Also:
  • Field Details

    • serialVersionUID

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

      private JCheckBox blueCheckbox
      DOCUMENT ME!
    • greenCheckbox

      private JCheckBox greenCheckbox
      DOCUMENT ME!
    • redCheckbox

      private JCheckBox redCheckbox
      DOCUMENT ME!
    • srcImage

      private ModelImage srcImage
      DOCUMENT ME!
  • Constructor Details

    • JPanelColorChannels

      public JPanelColorChannels(ModelImage img)
      Construct the panel, with all of the channels marked to be processed by default.
      Parameters:
      img - the algorithm's input image
    • JPanelColorChannels

      public JPanelColorChannels(ModelImage img, boolean processRed, boolean processGreen, boolean processBlue)
      Construct the panel.
      Parameters:
      img - the algorithm's input image
      processRed - whether to enable processing of the red channel by default
      processGreen - whether to enable processing of the green channel by default
      processBlue - whether to enable processing of the blue channel by default
  • Method Details

    • addChannelCheckboxListener

      public void addChannelCheckboxListener(ItemListener listener)
      Add an ItemListener to all of the color channel checkboxes.
      Parameters:
      listener - The class which wants to listen to item events generated by the checkboxes.
    • enableChannelSelection

      public void enableChannelSelection(boolean enableCheckboxes)
      Enables or disables the color channel check boxes.
      Parameters:
      enableCheckboxes - if true, enables the check boxes; disables them if false
    • isBlueProcessingRequested

      public boolean isBlueProcessingRequested()
      Returns whether the algorithm should process the input image's blue channel.
      Returns:
      true if the blue channel should be processed (and the image is color)
    • isGreenProcessingRequested

      public boolean isGreenProcessingRequested()
      Returns whether the algorithm should process the input image's green channel.
      Returns:
      true if the green channel should be processed (and the image is color)
    • isRedProcessingRequested

      public boolean isRedProcessingRequested()
      Returns whether the algorithm should process the input image's red channel.
      Returns:
      true if the red channel should be processed (and the image is color)
    • setBlueProcessingRequested

      public void setBlueProcessingRequested(boolean processChannel)
      Changes whether the blue channel of the input image should be processed.
      Parameters:
      processChannel - whether to process the blue channel
    • setGreenProcessingRequested

      public void setGreenProcessingRequested(boolean processChannel)
      Changes whether the green channel of the input image should be processed.
      Parameters:
      processChannel - whether to process the green channel
    • setRedProcessingRequested

      public void setRedProcessingRequested(boolean processChannel)
      Changes whether the red channel of the input image should be processed.
      Parameters:
      processChannel - whether to process the red channel
    • initGUI

      private void initGUI(boolean processRed, boolean processGreen, boolean processBlue)
      Initializes the panel's GUI.
      Parameters:
      processRed - whether to enable processing of the red channel by default
      processGreen - whether to enable processing of the green channel by default
      processBlue - whether to enable processing of the blue channel by default