org.geotools.brewer.color
Class ColorBrewer

java.lang.Object
  extended byorg.geotools.brewer.color.ColorBrewer

public class ColorBrewer
extends java.lang.Object

Contains ColorBrewer palettes and suitability data.

Author:
James Macgill, Cory Horner, Refractions Research Inc.

Field Summary
static PaletteType ALL
           
static PaletteType DIVERGING
           
static PaletteType QUALITATIVE
           
static PaletteType SEQUENTIAL
           
static PaletteType SUITABLE_RANGED
           
static PaletteType SUITABLE_UNIQUE
           
 
Constructor Summary
ColorBrewer()
          Creates a new instance of ColorBrewer
 
Method Summary
 java.lang.String getDescription()
           
 java.lang.String getLegendType()
          Deprecated. ColorBrewer no longer knows its legend type, palettes do.
 java.lang.String getName()
           
 BrewerPalette getPalette(java.lang.String name)
           
 java.lang.String[] getPaletteNames()
           
 java.lang.String[] getPaletteNames(int minClasses, int maxClasses)
          Generates an array of palette names for palettes which have at least x classes and at most y classes.
 BrewerPalette[] getPalettes()
           
 BrewerPalette[] getPalettes(PaletteType type)
           
 BrewerPalette[] getPalettes(PaletteType type, int numClasses)
           
 BrewerPalette[] getPalettes(PaletteType type, int numClasses, int requiredViewers)
           
 boolean hasPalette(java.lang.String paletteName)
          Returns true if the palette exists in this ColorBrewer
 boolean isSet(int singleValue, int multipleValue)
           
 void loadPalettes()
          Loads the default ColorBrewer palettes.
 void loadPalettes(java.io.InputStream XMLinput, PaletteType type)
           
 void loadPalettes(PaletteType type)
          Loads one set of ColorBrewer palettes.
 void loadPalettes(java.lang.String legendType)
          Deprecated. constants are now gone, use "SEQUENTIAL", "DIVERGING", or "QUALITATIVE" rather than ColorBrewer.SEQUENTIAL, DIVERGING, or QUALITATIVE
 void registerPalette(BrewerPalette pal)
           
 void reset()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALL

public static final PaletteType ALL

SUITABLE_RANGED

public static final PaletteType SUITABLE_RANGED

SUITABLE_UNIQUE

public static final PaletteType SUITABLE_UNIQUE

SEQUENTIAL

public static final PaletteType SEQUENTIAL

DIVERGING

public static final PaletteType DIVERGING

QUALITATIVE

public static final PaletteType QUALITATIVE
Constructor Detail

ColorBrewer

public ColorBrewer()
Creates a new instance of ColorBrewer

Method Detail

registerPalette

public void registerPalette(BrewerPalette pal)

getLegendType

public java.lang.String getLegendType()
Deprecated. ColorBrewer no longer knows its legend type, palettes do.

Returns the legend type of the colorBrewer

Returns:

hasPalette

public boolean hasPalette(java.lang.String paletteName)
Returns true if the palette exists in this ColorBrewer

Parameters:
paletteName -
Returns:

getPalettes

public BrewerPalette[] getPalettes()

getPalettes

public BrewerPalette[] getPalettes(PaletteType type)

getPalettes

public BrewerPalette[] getPalettes(PaletteType type,
                                   int numClasses)

getPalettes

public BrewerPalette[] getPalettes(PaletteType type,
                                   int numClasses,
                                   int requiredViewers)

getPaletteNames

public java.lang.String[] getPaletteNames()
Returns:

getPaletteNames

public java.lang.String[] getPaletteNames(int minClasses,
                                          int maxClasses)
Generates an array of palette names for palettes which have at least x classes and at most y classes.

Parameters:
minClasses - x
maxClasses - y
Returns:
filtered string array of palette names

getPalette

public BrewerPalette getPalette(java.lang.String name)

loadPalettes

public void loadPalettes()
                  throws java.io.IOException
Loads the default ColorBrewer palettes.

Throws:
java.io.IOException

loadPalettes

public void loadPalettes(PaletteType type)
                  throws java.io.IOException
Loads one set of ColorBrewer palettes.

Parameters:
type -
Throws:
java.io.IOException

loadPalettes

public void loadPalettes(java.io.InputStream XMLinput,
                         PaletteType type)
Parameters:
XMLinput -
type - identifier for palettes. use "new PaletteType();"

loadPalettes

public void loadPalettes(java.lang.String legendType)
Deprecated. constants are now gone, use "SEQUENTIAL", "DIVERGING", or "QUALITATIVE" rather than ColorBrewer.SEQUENTIAL, DIVERGING, or QUALITATIVE

Loads the appropriate set of palettes into the ColorBrewer

Parameters:
legendType - "SEQUENTIAL", "DIVERGING", or "QUALITATIVE"

getName

public java.lang.String getName()

getDescription

public java.lang.String getDescription()

reset

public void reset()

isSet

public boolean isSet(int singleValue,
                     int multipleValue)


Copyright © GeoTools. All Rights Reserved.