Class MapToArbitraryPaletteDialog

java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
net.sourceforge.jiu.gui.awt.dialogs.MapToArbitraryPaletteDialog
All Implemented Interfaces:
ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible

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

    • PALETTE_FILE

      public static final int PALETTE_FILE
      See Also:
    • PALETTE_WEBSAFE

      public static final int PALETTE_WEBSAFE
      See Also:
    • PALETTE_PALM_256_COLORS

      public static final int PALETTE_PALM_256_COLORS
      See Also:
    • PALETTE_PALM_16_COLORS

      public static final int PALETTE_PALM_16_COLORS
      See Also:
    • PALETTE_PALM_16_GRAY

      public static final int PALETTE_PALM_16_GRAY
      See Also:
    • PALETTE_PALM_4_GRAY

      public static final int PALETTE_PALM_4_GRAY
      See Also:
    • NUM_PALETTE_TYPES

      public static final int NUM_PALETTE_TYPES
      See Also:
    • PALETTE_STRING_CONSTANTS

      private static final int[] PALETTE_STRING_CONSTANTS
    • DITHERING_STRING_CONSTANTS

      private static final int[] DITHERING_STRING_CONSTANTS
    • ERROR_DIFFUSION_TYPES

      private static final int[] ERROR_DIFFUSION_TYPES
    • ok

      private Button ok
    • cancel

      private Button cancel
    • checkboxes

      private Checkbox[] checkboxes
    • paletteType

      private CheckboxGroup paletteType
    • dithering

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