/** * * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { ColorMap colorMap = styleFactory.createColorMap(); List entries = (List) node.getChildValues("ColorMapEntry"); for (Iterator itr = entries.iterator(); itr.hasNext(); ) { colorMap.addColorMapEntry((ColorMapEntry) itr.next()); } return colorMap; } }
ColorMapEntry startEntry = entries[0].getColorMapEntry(start); fillColorInEntry(startEntry, beforeColor); colorMap.addColorMapEntry(startEntry); colorMap.addColorMapEntry(entries[i].getColorMapEntry(min, range)); colorMap.addColorMapEntry(entries[i].getColorMapEntry(min, range)); colorMap.addColorMapEntry(entries[numEntries - 1].getColorMapEntry(max)); colorMap.addColorMapEntry(endEntry);
/** * * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { ColorMap map = styleFactory.createColorMap(); for (ColorMapEntry e : (List<ColorMapEntry>) node.getChildValues(ColorMapEntry.class)) { map.addColorMapEntry(e); } return map; } }
symbol.addColorMapEntry(parseColorMapEntry(child));
/** * 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; }
map.addColorMapEntry(entry); map.addColorMapEntry(entry);
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); }
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; }
colorMap.addColorMapEntry(e);
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { ColorMap colorMap = styleFactory.createColorMap(); List entries = (List) node.getChildValues("ColorMapEntry"); for (Iterator itr = entries.iterator(); itr.hasNext();) { colorMap.addColorMapEntry((ColorMapEntry) itr.next()); } return colorMap; } }
private ColorMap parseColorMap(Node root) { ColorMap symbol = factory.createColorMap(); NodeList children = root.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { Node child = children.item(i); if ((child == null) || (child.getNodeType() != Node.ELEMENT_NODE)) { continue; } String childName = child.getLocalName(); if (childName == null) { childName = child.getNodeName(); } if (childName.equalsIgnoreCase("ColorMapEntry")) { symbol.addColorMapEntry(parseColorMapEntry(child)); } } return symbol; }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { ColorMap colorMap = styleFactory.createColorMap(); List entries = (List) node.getChildValues("ColorMapEntry"); for (Iterator itr = entries.iterator(); itr.hasNext();) { colorMap.addColorMapEntry((ColorMapEntry) itr.next()); } return colorMap; } }
/** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { ColorMap map = styleFactory.createColorMap(); for (ColorMapEntry e : (List<ColorMapEntry>) node.getChildValues(ColorMapEntry.class)) { map.addColorMapEntry(e); } return map; }
/** * Gets the colour map. * * @return the colour map */ public ColorMap getColourMap() { ColorMap colourMap = new ColorMapImpl(); for (ColourMapData data : colourMapList) { ColorMapEntry entry = createColourMapEntry(data); colourMap.addColorMapEntry(entry); } return colourMap; }
filterFactory.function( "pow", filterFactory.literal(1.2d), filterFactory.literal(2.0d))); symb.getColorMap().addColorMapEntry(e1); symb.getColorMap().addColorMapEntry(e2); StyledLayerDescriptor sld = sld(symb);
e2.setColor(filterFactory.literal("#0000EE")); e2.setQuantity(filterFactory.literal(1.0d)); symb.getColorMap().addColorMapEntry(e1); symb.getColorMap().addColorMapEntry(e2); StyledLayerDescriptor sld = sld(symb);
/** * 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; }
/** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { ColorMap map = styleFactory.createColorMap(); List<Node> children = node.getChildren(); int i = 0; while(!"Value".equals(children.get(i).getComponent().getName())) i++; ColorMapEntry entry = styleFactory.createColorMapEntry(); entry.setColor((Expression)children.get(i++).getValue()); map.addColorMapEntry(entry); while(i < children.size()) { entry = styleFactory.createColorMapEntry(); entry.setQuantity((Expression)children.get(i).getValue()); if (i+1 >= children.size()) { throw new IllegalArgumentException("Incorrectly specified color map Threshold/Value pair"); } entry.setColor((Expression)children.get(i+1).getValue()); map.addColorMapEntry(entry); i+=2; } return map; }
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); }