net.sourceforge.jiu.gui.awt.dialogs
Class HueSaturationValueDialog
Dialog
net.sourceforge.jiu.gui.awt.dialogs.HueSaturationValueDialog
- ActionListener, ItemListener, KeyListener
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.
cancel
private Button cancel
colorPanel
private Panel colorPanel
pressedOk
private boolean pressedOk
saturation
private TextField saturation
setHue
private Checkbox setHue
value
private TextField value
HueSaturationValueDialog
public HueSaturationValueDialog(Frame owner,
Strings strings,
boolean initialSetHue,
int h,
int s,
int v)
owner
- the Frame this dialog will belong to
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).
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.
textField
- the text component that is supposed to hold an int value
- int representation of the text component's data
hasPressedOk
public boolean hasPressedOk()
isHueSet
public boolean isHueSet()
itemStateChanged
public void itemStateChanged(ItemEvent e)
keyPressed
public void keyPressed(KeyEvent e)
keyReleased
public void keyReleased(KeyEvent e)
keyTyped
public void keyTyped(KeyEvent e)
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.