Class ReduceGrayscaleDialog

    • Field Detail

      • TYPE_FLOYD_STEINBERG_ERROR_DIFFUSION

        public static final int TYPE_FLOYD_STEINBERG_ERROR_DIFFUSION
        See Also:
        Constant Field Values
      • TYPE_STUCKI_ERROR_DIFFUSION

        public static final int TYPE_STUCKI_ERROR_DIFFUSION
        See Also:
        Constant Field Values
      • TYPE_BURKES_ERROR_DIFFUSION

        public static final int TYPE_BURKES_ERROR_DIFFUSION
        See Also:
        Constant Field Values
      • TYPE_SIERRA_ERROR_DIFFUSION

        public static final int TYPE_SIERRA_ERROR_DIFFUSION
        See Also:
        Constant Field Values
      • TYPE_JARVIS_JUDICE_NINKE_ERROR_DIFFUSION

        public static final int TYPE_JARVIS_JUDICE_NINKE_ERROR_DIFFUSION
        See Also:
        Constant Field Values
      • TYPE_STEVENSON_ARCE_ERROR_DIFFUSION

        public static final int TYPE_STEVENSON_ARCE_ERROR_DIFFUSION
        See Also:
        Constant Field Values
      • DITHERING_METHODS

        public final int[][] DITHERING_METHODS
      • cancel

        private Button cancel
      • ditheringMethod

        private Choice ditheringMethod
      • bitLabel

        private Label bitLabel
      • shadesLabel

        private Label shadesLabel
      • pressedOk

        private boolean pressedOk
    • Constructor Detail

      • 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 Detail

      • 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.
      • getDitheringMethod

        public int getDitheringMethod()
      • getNumBits

        public int getNumBits()
      • hasPressedOk

        public boolean hasPressedOk()
      • updateLabels

        private void updateLabels()