net.sourceforge.jiu.gui.awt.dialogs
Class MedianCutDialog
Dialog
net.sourceforge.jiu.gui.awt.dialogs.MedianCutDialog
- ActionListener, ItemListener, KeyListener
public class MedianCutDialog
extends Dialog
implements ActionListener, ItemListener, KeyListener
A dialog to enter the parameters for a Median Cut color quantization operation.
It also allows to enter the optional algorithms that can be applied in combination with Median Cut.
MedianCutDialog(Frame owner, Strings strings, int numColors, int representativeColorMethod, boolean paletted, int numPasses, double initialTau) - Creates a modal dialog to enter the parameter.
|
ERROR_DIFFUSION_STRINGS
public final int[] ERROR_DIFFUSION_STRINGS
ERROR_DIFFUSION_TYPES
public final int[] ERROR_DIFFUSION_TYPES
METHODS
public final int[][] METHODS
algorithms
private Choice algorithms
cancel
private Button cancel
errorDiffusion
private Choice errorDiffusion
numColorsField
private TextField numColorsField
numPassesField
private TextField numPassesField
outputColorType
private Choice outputColorType
pressedOk
private boolean pressedOk
reprColorMethod
private Choice reprColorMethod
tauField
private TextField tauField
MedianCutDialog
public MedianCutDialog(Frame owner,
Strings strings,
int numColors,
int representativeColorMethod,
boolean paletted,
int numPasses,
double initialTau)
Creates a modal dialog to enter the parameter.
owner
- the parent of this modal dialogstrings
- an object to get String constants in the current languagenumColors
- the number of colors in the resulting imagerepresentativeColorMethod
- the method to determine the representative color from a set of colorspaletted
- if true, the output image will be paletted, otherwise truecolornumPasses
- number of contour removal iterationsinitialTau
- maximum distance for two colors to be considered similar in contour removal
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.
getDoubleValue
private double getDoubleValue(TextField textField)
getErrorDiffusion
public int getErrorDiffusion()
getIntValue
private int getIntValue(TextField textField)
getNumColors
public int getNumColors()
getNumPasses
public int getNumPasses()
getReprColorMethod
public int getReprColorMethod()
getTau
public double getTau()
hasPressedOk
public boolean hasPressedOk()
isOutputTypePaletted
public boolean isOutputTypePaletted()
itemStateChanged
public void itemStateChanged(ItemEvent event)
keyPressed
public void keyPressed(KeyEvent e)
keyReleased
public void keyReleased(KeyEvent e)
keyTyped
public void keyTyped(KeyEvent e)
updateOkButton
private void updateOkButton()
updateStates
private void updateStates()
useContourRemoval
public boolean useContourRemoval()
useErrorDiffusion
public boolean useErrorDiffusion()