public class ColorBrewer extends Object
Modifier and Type | Field and Description |
---|---|
static PaletteType |
ALL |
static PaletteType |
DIVERGING |
static PaletteType |
QUALITATIVE |
static PaletteType |
SEQUENTIAL |
static PaletteType |
SUITABLE_RANGED |
static PaletteType |
SUITABLE_UNIQUE |
Constructor and Description |
---|
ColorBrewer()
Creates a new instance of ColorBrewer
|
Modifier and Type | Method and Description |
---|---|
String |
getDescription() |
String |
getName() |
BrewerPalette |
getPalette(String name) |
String[] |
getPaletteNames()
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.
|
BrewerPalette[] |
getPalettes() |
BrewerPalette[] |
getPalettes(PaletteType type) |
BrewerPalette[] |
getPalettes(PaletteType type,
int numClasses) |
BrewerPalette[] |
getPalettes(PaletteType type,
int numClasses,
int requiredViewers) |
boolean |
hasPalette(String paletteName)
Returns true if the palette exists in this ColorBrewer
|
static ColorBrewer |
instance()
Creates a static instance of ColorBrewer containing all default palettes
|
static ColorBrewer |
instance(PaletteType type)
Creates a static instance of ColorBrewer containing a subset of the default palettes.
|
boolean |
isSet(int singleValue,
int multipleValue) |
void |
loadPalettes()
Loads the default ColorBrewer palettes.
|
void |
loadPalettes(InputStream XMLinput,
PaletteType type)
Loads into the ColorBrewer instance the set of palettes matching the given parameters.
|
void |
loadPalettes(PaletteType type)
Loads into the ColorBrewer instance the set of palettes which have the PaletteType matching
that of the parameter.
|
void |
registerPalette(BrewerPalette pal) |
void |
reset() |
public static final PaletteType ALL
public static final PaletteType SUITABLE_RANGED
public static final PaletteType SUITABLE_UNIQUE
public static final PaletteType SEQUENTIAL
public static final PaletteType DIVERGING
public static final PaletteType QUALITATIVE
public static ColorBrewer instance()
public static ColorBrewer instance(PaletteType type) throws IOException
type
- A PaletteType object which will be used to configure the returned ColorBrewer.IOException
public void registerPalette(BrewerPalette pal)
public boolean hasPalette(String paletteName)
paletteName
- A String with the name of the palettepublic BrewerPalette[] getPalettes()
public BrewerPalette[] getPalettes(PaletteType type)
public BrewerPalette[] getPalettes(PaletteType type, int numClasses)
public BrewerPalette[] getPalettes(PaletteType type, int numClasses, int requiredViewers)
public String[] getPaletteNames()
public String[] getPaletteNames(int minClasses, int maxClasses)
minClasses
- xmaxClasses
- ypublic BrewerPalette getPalette(String name)
public void loadPalettes()
public void loadPalettes(PaletteType type)
type
- The PaletteType for the palettes to load.public void loadPalettes(InputStream XMLinput, PaletteType type)
type
- identifier for palettes. use "new PaletteType();"public String getName()
public String getDescription()
public void reset()
public boolean isSet(int singleValue, int multipleValue)
Copyright © 1996–2023 Geotools. All rights reserved.