public ColorMapBuilder reset(ColorMap original) { if (original == null) { return reset(); } type = original.getType(); extended = original.getExtendedColors(); entries = new ArrayList<ColorMapEntry>(Arrays.asList(original.getColorMapEntries())); unset = false; return this; }
public void visit(ColorMap colorMap) { // The type of the ColorMap is stored in an attribute "type" and may store // string-values: "ramp", "intervals" or "values". AttributesImpl atts = new AttributesImpl(); String typeString; if (colorMap.getType() == ColorMap.TYPE_INTERVALS) typeString = "intervals"; else if (colorMap.getType() == ColorMap.TYPE_VALUES) typeString = "values"; else typeString = "ramp"; // Also the default in the parser if (!"ramp".equals(typeString)) { atts.addAttribute("", "type", "type", "", typeString); } final boolean extended = colorMap.getExtendedColors(); if (extended) { atts.addAttribute("", "extended", "extended", "", "" + extended); } start("ColorMap", atts); ColorMapEntry[] mapEntries = colorMap.getColorMapEntries(); for (int i = 0; i < mapEntries.length; i++) { mapEntries[i].accept(this); } end("ColorMap"); }
public void visit(ColorMap colorMap) { ColorMap copy = sf.createColorMap(); copy.setType(colorMap.getType()); copy.setExtendedColors(colorMap.getExtendedColors()); ColorMapEntry[] entries = colorMap.getColorMapEntries(); if (entries != null) { for (int i = 0; i < entries.length; i++) { ColorMapEntry entry = entries[i]; copy.addColorMapEntry(copy(entry)); } } if (STRICT && !copy.equals(colorMap)) { throw new IllegalStateException( "Was unable to duplicate provided ColorMap:" + colorMap); } pages.push(copy); }
this.extendedColors = colorMap.getExtendedColors(); final ColorMapEntry[] cmEntries = colorMap.getColorMapEntries(); if (cmEntries != null && cmEntries.length > 0) {
public void visit(ColorMap colorMap) { // The type of the ColorMap is stored in an attribute "type" and may store // string-values: "ramp", "intervals" or "values". AttributesImpl atts = new AttributesImpl(); String typeString; if (colorMap.getType() == ColorMap.TYPE_INTERVALS) typeString = "intervals"; else if (colorMap.getType() == ColorMap.TYPE_VALUES) typeString = "values"; else typeString = "ramp"; // Also the default in the parser if(!"ramp".equals(typeString)) { atts.addAttribute("", "type", "type", "", typeString); } final boolean extended = colorMap.getExtendedColors(); if(extended) { atts.addAttribute("", "extended", "extended", "", ""+extended); } start("ColorMap", atts); ColorMapEntry[] mapEntries = colorMap.getColorMapEntries(); for (int i = 0; i < mapEntries.length; i++) { mapEntries[i].accept(this); } end("ColorMap"); }
public void visit(ColorMap colorMap) { ColorMap copy = sf.createColorMap(); copy.setType(colorMap.getType()); copy.setExtendedColors(colorMap.getExtendedColors()); ColorMapEntry[] entries = colorMap.getColorMapEntries(); if (entries != null) { for (int i = 0; i < entries.length; i++) { ColorMapEntry entry = entries[i]; copy.addColorMapEntry(copy(entry)); } } if (STRICT && !copy.equals(colorMap)) { throw new IllegalStateException("Was unable to duplicate provided ColorMap:" + colorMap); } pages.push(copy); }
this.extendedColors = colorMap.getExtendedColors(); final ColorMapEntry[] cmEntries = colorMap.getColorMapEntries(); if (cmEntries != null && cmEntries.length > 0) {
cmapLegendBuilder.setExtended(cmap.getExtendedColors());