Class PaletteSuitability


  • public class PaletteSuitability
    extends Object
    Contains the suitability information for a single palette with several colour schemes.
    Author:
    Cory Horner, Refractions Research Inc.
    • Field Detail

      • QUALITY_UNKNOWN

        public static final int QUALITY_UNKNOWN
        Suitability = UNKNOWN
        See Also:
        Constant Field Values
      • QUALITY_DOUBTFUL

        public static final int QUALITY_DOUBTFUL
        Suitability = DOUBTFUL
        See Also:
        Constant Field Values
      • VIEWER_COLORBLIND

        public static final int VIEWER_COLORBLIND
        ViewerType = Suitable for the colorblind?
        See Also:
        Constant Field Values
      • VIEWER_PHOTOCOPY

        public static final int VIEWER_PHOTOCOPY
        ViewerType = Suitable for photocopiers?
        See Also:
        Constant Field Values
      • VIEWER_PROJECTOR

        public static final int VIEWER_PROJECTOR
        ViewerType = Suitable for overhead projectors (lcd)?
        See Also:
        Constant Field Values
      • VIEWER_LCD

        public static final int VIEWER_LCD
        ViewerType = Suitable for LCD monitors?
        See Also:
        Constant Field Values
      • VIEWER_CRT

        public static final int VIEWER_CRT
        ViewerType = Suitable for CRT monitors?
        See Also:
        Constant Field Values
      • VIEWER_PRINT

        public static final int VIEWER_PRINT
        ViewerType = Suitable for colour printing?
        See Also:
        Constant Field Values
    • Constructor Detail

      • PaletteSuitability

        public PaletteSuitability()
    • Method Detail

      • getSuitability

        public int[] getSuitability​(int numClasses)
        Indexed getter for property paletteSuitability. For this palette, this returns an array containing the integer values for all 6 suitabilities.
        Parameters:
        numClasses - The number of colors to determine the suitability for
        Returns:
        int array; index = PaletteSuitability.VIEWER_COLORBLIND, VIEWER_PHOTOCOPY, VIEWER_PROJECTOR, VIEWER_LCD, VIEWER_CRT, or VIEWER_PRINT; values = PaletteSuitability.QUALITY_GOOD, QUALITY_UNKNOWN, QUALITY_DOUBTFUL, or QUALITY_BAD.
      • getSuitability

        public int getSuitability​(int numClasses,
                                  int viewerType)
        Indexed getter for the property paletteSuitability. For the selected palette and viewerType, this returns the integer value of the
        Parameters:
        numClasses - number of colours in this palette
        viewerType - PaletteSuitability.VIEWER_COLORBLIND, VIEWER_PHOTOCOPY, VIEWER_PROJECTOR, VIEWER_LCD, VIEWER_CRT, or VIEWER_PRINT.
        Returns:
        PaletteSuitability.QUALITY_GOOD, QUALITY_UNKNOWN, QUALITY_DOUBTFUL, or QUALITY_BAD.
      • setSuitability

        public void setSuitability​(int numClasses,
                                   String[] suitability)
                            throws IOException
        Parameters:
        numClasses - Index of the property.
        suitability - New value of the property atindex.
        Throws:
        IOException
      • getMaxColors

        public int getMaxColors()