Java XML Attribute Create createFontAttributeGraphics(Document d, boolean showFamily, boolean showStyle, boolean showWeight, boolean showSize, boolean showDecoration, boolean showAlign, boolean showRotation)

Here you can find the source of createFontAttributeGraphics(Document d, boolean showFamily, boolean showStyle, boolean showWeight, boolean showSize, boolean showDecoration, boolean showAlign, boolean showRotation)

Description

create Font Attribute Graphics

License

Open Source License

Declaration

protected static Element createFontAttributeGraphics(Document d, boolean showFamily, boolean showStyle,
            boolean showWeight, boolean showSize, boolean showDecoration, boolean showAlign, boolean showRotation) 

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 createFontAttributeGraphics(Document d, boolean showFamily, boolean showStyle,
            boolean showWeight, boolean showSize, boolean showDecoration, boolean showAlign, boolean showRotation) {
        Element fontGraphics = d.createElement("font");
        if (showFamily)
            fontGraphics.setAttribute("family", "arial,sans-serif");
        if (showStyle)
            fontGraphics.setAttribute("style", "italic");
        if (showWeight)
            fontGraphics.setAttribute("weight", "bold");
        if (showSize)
            fontGraphics.setAttribute("size", "medium");
        if (showDecoration)
            fontGraphics.setAttribute("decoration", "underline");
        if (showAlign)
            fontGraphics.setAttribute("align", "left");
        if (showRotation)
            fontGraphics.setAttribute("rotation", "0.0");
        return fontGraphics;
    }// w w w. ja  v  a2  s.co m
}

Related

  1. createAttribute(Document doc, String nodeName, Map map)
  2. createAttribute(Document document, String name, String value)
  3. createAttribute(String sName, String sValue, Node nParent)
  4. createAttributeTable(Element e)
  5. createFillAttributeGraphics(Document d, boolean showColor, boolean showGradientColor, boolean showGradientRotation, boolean showImage)
  6. mapifyAttrs(Node node, Map overwrite)
  7. writeAttribute(PrintWriter w, Attr attr, int depth)
  8. writeAttribute(XMLStreamWriter writer, String name, Object value)
  9. writeAttribute(XMLStreamWriter xmlw, String name, String value)