As mentioned in yesterday's meeting, i've been revising the ColorBrewer
class to make it a bit easier to use. It still lacks elegance, but it
gets the job done.
Initially the ColorBrewer object contained only the contents of a single
XML file. This was annoying as anyone wanting to display a complete
list of palettes would need to navigate several ColorBrewer objects.
Now you have the option of loading whatever palettes you like into a
ColorBrewer object (including external XML files as an InputStream), and
can easily filter down the list. As a result, the following change was
applied to the loading of a palette:
rather than:
colorBrewer.loadPalettes(ColorBrewer.SEQUENTIAL);
where ColorBrewer.SEQUENTIAL = "SEQUENTIAL"
we now use:
colorBrewer.loadPalettes(ColorBrewer.SEQUENTIAL);
where ColorBrewer.SEQUENTIAL = PaletteType(true, false, "SEQUENTIAL")
alternatively, you may continue using the old method by reverting to the
old string value:
colorBrewer.loadPalettes("SEQUENTIAL");
Please note this is deprecated and will soon be removed.
other constants:
ColorBrewer.ALL = all 3 legend types (sequential, diverging, qualtitative)
SUITABLE_RANGED = sequential + diverging + custom
SUITABLE_UNIQUE = qualitative + custom
SEQUENTIAL
DIVERGING
QUALITATIVE
The main benefit of "PaletteTypes" is that we can now filter our results
using these objects:
colorBrewer.getPalettes(ColorBrewer.SUITABLE_RANGED)
Filtering by suitability, etc (ex: 6 color schemes which are good for
LCD and projector displays) still to come...
We may want to add more data to our XML files so we don't have to
manually add the suitable for ranged value (numerical) and suitable for
uniques (strings) upon loading...
I've also made BrewerPalette a subclass of ColorPalette -- trying to
make the ColorPalette a more generic object, but this is yet unused.
Anyways, it's a work in progress... anyone have any input/concerns?
The next challenge on the plate: how do we translate XML files within
Geotools?
Cheers,
Cory.
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel