Java XML Attribute Create createFillAttributeGraphics(Document d, boolean showColor, boolean showGradientColor, boolean showGradientRotation, boolean showImage)

Here you can find the source of createFillAttributeGraphics(Document d, boolean showColor, boolean showGradientColor, boolean showGradientRotation, boolean showImage)

Description

create Fill Attribute Graphics

License

Open Source License

Declaration

protected static Element createFillAttributeGraphics(Document d, boolean showColor, boolean showGradientColor,
            boolean showGradientRotation, boolean showImage) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import org.w3c.dom.Document;
import org.w3c.dom.Element;

public class Main {
    protected static Element createFillAttributeGraphics(Document d, boolean showColor, boolean showGradientColor,
            boolean showGradientRotation, boolean showImage) {
        Element fillGraphics = d.createElement("fill");
        if (showColor)
            fillGraphics.setAttribute("color", "#FF0000");
        if (showGradientColor)
            fillGraphics.setAttribute("gradient-color", "#FFFFFF");
        if (showGradientRotation)
            fillGraphics.setAttribute("gradient-rotation", "diagonal");
        if (showImage)
            fillGraphics.setAttribute("image", "http://www.some-url.com/image.png");
        return fillGraphics;
    }//from  w  w  w . jav  a 2s  . c  o m
}

Related

  1. createAttribute(Document doc, String friendlyName, String samlNS, String samlPrefix, QName attrKey)
  2. createAttribute(Document doc, String nodeName, Map map)
  3. createAttribute(Document document, String name, String value)
  4. createAttribute(String sName, String sValue, Node nParent)
  5. createAttributeTable(Element e)
  6. createFontAttributeGraphics(Document d, boolean showFamily, boolean showStyle, boolean showWeight, boolean showSize, boolean showDecoration, boolean showAlign, boolean showRotation)
  7. mapifyAttrs(Node node, Map overwrite)
  8. writeAttribute(PrintWriter w, Attr attr, int depth)
  9. writeAttribute(XMLStreamWriter writer, String name, Object value)