net.sourceforge.jiu.gui.awt.dialogs

Class OctreeDialog

Implemented Interfaces:
ActionListener, KeyListener

public class OctreeDialog
extends Dialog
implements ActionListener, KeyListener

A dialog to enter the parameters for an Octree color quantization operation. It also allows to enter the optional algorithms that can be applied in combination with Octree.
Author:
Marco Schmidt
Since:
0.6.0
See Also:
MedianCutDialog

Field Summary

int[]
DITHERING_STRINGS
int[]
DITHERING_TYPES
private Button
cancel
private Choice
dithering
private TextField
numColorsField
private Button
ok
private Choice
outputColorType
private boolean
pressedOk

Constructor Summary

OctreeDialog(Frame owner, Strings strings, int numColors, boolean paletted)
Creates a modal dialog to enter the parameter.

Method Summary

void
actionPerformed(ActionEvent e)
Hides (closes) this dialog if the OK button was source of the action event (e.g.
void
center()
Centers the dialog on screen.
int
getErrorDiffusion()
private int
getIntValue(TextField textField)
int
getNumColors()
boolean
hasPressedOk()
boolean
isOutputTypePaletted()
void
keyPressed(KeyEvent e)
void
keyReleased(KeyEvent e)
void
keyTyped(KeyEvent e)
private void
updateOkButton()
boolean
useErrorDiffusion()
boolean
useNoDithering()

Field Details

DITHERING_STRINGS

public final int[] DITHERING_STRINGS

DITHERING_TYPES

public final int[] DITHERING_TYPES

cancel

private Button cancel

dithering

private Choice dithering

numColorsField

private TextField numColorsField

ok

private Button ok

outputColorType

private Choice outputColorType

pressedOk

private boolean pressedOk

Constructor Details

OctreeDialog

public OctreeDialog(Frame owner,
                    Strings strings,
                    int numColors,
                    boolean paletted)
Creates a modal dialog to enter the parameter.
Parameters:
owner - the parent of this modal dialog
strings - an object to get String constants in the current language
numColors - the number of colors in the resulting image
paletted - if true, the output image will be paletted, otherwise truecolor

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

center

public void center()
Centers the dialog on screen.

getErrorDiffusion

public int getErrorDiffusion()

getIntValue

private int getIntValue(TextField textField)

getNumColors

public int getNumColors()

hasPressedOk

public boolean hasPressedOk()

isOutputTypePaletted

public boolean isOutputTypePaletted()

keyPressed

public void keyPressed(KeyEvent e)

keyReleased

public void keyReleased(KeyEvent e)

keyTyped

public void keyTyped(KeyEvent e)

updateOkButton

private void updateOkButton()

useErrorDiffusion

public boolean useErrorDiffusion()

useNoDithering

public boolean useNoDithering()