/** * Creates a text node with the desired text * * @param txt String text to display */ public Text(final String txt) { text = Document.get().createTextNode(txt); setElement(text.<Element>cast()); }
/** * Creates a text node with the desired text * * @param txt String text to display */ public Text(final String txt) { text = Document.get().createTextNode(txt); setElement(text.<Element>cast()); }
/** * Creates a text node with the desired text * * @param txt String text to display */ public Text(final String txt) { text = Document.get().createTextNode(txt); setElement(text.<Element>cast()); }
@Override public void setText(String text) { assert baseNode == null : "TextNode can be set once"; baseNode = Document.get().createTextNode(text); setElement(baseNode.<Element>cast()); }
/** * Creates a text node with the desired text * * @param txt String text to display */ public Text(final String txt) { text = Document.get().createTextNode(txt); setElement(text.<Element>cast()); }
/** * Clone a single SVG element. * * @param source * The source SVG element. * @return Returns the clone. */ private static Element clone(Element source) { if (source == null || source.getNodeName() == null) { return null; } if ("#text".equals(source.getNodeName())) { return Document.get().createTextNode(source.getNodeValue()).cast(); } Element clone = createElementNS(Dom.NS_SVG, source.getNodeName()); cloneAttributes(source, clone); for (int i = 0; i < source.getChildCount(); i++) { Element child = source.getChild(i).cast(); clone.appendChild(clone(child)); } return clone; }
/** * Clone a single SVG element. * * @param source * The source SVG element. * @return Returns the clone. */ private static Element clone(Element source) { if (source == null || source.getNodeName() == null) { return null; } if ("#text".equals(source.getNodeName())) { return Document.get().createTextNode(source.getNodeValue()).cast(); } Element clone = createElementNS(Dom.NS_SVG, source.getNodeName()); cloneAttributes(source, clone); for (int i = 0; i < source.getChildCount(); i++) { Element child = source.getChild(i).cast(); clone.appendChild(clone(child)); } return clone; }
/** * Clone a single SVG element. * * @param source * The source SVG element. * @return Returns the clone. */ public Element cloneSvgElement(Element source) { if (source == null || source.getNodeName() == null) { return null; } if ("#text".equals(source.getNodeName())) { return Document.get().createTextNode(source.getNodeValue()).cast(); } Element clone = createElementNS(Dom.NS_SVG, source.getNodeName(), Dom.createUniqueId()); cloneAttributes(source, clone); for (int i = 0; i < source.getChildCount(); i++) { Element child = source.getChild(i).cast(); clone.appendChild(cloneSvgElement(child)); } return clone; }