@Override public void handle(YamlObject<?> obj, YamlParseContext context) { colorMap(colorMap); YamlMap map = obj.map(); if (map.has("type")) { String value = map.str("type"); if ("ramp".equals(value)) { colorMap.setType(ColorMap.TYPE_RAMP); } else if ("intervals".equals(value)) { colorMap.setType(ColorMap.TYPE_INTERVALS); } else if ("values".equals(value)) { colorMap.setType(ColorMap.TYPE_VALUES); } else { LOG.warning("Unknown color map type: " + value); } } context.push("entries", new EntriesParser()); }
symbol.setType(ColorMap.TYPE_RAMP); } else if ("intervals".equalsIgnoreCase(type)) { symbol.setType(ColorMap.TYPE_INTERVALS); } else if ("values".equalsIgnoreCase(type)) { symbol.setType(ColorMap.TYPE_VALUES); } else if (LOGGER.isLoggable(Level.FINE)) LOGGER.fine(Errors.format(ErrorKeys.ILLEGAL_ARGUMENT_$2, "ColorMapType", type));
/** * Creates a color map based on fixed quantities and colors. * * @param quantities The values that begin a category, or break points in a ramp, or isolated * values, according to the type of color map specified by Type * @param colors The colors that will be associated to the categories, break points, or isolated * values * @param type Either @link ColorMap#TYPE_RAMP, @link ColorMap#TYPE_INTERVALS or @link * ColorMap#TYPE_VALUES */ public ColorMap createColorMap(String[] labels, double[] quantities, Color[] colors, int type) { ColorMap colorMap = sf.createColorMap(); colorMap.setType(type); if ((labels == null) || (quantities == null) || (colors == null) || (labels.length != quantities.length) || (quantities.length != colors.length)) { throw new IllegalArgumentException( "Labels, quantities and colors arrays should be not null and have the same size"); } for (int i = 0; i < colors.length; i++) { colorMap.addColorMapEntry(createColorMapEntry(labels[i], quantities[i], colors[i])); } return 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); }
colorMap.setType(ColorMap.TYPE_INTERVALS); for (int i = 1; i < numEntries - 1; i += 2) { colorMap.addColorMapEntry(entries[i].getColorMapEntry(min, range)); colorMap.setType(ColorMap.TYPE_RAMP); for (int i = 0; i < numEntries - 1; i++) { colorMap.addColorMapEntry(entries[i].getColorMapEntry(min, range));
public ColorMap build() { // force the dump of the last entry builder entry(); if (unset) { return null; } ColorMap colorMap = sf.createColorMap(); colorMap.setType(type); colorMap.setExtendedColors(extended); for (ColorMapEntry entry : entries) { colorMap.addColorMapEntry(entry); } if (parent == null) { reset(); } return colorMap; }
public void apply() { if (colorMap != null) { colorMap.setType((Integer)guiType.getValue()); } }
@Override public void handle(YamlObject<?> obj, YamlParseContext context) { colorMap(colorMap); YamlMap map = obj.map(); if (map.has("type")) { String value = map.str("type"); if ("ramp".equals(value)) { colorMap.setType(ColorMap.TYPE_RAMP); } else if ("intervals".equals(value)) { colorMap.setType(ColorMap.TYPE_INTERVALS); } else if ("values".equals(value)) { colorMap.setType(ColorMap.TYPE_VALUES); } else { LOG.warning("Unknown color map type: " + value); } } context.push("entries", new EntriesParser()); }
/** * Update colour map. * * @return the color map */ private ColorMap updateColourMap() { ColorMap colorMap = fieldConfigVisitor.getColourMap(FieldIdEnum.RASTER_COLOURMAP); ValueComboBoxData colourMapType = fieldConfigVisitor.getComboBox(FieldIdEnum.RASTER_COLOURMAP_TYPE); colorMap.setType(Integer.valueOf(colourMapType.getKey())); return colorMap; }
symbol.setType(ColorMap.TYPE_RAMP); } else if ("intervals".equalsIgnoreCase(type)) { symbol.setType(ColorMap.TYPE_INTERVALS); } else if ("values".equalsIgnoreCase(type)) { symbol.setType(ColorMap.TYPE_VALUES); } else if (LOGGER.isLoggable(Level.FINE)) LOGGER.fine(Errors.format(ErrorKeys.ILLEGAL_ARGUMENT_$2, "ColorMapType", type));
/** * Creates a color map based on fixed quantities and colors. * @param quantities The values that begin a category, or break points in a ramp, * or isolated values, according to the type of color map specified by Type * @param colors The colors that will be associated to the categories, break points, or isolated values * @param type Either @link ColorMap#TYPE_RAMP, @link ColorMap#TYPE_INTERVALS or @link ColorMap#TYPE_VALUES */ public ColorMap createColorMap(String[] labels, double[] quantities, Color[] colors, int type) { ColorMap colorMap = sf.createColorMap(); colorMap.setType(type); if ((labels == null) || (quantities == null) || (colors == null) || (labels.length != quantities.length) || (quantities.length != colors.length)) { throw new IllegalArgumentException("Labels, quantities and colors arrays should be not null and have the same size"); } for (int i = 0; i < colors.length; i++) { colorMap.addColorMapEntry(createColorMapEntry(labels[i], quantities[i], colors[i])); } return colorMap; }
/** * Creates a color map based on fixed quantities and colors. * @param quantities The values that begin a category, or break points in a ramp, * or isolated values, according to the type of color map specified by Type * @param colors The colors that will be associated to the categories, break points, or isolated values * @param type Either @link ColorMap#TYPE_RAMP, @link ColorMap#TYPE_INTERVALS or @link ColorMap#TYPE_VALUES */ public ColorMap createColorMap(String[] labels, double[] quantities, Color[] colors, int type) { ColorMap colorMap = sf.createColorMap(); colorMap.setType(type); if ((labels == null) || (quantities == null) || (colors == null) || (labels.length != quantities.length) || (quantities.length != colors.length)) { throw new IllegalArgumentException("Labels, quantities and colors arrays should be not null and have the same size"); } for (int i = 0; i < colors.length; i++) { colorMap.addColorMapEntry(createColorMapEntry(labels[i], quantities[i], colors[i])); } return 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); }
symbolizer.getColorMap().addColorMapEntry(getEntry(new Color(0xFF044606, true), 1000)); symbolizer.getColorMap().setType(ColorMap.TYPE_RAMP);
symbolizer.getColorMap().addColorMapEntry(getEntry(new Color(0xFF044606, true), 1000)); symbolizer.getColorMap().setType(ColorMap.TYPE_RAMP);
colorMap.setType(ColorMap.TYPE_RAMP);