public class SVGProcessor extends Object
Modifier and Type | Field and Description |
---|---|
protected static Set<String> |
definitionElementNames
Tag names of definition elements which contain graphical
elements but are not displayed directly
|
protected static Set<String> |
graphicalElementNames
Tag names of graphical elements
|
protected static Set<String> |
groupElementNames
Tag names of group element
|
Constructor and Description |
---|
SVGProcessor() |
Modifier and Type | Method and Description |
---|---|
static void |
getIdReferences(Collection<String> refs,
com.google.gwt.dom.client.Element element)
Adds the ids of all elements referred to by the specified element
to the specified collection of referenced ids.
|
static boolean |
isDefinitionElement(org.vectomatic.dom.svg.impl.SVGElement element)
Returns true if the specified node is a definition element.
|
static boolean |
isGraphicalElement(org.vectomatic.dom.svg.impl.SVGElement element)
Returns true if the specified node is a graphical element.
|
static boolean |
isGroupElement(org.vectomatic.dom.svg.impl.SVGElement element) |
static boolean |
isSvgElement(com.google.gwt.dom.client.Node node)
Returns true if the specified node is an SVG element.
|
static boolean |
isTitleDescElement(org.vectomatic.dom.svg.impl.SVGElement element)
Returns true if the specified element is an SVG title or desc element.
|
static boolean |
isTransformable(com.google.gwt.dom.client.Node node)
Returns true if the specified element implements ISVGTransformable.
|
static void |
main(String[] args) |
static String |
makeId(String idPrefix,
String localId) |
static String |
newIdPrefix()
Creates a new unique id prefix for id attributes of an svg model.
|
static String |
newPrefixExtension(String base,
String extension)
Creates a new unique id prefix with the specified extension
|
static void |
normalizeIds(org.vectomatic.dom.svg.OMSVGElement srcSvg,
String idPrefix)
Transforms all ids and id-refs in the specified source svg to avoid
collisions with other svgs in other models.
|
static void |
reparent(org.vectomatic.dom.svg.OMSVGElement src,
org.vectomatic.dom.svg.OMSVGElement dest)
Transfers all the children for one element to another element
|
protected static Set<String> definitionElementNames
protected static Set<String> graphicalElementNames
public static boolean isGroupElement(org.vectomatic.dom.svg.impl.SVGElement element)
public static boolean isDefinitionElement(org.vectomatic.dom.svg.impl.SVGElement element)
element
- the element to test.public static boolean isGraphicalElement(org.vectomatic.dom.svg.impl.SVGElement element)
element
- the element to test.public static boolean isSvgElement(com.google.gwt.dom.client.Node node)
node
- the node to test.public static boolean isTitleDescElement(org.vectomatic.dom.svg.impl.SVGElement element)
element
- the element to test.public static boolean isTransformable(com.google.gwt.dom.client.Node node)
node
- the node to test.public static void getIdReferences(Collection<String> refs, com.google.gwt.dom.client.Element element)
element
- The element to analyzerefs
- A collection of referenced ids.public static void main(String[] args)
public static String newIdPrefix()
{prefix/ext1/...extN}localIdwhere:
public static String newPrefixExtension(String base, String extension)
base
- The base prefixextension
- The extension to addpublic static void normalizeIds(org.vectomatic.dom.svg.OMSVGElement srcSvg, String idPrefix)
srcSvg
- The source svgidPrefix
- A prefix to apply to avoid collisionspublic static void reparent(org.vectomatic.dom.svg.OMSVGElement src, org.vectomatic.dom.svg.OMSVGElement dest)
src
- the source elementdest
- the destination elementCopyright © 2018. All Rights Reserved.