Class MedianCutDialog

    • Field Detail

      • METHODS

        public final int[][] METHODS
      • ERROR_DIFFUSION_STRINGS

        public final int[] ERROR_DIFFUSION_STRINGS
      • ERROR_DIFFUSION_TYPES

        public final int[] ERROR_DIFFUSION_TYPES
      • cancel

        private Button cancel
      • numColorsField

        private TextField numColorsField
      • outputColorType

        private Choice outputColorType
      • reprColorMethod

        private Choice reprColorMethod
      • algorithms

        private Choice algorithms
      • errorDiffusion

        private Choice errorDiffusion
      • numPassesField

        private TextField numPassesField
      • pressedOk

        private boolean pressedOk
    • Constructor Detail

      • 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.
        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
        representativeColorMethod - the method to determine the representative color from a set of colors
        paletted - if true, the output image will be paletted, otherwise truecolor
        numPasses - number of contour removal iterations
        initialTau - maximum distance for two colors to be considered similar in contour removal
    • 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.
      • getErrorDiffusion

        public int getErrorDiffusion()
      • getDoubleValue

        private double getDoubleValue​(TextField textField)
      • 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()
      • updateOkButton

        private void updateOkButton()
      • updateStates

        private void updateStates()
      • useContourRemoval

        public boolean useContourRemoval()
      • useErrorDiffusion

        public boolean useErrorDiffusion()