Class OctreeDialog

All Implemented Interfaces:
ActionListener, KeyListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible

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.
Since:
0.6.0
Author:
Marco Schmidt
See Also:
  • Field Details

    • DITHERING_STRINGS

      public final int[] DITHERING_STRINGS
    • DITHERING_TYPES

      public final int[] DITHERING_TYPES
    • ok

      private Button ok
    • cancel

      private Button cancel
    • numColorsField

      private TextField numColorsField
    • outputColorType

      private Choice outputColorType
    • dithering

      private Choice dithering
    • 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).
      Specified by:
      actionPerformed in interface ActionListener
    • 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)
      Specified by:
      keyPressed in interface KeyListener
    • keyReleased

      public void keyReleased(KeyEvent e)
      Specified by:
      keyReleased in interface KeyListener
    • keyTyped

      public void keyTyped(KeyEvent e)
      Specified by:
      keyTyped in interface KeyListener
    • updateOkButton

      private void updateOkButton()
    • useErrorDiffusion

      public boolean useErrorDiffusion()
    • useNoDithering

      public boolean useNoDithering()