net.sourceforge.jiu.gui.awt.dialogs

Class MapToArbitraryPaletteDialog

Implemented Interfaces:
ActionListener

public class MapToArbitraryPaletteDialog
extends Dialog
implements ActionListener

A dialog to enter the parameters for an operation to map an RGB truecolor image to any given palette.
Author:
Marco Schmidt
Since:
0.5.0
See Also:
ArbitraryPaletteQuantizer

Field Summary

private static int[]
DITHERING_STRING_CONSTANTS
private static int[]
ERROR_DIFFUSION_TYPES
static int
NUM_PALETTE_TYPES
static int
PALETTE_FILE
static int
PALETTE_PALM_16_COLORS
static int
PALETTE_PALM_16_GRAY
static int
PALETTE_PALM_256_COLORS
static int
PALETTE_PALM_4_GRAY
private static int[]
PALETTE_STRING_CONSTANTS
static int
PALETTE_WEBSAFE
private Button
cancel
private Checkbox[]
checkboxes
private Choice
dithering
private Button
ok
private CheckboxGroup
paletteType
private boolean
pressedOk

Constructor Summary

MapToArbitraryPaletteDialog(Frame owner, Strings strings)

Method Summary

void
actionPerformed(ActionEvent e)
Hides (closes) this dialog if the OK button was source of the action event (e.g.
int
getErrorDiffusionType()
If the use of error diffusion was selected, this method returns on of the ErrorDiffusionDithering TYPE constants
int
getPaletteType()
Return the palette type (one of the PALETTE_xyz constants of this class) that is currently selected in the dialog.
boolean
hasPressedOk()
Returns true if the OK button was pressed, false if it was the Cancel button.
boolean
useErrorDiffusion()
Returns whether the use of one of the error diffusion algorithms is selected in the dialog.

Field Details

DITHERING_STRING_CONSTANTS

private static final int[] DITHERING_STRING_CONSTANTS

ERROR_DIFFUSION_TYPES

private static final int[] ERROR_DIFFUSION_TYPES

NUM_PALETTE_TYPES

public static final int NUM_PALETTE_TYPES
Field Value:
6

PALETTE_FILE

public static final int PALETTE_FILE
Field Value:
0

PALETTE_PALM_16_COLORS

public static final int PALETTE_PALM_16_COLORS
Field Value:
3

PALETTE_PALM_16_GRAY

public static final int PALETTE_PALM_16_GRAY
Field Value:
4

PALETTE_PALM_256_COLORS

public static final int PALETTE_PALM_256_COLORS
Field Value:
2

PALETTE_PALM_4_GRAY

public static final int PALETTE_PALM_4_GRAY
Field Value:
5

PALETTE_STRING_CONSTANTS

private static final int[] PALETTE_STRING_CONSTANTS

PALETTE_WEBSAFE

public static final int PALETTE_WEBSAFE
Field Value:
1

cancel

private Button cancel

checkboxes

private Checkbox[] checkboxes

dithering

private Choice dithering

ok

private Button ok

paletteType

private CheckboxGroup paletteType

pressedOk

private boolean pressedOk

Constructor Details

MapToArbitraryPaletteDialog

public MapToArbitraryPaletteDialog(Frame owner,
                                   Strings strings)
Parameters:
owner - the Frame this dialog will belong to

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

getErrorDiffusionType

public int getErrorDiffusionType()
If the use of error diffusion was selected, this method returns on of the ErrorDiffusionDithering TYPE constants

getPaletteType

public int getPaletteType()
Return the palette type (one of the PALETTE_xyz constants of this class) that is currently selected in the dialog.

hasPressedOk

public boolean hasPressedOk()
Returns true if the OK button was pressed, false if it was the Cancel button.

useErrorDiffusion

public boolean useErrorDiffusion()
Returns whether the use of one of the error diffusion algorithms is selected in the dialog.