net.sourceforge.jiu.gui.awt.dialogs

Class ReduceGrayscaleDialog

Implemented Interfaces:
ActionListener, AdjustmentListener

public class ReduceGrayscaleDialog
extends Dialog
implements ActionListener, AdjustmentListener

A dialog to enter the parameters for a grayscale reduction 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
bitLabel
private Button
cancel
private Choice
ditheringMethod
private Button
ok
private boolean
pressedOk
private Scrollbar
scrollbar
private Label
shadesLabel
private Strings
strings

Constructor Summary

ReduceGrayscaleDialog(Frame owner, Strings strings, int bits, int maxBits, int ditheringMethodSelection)
Creates a modal dialog to enter the parameters.

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
getDitheringMethod()
int
getNumBits()
boolean
hasPressedOk()
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

bitLabel

private Label bitLabel

cancel

private Button cancel

ditheringMethod

private Choice ditheringMethod

ok

private Button ok

pressedOk

private boolean pressedOk

scrollbar

private Scrollbar scrollbar

shadesLabel

private Label shadesLabel

strings

private Strings strings

Constructor Details

ReduceGrayscaleDialog

public ReduceGrayscaleDialog(Frame owner,
                             Strings strings,
                             int bits,
                             int maxBits,
                             int ditheringMethodSelection)
Creates a modal dialog to enter the parameters.
Parameters:
owner - the parent of this modal dialog
strings - an object to get String constants in the current language
bits - initial number of bits to be shown in the dialog
maxBits - maximum allowed number of bits
ditheringMethodSelection - initial selection of 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.

getDitheringMethod

public int getDitheringMethod()

getNumBits

public int getNumBits()

hasPressedOk

public boolean hasPressedOk()

updateLabels

private void updateLabels()