Mercurial > dive4elements > gnv-client
diff gnv-artifacts/src/main/java/de/intevation/gnv/raster/PaletteManager.java @ 801:d766fe2d917a
More javadoc.
gnv-artifacts/trunk@883 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Tue, 06 Apr 2010 16:53:43 +0000 |
parents | 6cff63d0c434 |
children | f953c9a559d8 |
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/raster/PaletteManager.java Tue Apr 06 13:07:11 2010 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/raster/PaletteManager.java Tue Apr 06 16:53:43 2010 +0000 @@ -5,20 +5,45 @@ import java.util.HashMap; /** + * Manages palettes by their name. Provides different levels of + * subdivisions. * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a> */ public class PaletteManager { + /** + * The base palette. + */ protected Palette base; + /** + * The description of the palette. + */ protected String description; + + /** + * The name of the palette. + */ protected String name; + /** + * Already created subdivisions of the palette. + */ protected HashMap<Integer, SoftReference<Palette>> levels; + /** + * Default constructor. + */ public PaletteManager() { } + /** + * Constructor to create a palette manager with a given name, + * description and base palette. + * @param name The name. + * @param description The description. + * @param base The base palette. + */ public PaletteManager( String name, String description, @@ -30,18 +55,35 @@ levels = new HashMap<Integer, SoftReference<Palette>>(); } + /** + * Returns the description of the palette. + * @return The description. + */ public String getDescription() { return description; } + /** + * The name of the palette. + * @return The name. + */ public String getName() { return name; } + /** + * Returns the base palette. + * @return The base palette. + */ public Palette getBase() { return base; } + /** + * Returns the subdivided palette of a given level. + * @param n The level of subdivision. + * @return The subdivided palette. + */ public Palette getLevel(int n) { if (n < 2) { return base;