1 18 package org.apache.batik.svggen; 19 20 import java.util.HashMap ; 21 import java.util.LinkedList ; 22 import java.util.List ; 23 import java.util.Map ; 24 25 32 public class SVGHintsDescriptor implements SVGDescriptor, SVGSyntax { 33 private String colorInterpolation; 34 private String colorRendering; 35 private String textRendering; 36 private String shapeRendering; 37 private String imageRendering; 38 39 42 public SVGHintsDescriptor(String colorInterpolation, 43 String colorRendering, 44 String textRendering, 45 String shapeRendering, 46 String imageRendering){ 47 if(colorInterpolation == null || 48 colorRendering == null || 49 textRendering == null || 50 shapeRendering == null || 51 imageRendering == null) 52 throw new SVGGraphics2DRuntimeException(ErrorConstants.ERR_HINT_NULL); 53 54 this.colorInterpolation = colorInterpolation; 55 this.colorRendering = colorRendering; 56 this.textRendering = textRendering; 57 this.shapeRendering = shapeRendering; 58 this.imageRendering = imageRendering; 59 } 60 61 public Map getAttributeMap(Map attrMap) { 62 if (attrMap == null) 63 attrMap = new HashMap (); 64 65 attrMap.put(SVG_COLOR_INTERPOLATION_ATTRIBUTE, colorInterpolation); 66 attrMap.put(SVG_COLOR_RENDERING_ATTRIBUTE, colorRendering); 67 attrMap.put(SVG_TEXT_RENDERING_ATTRIBUTE, textRendering); 68 attrMap.put(SVG_SHAPE_RENDERING_ATTRIBUTE, shapeRendering); 69 attrMap.put(SVG_IMAGE_RENDERING_ATTRIBUTE, imageRendering); 70 71 return attrMap; 72 } 73 74 public List getDefinitionSet(List defSet) { 75 if (defSet == null) 76 defSet = new LinkedList (); 77 78 return defSet; 79 } 80 } 81 | Popular Tags |