net.sourceforge.jiu.gui.awt.dialogs

Class GammaCorrectionDialog

Implemented Interfaces:
ActionListener, KeyListener

public class GammaCorrectionDialog
extends Dialog
implements ActionListener, KeyListener

A dialog to enter the parameters for a gamma correction operation.
Author:
Marco Schmidt

Field Summary

private double
MAX_GAMMA
private Button
cancel
private TextField
gammaTextField
private Button
ok
private boolean
pressedOk
private Double
result

Constructor Summary

GammaCorrectionDialog(Frame owner, Strings strings, double initialValue, double maxGamma)
Creates a GammaCorrectionDialog.

Method Summary

void
actionPerformed(ActionEvent e)
Hides (closes) this dialog if the OK button was source of the action event (e.g.
Double
getValue()
private Double
getValue(TextField tf)
void
handleKeys(KeyEvent e)
boolean
hasPressedOk()
void
keyPressed(KeyEvent e)
void
keyReleased(KeyEvent e)
void
keyTyped(KeyEvent e)

Field Details

MAX_GAMMA

private final double MAX_GAMMA

cancel

private Button cancel

gammaTextField

private TextField gammaTextField

ok

private Button ok

pressedOk

private boolean pressedOk

result

private Double result

Constructor Details

GammaCorrectionDialog

public GammaCorrectionDialog(Frame owner,
                             Strings strings,
                             double initialValue,
                             double maxGamma)
Creates a GammaCorrectionDialog.
Parameters:
owner - the Frame this dialog will belong to
strings - Strings resource used for text messages
initialValue - the value to be set when the dialog pops up
maxGamma - the maximum allowed gamma value

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).

getValue

public Double getValue()

getValue

private Double getValue(TextField tf)

handleKeys

public void handleKeys(KeyEvent e)

hasPressedOk

public boolean hasPressedOk()

keyPressed

public void keyPressed(KeyEvent e)

keyReleased

public void keyReleased(KeyEvent e)

keyTyped

public void keyTyped(KeyEvent e)