001    //$HeadURL: svn+ssh://jwilden@svn.wald.intevation.org/deegree/base/branches/2.5_testing/src/org/deegree/model/coverage/PaletteInterpretation.java $
002    /*----------------------------------------------------------------------------
003     This file originated as a part of GeoAPI.
004    
005     GeoAPI is free software. GeoAPI may be used, modified and
006     redistributed by anyone for any purpose requring only maintaining the
007     copyright and license terms on the source code and derivative files.
008     See the OGC legal page for details.
009    
010     The copyright to the GeoAPI interfaces is held by the Open Geospatial
011     Consortium, see http://www.opengeospatial.org/ogc/legal
012    ----------------------------------------------------------------------------*/
013    package org.deegree.model.coverage;
014    
015    /**
016     * Describes the color entry in a color table.
017     *
018     * @UML codelist CV_PaletteInterpretation
019     * @author <A HREF="http://www.opengis.org">OpenGIS&reg; consortium</A>
020     * @version <A HREF="http://www.opengis.org/docs/01-004.pdf">Grid Coverage specification 1.0</A>
021     *
022     * @see ColorInterpretation
023     * @see SampleDimension
024     */
025    public final class PaletteInterpretation extends CodeList {
026        /**
027         * Serial number for compatibility with different versions.
028         */
029        private static final long serialVersionUID = -7387623392932592485L;
030    
031        /**
032         * Gray Scale color palette.
033         *
034         * @UML conditional CV_Gray
035         * @see java.awt.color.ColorSpace#TYPE_GRAY
036         */
037        public static final PaletteInterpretation GRAY = new PaletteInterpretation( "GRAY", 0 );
038    
039        /**
040         * RGB (Red Green Blue) color palette.
041         *
042         * @UML conditional CV_RGB
043         * @see java.awt.color.ColorSpace#TYPE_RGB
044         */
045        public static final PaletteInterpretation RGB = new PaletteInterpretation( "RGB", 1 );
046    
047        /**
048         * CYMK (Cyan Yellow Magenta blacK) color palette.
049         *
050         * @UML conditional CV_CMYK
051         * @see java.awt.color.ColorSpace#TYPE_CMYK
052         */
053        public static final PaletteInterpretation CMYK = new PaletteInterpretation( "CMYK", 2 );
054    
055        /**
056         * HSL (Hue Saturation Lightness) color palette.
057         *
058         * @UML conditional CV_HLS
059         * @see java.awt.color.ColorSpace#TYPE_HLS
060         */
061        public static final PaletteInterpretation HLS = new PaletteInterpretation( "HLS", 3 );
062    
063        /**
064         * List of all enumerations of this type.
065         */
066        private static final PaletteInterpretation[] VALUES = new PaletteInterpretation[] { GRAY, RGB, CMYK, HLS };
067    
068        /**
069         * Constructs an enum with the given name.
070         */
071        private PaletteInterpretation( final String name, final int ordinal ) {
072            super( name, ordinal );
073        }
074    
075        /**
076         * Returns the list of <code>PaletteInterpretation</code>s.
077         *
078         * @return the list of <code>PaletteInterpretation</code>s.
079         */
080        public static PaletteInterpretation[] values() {
081            return VALUES.clone();
082        }
083    
084        /**
085         * Returns the list of enumerations of the same kind than this enum.
086         */
087        @Override
088        public CodeList[] family() {
089            return values();
090        }
091    }