yext.graphml.graph2D
Class AbstractNodeRealizerSerializer

java.lang.Object
  extended byyext.graphml.graph2D.AbstractNodeRealizerSerializer
All Implemented Interfaces:
NodeRealizerSerializer
Direct Known Subclasses:
GenericGroupNodeRealizerSerializer, GenericNodeRealizerSerializer, ImageNodeRealizerSerializer, ProxyShapeNodeRealizerSerializer, ShapeNodeRealizerSerializer

public abstract class AbstractNodeRealizerSerializer
extends Object
implements NodeRealizerSerializer

Abstract base class for instances of NodeRealizerSerializer. This class parses/writes basic properties of NodeRealizers.


Constructor Summary
AbstractNodeRealizerSerializer()
           
 
Method Summary
 boolean canHandle(Node n, GraphMLParseContext context)
          Default implementation.
 boolean canHandle(NodeRealizer nr, GraphMLWriteContext context)
          Default implementation.
 NodeRealizer createRealizerInstance(Node node, GraphMLParseContext context)
          Create new instance of the Realizer from the given information
 String getNamespacePrefix()
          Returns the namespace prefix of the toplevel element
 void parse(NodeRealizer nr, Node domNode, GraphMLParseContext context)
          Parses the properties from an instance of NodeRealizer.
 void write(NodeRealizer nr, XmlWriter writer, GraphMLWriteContext context)
          Writes the properties from an instance of NodeRealizer.
 void writeAttributes(NodeRealizer nr, XmlWriter writer, GraphMLWriteContext context)
          Writes out the selection state if requested.
protected  void writeFill(XmlWriter writer, NodeRealizer nr)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface yext.graphml.graph2D.NodeRealizerSerializer
getName, getNamespaceURI, getRealizerClass
 

Constructor Detail

AbstractNodeRealizerSerializer

public AbstractNodeRealizerSerializer()
Method Detail

parse

public void parse(NodeRealizer nr,
                  Node domNode,
                  GraphMLParseContext context)
Parses the properties from an instance of NodeRealizer.

Specified by:
parse in interface NodeRealizerSerializer

writeAttributes

public void writeAttributes(NodeRealizer nr,
                            XmlWriter writer,
                            GraphMLWriteContext context)
Writes out the selection state if requested.

Specified by:
writeAttributes in interface NodeRealizerSerializer

write

public void write(NodeRealizer nr,
                  XmlWriter writer,
                  GraphMLWriteContext context)
Writes the properties from an instance of NodeRealizer.

Specified by:
write in interface NodeRealizerSerializer

writeFill

protected void writeFill(XmlWriter writer,
                         NodeRealizer nr)

canHandle

public boolean canHandle(NodeRealizer nr,
                         GraphMLWriteContext context)
Default implementation.

Specified by:
canHandle in interface NodeRealizerSerializer
Parameters:
nr -
context -
Returns:
true iff nr.getClass() == getRealizerClass().

canHandle

public boolean canHandle(Node n,
                         GraphMLParseContext context)
Default implementation.

Specified by:
canHandle in interface NodeRealizerSerializer
Parameters:
n -
context -
Returns:
true iff n.getNamespaceURI().equals(getNamespaceURI()) && n.getLocalName().equals(getName()).

createRealizerInstance

public NodeRealizer createRealizerInstance(Node node,
                                           GraphMLParseContext context)
                                    throws GraphMLParseException
Description copied from interface: NodeRealizerSerializer
Create new instance of the Realizer from the given information

Specified by:
createRealizerInstance in interface NodeRealizerSerializer
Parameters:
node -
context -
Returns:
new instance of the Realizer
Throws:
GraphMLParseException

getNamespacePrefix

public String getNamespacePrefix()
Description copied from interface: NodeRealizerSerializer
Returns the namespace prefix of the toplevel element

Specified by:
getNamespacePrefix in interface NodeRealizerSerializer
Returns:
the namespace prefix of the toplevel element


Copyright ©2000-2009, yWorks GmbH. All rights reserved.