Class ReduceGrayscaleDialog

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

public class ReduceGrayscaleDialog extends Dialog implements ActionListener, AdjustmentListener
A dialog to enter the parameters for a grayscale reduction operation.
Author:
Marco Schmidt
See Also:
  • Field Details

    • TYPE_DITHERING_NONE

      public static final int TYPE_DITHERING_NONE
      See Also:
    • TYPE_ORDERED_DITHERING

      public static final int TYPE_ORDERED_DITHERING
      See Also:
    • TYPE_FLOYD_STEINBERG_ERROR_DIFFUSION

      public static final int TYPE_FLOYD_STEINBERG_ERROR_DIFFUSION
      See Also:
    • TYPE_STUCKI_ERROR_DIFFUSION

      public static final int TYPE_STUCKI_ERROR_DIFFUSION
      See Also:
    • TYPE_BURKES_ERROR_DIFFUSION

      public static final int TYPE_BURKES_ERROR_DIFFUSION
      See Also:
    • TYPE_SIERRA_ERROR_DIFFUSION

      public static final int TYPE_SIERRA_ERROR_DIFFUSION
      See Also:
    • TYPE_JARVIS_JUDICE_NINKE_ERROR_DIFFUSION

      public static final int TYPE_JARVIS_JUDICE_NINKE_ERROR_DIFFUSION
      See Also:
    • TYPE_STEVENSON_ARCE_ERROR_DIFFUSION

      public static final int TYPE_STEVENSON_ARCE_ERROR_DIFFUSION
      See Also:
    • DITHERING_METHODS

      public final int[][] DITHERING_METHODS
    • strings

      private Strings strings
    • ok

      private Button ok
    • cancel

      private Button cancel
    • scrollbar

      private Scrollbar scrollbar
    • ditheringMethod

      private Choice ditheringMethod
    • bitLabel

      private Label bitLabel
    • shadesLabel

      private Label shadesLabel
    • pressedOk

      private boolean pressedOk
  • 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).
      Specified by:
      actionPerformed in interface ActionListener
    • adjustmentValueChanged

      public void adjustmentValueChanged(AdjustmentEvent e)
      Specified by:
      adjustmentValueChanged in interface AdjustmentListener
    • 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()