|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.io.graphml.graph2d.AbstractNodeRealizerSerializer
public abstract class AbstractNodeRealizerSerializer
Abstract base class for instances of NodeRealizerSerializer
.
This class parses/writes basic properties of NodeRealizers.
Constructor Summary | |
---|---|
AbstractNodeRealizerSerializer()
|
Method Summary | |
---|---|
boolean |
canHandle(org.w3c.dom.Node n,
GraphMLParseContext context)
Returns true iff n.getNamespaceURI().equals(getNamespaceURI())
&& n.getLocalName().equals(getName()) . |
boolean |
canHandle(NodeRealizer nr,
GraphMLWriteContext context)
Returns true iff nr.getClass() == getRealizerClass() . |
NodeRealizer |
createRealizerInstance(org.w3c.dom.Node node,
GraphMLParseContext context)
Create new instance of the Realizer from the given information |
java.lang.String |
getNamespacePrefix()
The namespace prefix to use for writing. |
void |
parse(NodeRealizer nr,
org.w3c.dom.Node domNode,
GraphMLParseContext context)
Parses the properties into an instance of NodeRealizer . |
protected void |
parseLabel(NodeRealizer nr,
org.w3c.dom.Node n,
GraphMLParseContext context)
Parses a single NodeLabel element. |
protected void |
parseNodePorts(NodeRealizer nr,
org.w3c.dom.Node domNode,
GraphMLParseContext context)
Parses the NodePorts elements and its NodePort
child elements. |
void |
write(NodeRealizer nr,
XmlWriter writer,
GraphMLWriteContext context)
Writes the realizer element's content. |
void |
writeAttributes(NodeRealizer nr,
XmlWriter writer,
GraphMLWriteContext context)
Writes the attributes of an NodeRealizer element. |
protected void |
writeBorder(NodeRealizer nr,
XmlWriter writer)
Writes the BorderStyle element. |
protected void |
writeFill(XmlWriter writer,
NodeRealizer nr)
Writes the Fill element. |
protected void |
writeNodeLabel(NodeLabel label,
XmlWriter writer,
GraphMLWriteContext context)
Writes a single NodeLabel element. |
protected void |
writeNodePorts(NodeRealizer nr,
XmlWriter writer,
GraphMLWriteContext context)
Writes the NodePorts elements and its NodePort
child elements. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface y.io.graphml.graph2d.NodeRealizerSerializer |
---|
getName, getNamespaceURI, getRealizerClass |
Constructor Detail |
---|
public AbstractNodeRealizerSerializer()
Method Detail |
---|
public void parse(NodeRealizer nr, org.w3c.dom.Node domNode, GraphMLParseContext context) throws GraphMLParseException
NodeRealizerSerializer
NodeRealizer
.
parse
in interface NodeRealizerSerializer
nr
- An existing NodeRealizer
instance which is configured.domNode
- The XML node containing the realizer data.context
- The current parse context.
GraphMLParseException
protected void parseNodePorts(NodeRealizer nr, org.w3c.dom.Node domNode, GraphMLParseContext context) throws GraphMLParseException
NodePorts
elements and its NodePort
child elements.
nr
- The node realizer that will own the node ports.domNode
- The DOM node containing node port data.context
- The current parse context.
GraphMLParseException
protected void parseLabel(NodeRealizer nr, org.w3c.dom.Node n, GraphMLParseContext context) throws GraphMLParseException
NodeLabel
element.
nr
- The NodeRealizer that will own this label.n
- The DOM node containing the label data.context
- The current parse context.
GraphMLParseException
public void writeAttributes(NodeRealizer nr, XmlWriter writer, GraphMLWriteContext context)
NodeRealizerSerializer
writeAttributes
in interface NodeRealizerSerializer
nr
- The Realizer to write.writer
- The XmlWriter for the serialization.context
- The current write context.public void write(NodeRealizer nr, XmlWriter writer, GraphMLWriteContext context) throws GraphMLWriteException
NodeRealizerSerializer
write
in interface NodeRealizerSerializer
nr
- The Realizer to write.writer
- The XmlWriter for the serialization.context
- The current write context.
GraphMLWriteException
protected void writeBorder(NodeRealizer nr, XmlWriter writer)
BorderStyle
element.
writer
- The writer to use.nr
- The NodeRealizer whose border style is to be written.protected void writeNodePorts(NodeRealizer nr, XmlWriter writer, GraphMLWriteContext context) throws GraphMLWriteException
NodePorts
elements and its NodePort
child elements.
nr
- The node realizer for which node port information is written.writer
- The XML writer to use.context
- The current write context.
GraphMLWriteException
protected void writeNodeLabel(NodeLabel label, XmlWriter writer, GraphMLWriteContext context) throws GraphMLWriteException
NodeLabel
element.
label
- The label to write.writer
- The XML writer to use.context
- The current write context.
GraphMLWriteException
protected void writeFill(XmlWriter writer, NodeRealizer nr)
Fill
element.
writer
- The writer to use.nr
- The NodeRealizer whose fill is to be written.public boolean canHandle(NodeRealizer nr, GraphMLWriteContext context)
true
iff nr.getClass() == getRealizerClass()
.
canHandle
in interface NodeRealizerSerializer
nr
- The realizer that may be written.context
- The current write context.
true
iff nr.getClass() == getRealizerClass()
.public boolean canHandle(org.w3c.dom.Node n, GraphMLParseContext context)
true
iff n.getNamespaceURI().equals(getNamespaceURI())
&& n.getLocalName().equals(getName())
.
canHandle
in interface NodeRealizerSerializer
n
- The DOM node that may be parsed.context
- The current parse context.
true
iff n.getNamespaceURI().equals(getNamespaceURI())
&& n.getLocalName().equals(getName())
.public NodeRealizer createRealizerInstance(org.w3c.dom.Node node, GraphMLParseContext context) throws GraphMLParseException
NodeRealizerSerializer
createRealizerInstance
in interface NodeRealizerSerializer
node
- The DOM node that represents the realizer data.context
- The current parse context.
GraphMLParseException
public java.lang.String getNamespacePrefix()
getNamespacePrefix
in interface NodeRealizerSerializer
null
, meaning that a predeclared mapping should be used.
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |