Package org.geotools.brewer.color
Class ColorBrewer
Object
ColorBrewer
Contains ColorBrewer palettes and suitability data.
- Author:
- James Macgill, Cory Horner, Refractions Research Inc.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PaletteTypestatic final PaletteTypestatic final PaletteTypestatic final PaletteTypestatic final PaletteTypestatic final PaletteType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetName()getPalette(String name) String[]Generates a String array with the names of the palettes in the ColorBrewer instance.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.getPalettes(PaletteType type) getPalettes(PaletteType type, int numClasses) getPalettes(PaletteType type, int numClasses, int requiredViewers) booleanhasPalette(String paletteName) Returns true if the palette exists in this ColorBrewerstatic ColorBrewerinstance()Creates a static instance of ColorBrewer containing all default palettesstatic ColorBrewerinstance(PaletteType type) Creates a static instance of ColorBrewer containing a subset of the default palettes.booleanisSet(int singleValue, int multipleValue) voidLoads the default ColorBrewer palettes.voidloadPalettes(InputStream XMLinput, PaletteType type) Loads into the ColorBrewer instance the set of palettes matching the given parameters.voidloadPalettes(PaletteType type) Loads into the ColorBrewer instance the set of palettes which have the PaletteType matching that of the parameter.voidvoidreset()
-
Field Details
-
ALL
-
SUITABLE_RANGED
-
SUITABLE_UNIQUE
-
SEQUENTIAL
-
DIVERGING
-
QUALITATIVE
-
-
Constructor Details
-
ColorBrewer
public ColorBrewer()Creates a new instance of ColorBrewer
-
-
Method Details
-
instance
Creates a static instance of ColorBrewer containing all default palettes- Returns:
- The ColorBrewer instance with all the default palettes.
-
instance
Creates a static instance of ColorBrewer containing a subset of the default palettes.- Parameters:
type- A PaletteType object which will be used to configure the returned ColorBrewer.- Returns:
- The ColorBrewer instance with the palette from the parameter.
- Throws:
IOException
-
registerPalette
-
hasPalette
Returns true if the palette exists in this ColorBrewer- Parameters:
paletteName- A String with the name of the palette- Returns:
- A boolean, true if the ColorBrewer has a palette of the name given.
-
getPalettes
-
getPalettes
-
getPalettes
-
getPalettes
-
getPaletteNames
Generates a String array with the names of the palettes in the ColorBrewer instance.- Returns:
- A String array with the names of the palettes in the ColorBrewer instance.
-
getPaletteNames
Generates an array of palette names for palettes which have at least x classes and at most y classes.- Parameters:
minClasses- xmaxClasses- y- Returns:
- A string array of palette names filtered by number of classes.
-
getPalette
-
loadPalettes
public void loadPalettes()Loads the default ColorBrewer palettes. -
loadPalettes
Loads into the ColorBrewer instance the set of palettes which have the PaletteType matching that of the parameter.- Parameters:
type- The PaletteType for the palettes to load.
-
loadPalettes
Loads into the ColorBrewer instance the set of palettes matching the given parameters.- Parameters:
type- identifier for palettes. use "new PaletteType();"
-
getName
-
getDescription
-
reset
public void reset() -
isSet
public boolean isSet(int singleValue, int multipleValue)
-