Class HueSaturationValueDialog

java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
net.sourceforge.jiu.gui.awt.dialogs.HueSaturationValueDialog
All Implemented Interfaces:
ActionListener, ItemListener, KeyListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible

public class HueSaturationValueDialog extends Dialog implements ActionListener, ItemListener, KeyListener
A dialog to enter the parameters for an hue/saturation/value adjustment operation. Saturation and value are specified as percentage values between -100 and 100, where 0 means no change. Hue can be specified optionally (a Choice component must be checked so that the hue value will be used); it is a value between 0 and 359.
Since:
0.5.0
Author:
Marco Schmidt
See Also:
  • Field Details

    • ok

      private Button ok
    • cancel

      private Button cancel
    • colorPanel

      private Panel colorPanel
    • hue

      private TextField hue
    • saturation

      private TextField saturation
    • value

      private TextField value
    • setHue

      private Checkbox setHue
    • pressedOk

      private boolean pressedOk
  • Constructor Details

    • HueSaturationValueDialog

      public HueSaturationValueDialog(Frame owner, Strings strings, boolean initialSetHue, int h, int s, int v)
      Parameters:
      owner - the Frame this dialog will belong to
  • Method Details

    • actionPerformed

      public void actionPerformed(ActionEvent e)
      Hides (closes) this dialog if the OK button was source of the action event (e.g. if the button was pressed).
      Specified by:
      actionPerformed in interface ActionListener
    • getHue

      public int getHue()
    • getSaturation

      public int getSaturation()
    • getValue

      public int getValue()
    • getValue

      private int getValue(TextComponent textField)
      Attempts to convert the content of the argument text component to an int; if successful, returns that int, otherwise -1000 is returned.
      Parameters:
      textField - the text component that is supposed to hold an int value
      Returns:
      int representation of the text component's data
    • hasPressedOk

      public boolean hasPressedOk()
    • itemStateChanged

      public void itemStateChanged(ItemEvent e)
      Specified by:
      itemStateChanged in interface ItemListener
    • isHueSet

      public boolean isHueSet()
    • updateTextFields

      private void updateTextFields()
      Computes width and height of new image and updates the corresponding labels. The labels will either display width and height or a single dash if the data in the text fields is invalid.
    • keyPressed

      public void keyPressed(KeyEvent e)
      Specified by:
      keyPressed in interface KeyListener
    • keyReleased

      public void keyReleased(KeyEvent e)
      Specified by:
      keyReleased in interface KeyListener
    • keyTyped

      public void keyTyped(KeyEvent e)
      Specified by:
      keyTyped in interface KeyListener