net.sourceforge.jiu.gui.awt.dialogs

Class UniformPaletteQuantizerDialog

Implemented Interfaces:
ActionListener, AdjustmentListener, ItemListener

public class UniformPaletteQuantizerDialog
extends Dialog
implements ActionListener, AdjustmentListener, ItemListener

An AWT dialog to enter the parameters for a uniform palette color quantization operation.
Author:
Marco Schmidt

Field Summary

int[][]
DITHERING_METHODS
static int
TYPE_BURKES_ERROR_DIFFUSION
static int
TYPE_DITHERING_NONE
static int
TYPE_FLOYD_STEINBERG_ERROR_DIFFUSION
static int
TYPE_JARVIS_JUDICE_NINKE_ERROR_DIFFUSION
static int
TYPE_ORDERED_DITHERING
static int
TYPE_SIERRA_ERROR_DIFFUSION
static int
TYPE_STEVENSON_ARCE_ERROR_DIFFUSION
static int
TYPE_STUCKI_ERROR_DIFFUSION
private Label
blueLabel
private Scrollbar
blueScrollbar
private Button
cancel
private Choice
ditheringMethod
private Label
greenLabel
private Scrollbar
greenScrollbar
private Label
infoLabel1
private Label
infoLabel2
private Button
ok
private boolean
pressedOk
private Label
redLabel
private Scrollbar
redScrollbar
private Strings
strings

Constructor Summary

UniformPaletteQuantizerDialog(Frame owner, Strings strings, int redBits, int greenBits, int blueBits, int ditheringMethodSelection)
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
adjustmentValueChanged(AdjustmentEvent e)
void
center()
Centers the dialog on screen.
int
getBlueBits()
int
getDitheringMethod()
int
getGreenBits()
int
getRedBits()
boolean
hasPressedOk()
boolean
isSelectionValid()
void
itemStateChanged(ItemEvent e)
private void
updateLabels()

Field Details

DITHERING_METHODS

public final int[][] DITHERING_METHODS

TYPE_BURKES_ERROR_DIFFUSION

public static final int TYPE_BURKES_ERROR_DIFFUSION
Field Value:
4

TYPE_DITHERING_NONE

public static final int TYPE_DITHERING_NONE
Field Value:
0

TYPE_FLOYD_STEINBERG_ERROR_DIFFUSION

public static final int TYPE_FLOYD_STEINBERG_ERROR_DIFFUSION
Field Value:
2

TYPE_JARVIS_JUDICE_NINKE_ERROR_DIFFUSION

public static final int TYPE_JARVIS_JUDICE_NINKE_ERROR_DIFFUSION
Field Value:
6

TYPE_ORDERED_DITHERING

public static final int TYPE_ORDERED_DITHERING
Field Value:
1

TYPE_SIERRA_ERROR_DIFFUSION

public static final int TYPE_SIERRA_ERROR_DIFFUSION
Field Value:
5

TYPE_STEVENSON_ARCE_ERROR_DIFFUSION

public static final int TYPE_STEVENSON_ARCE_ERROR_DIFFUSION
Field Value:
7

TYPE_STUCKI_ERROR_DIFFUSION

public static final int TYPE_STUCKI_ERROR_DIFFUSION
Field Value:
3

blueLabel

private Label blueLabel

blueScrollbar

private Scrollbar blueScrollbar

cancel

private Button cancel

ditheringMethod

private Choice ditheringMethod

greenLabel

private Label greenLabel

greenScrollbar

private Scrollbar greenScrollbar

infoLabel1

private Label infoLabel1

infoLabel2

private Label infoLabel2

ok

private Button ok

pressedOk

private boolean pressedOk

redLabel

private Label redLabel

redScrollbar

private Scrollbar redScrollbar

strings

private Strings strings

Constructor Details

UniformPaletteQuantizerDialog

public UniformPaletteQuantizerDialog(Frame owner,
                                     Strings strings,
                                     int redBits,
                                     int greenBits,
                                     int blueBits,
                                     int ditheringMethodSelection)
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
redBits - the initial selection of the number of bits for the red channel
greenBits - the initial selection of the number of bits for the green channel
blueBits - the initial selection of the number of bits for the blue channel
ditheringMethodSelection - initial selection for dithering method

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

adjustmentValueChanged

public void adjustmentValueChanged(AdjustmentEvent e)

center

public void center()
Centers the dialog on screen.

getBlueBits

public int getBlueBits()

getDitheringMethod

public int getDitheringMethod()

getGreenBits

public int getGreenBits()

getRedBits

public int getRedBits()

hasPressedOk

public boolean hasPressedOk()

isSelectionValid

public boolean isSelectionValid()

itemStateChanged

public void itemStateChanged(ItemEvent e)

updateLabels

private void updateLabels()