com.yworks.yfiles.server.graphml.support
Class LabelCompatOutputHandler

java.lang.Object
  extended byyext.graphml.writer.AbstractOutputHandler
      extended bycom.yworks.yfiles.server.graphml.support.DocumentFragmentOutputHandler
          extended bycom.yworks.yfiles.server.graphml.support.LabelCompatOutputHandler
All Implemented Interfaces:
OutputHandler

public class LabelCompatOutputHandler
extends com.yworks.yfiles.server.graphml.support.DocumentFragmentOutputHandler

An output handler that tries to commit the label model parameters for all labels in the graph that is being written to the xml fragments that were parsed when the graph was read.


Constructor Summary
LabelCompatOutputHandler(Object dataProviderKey)
          Creates a new instance that uses the DocumentFragements stored in the data provider with the given key
 
Method Summary
protected  void commitLabelLayout(Node labelElement, EdgeLabelLayout labelLayout, Graph graph, Edge edge)
          Commit the model parameters of the given label element to the corresponding XML fragment.
protected  void commitLabelLayout(Node labelElement, NodeLabelLayout labelLayout, Graph graph, Node node)
          Commit the model parameters of the given label element to the corresponding XML fragment.
protected  void dumpNodes(XmlWriter writer, Node rootNode)
          Write all child nodes of the given root node to the xml writer.
protected  String getAttrNameValue()
           
 boolean getCommitLabelLayouts()
          Whether this output handler will call FlexIOTools.copyLabelLayouts(y.layout.LayoutGraph) before the labels are written.
protected  Object getDataProviderKey()
           
 int getPrecedence()
           
 void printDataOutput(GraphMLWriteContext context, Graph graph, Object nodeedge, XmlWriter writer)
           
 void printKeyAttributes(GraphMLWriteContext context, XmlWriter writer)
           
 void printKeyOutput(GraphMLWriteContext context, XmlWriter ips)
           
 void setCommitLabelLayouts(boolean commitLabelLayouts)
          Whether this output handler will call FlexIOTools.copyLabelLayouts(y.layout.LayoutGraph) before the labels are written.
 
Methods inherited from class yext.graphml.writer.AbstractOutputHandler
getKeyAttributes, printDataAttributes, printDataOutput
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LabelCompatOutputHandler

public LabelCompatOutputHandler(Object dataProviderKey)
Creates a new instance that uses the DocumentFragements stored in the data provider with the given key

Parameters:
dataProviderKey - The key of the data provider that contains the DocumentFragments that represent the labels of edges or nodes.
Method Detail

getCommitLabelLayouts

public boolean getCommitLabelLayouts()
Whether this output handler will call FlexIOTools.copyLabelLayouts(y.layout.LayoutGraph) before the labels are written.


setCommitLabelLayouts

public void setCommitLabelLayouts(boolean commitLabelLayouts)
Whether this output handler will call FlexIOTools.copyLabelLayouts(y.layout.LayoutGraph) before the labels are written.


commitLabelLayout

protected void commitLabelLayout(Node labelElement,
                                 NodeLabelLayout labelLayout,
                                 Graph graph,
                                 Node node)
Commit the model parameters of the given label element to the corresponding XML fragment. This will work only for a DiscreteNodeLabelModel.

Parameters:
labelElement - The current XML element
labelLayout - The label layout that should be commited back to the client.
graph - The graph the node belongs to.
node - The node that the label belongs to.

commitLabelLayout

protected void commitLabelLayout(Node labelElement,
                                 EdgeLabelLayout labelLayout,
                                 Graph graph,
                                 Edge edge)
Commit the model parameters of the given label element to the corresponding XML fragment. This will work only for a SliderEdgeLabelModel or FreeEdgeLabelModel.

Parameters:
labelElement - The current XML element
labelLayout - The label layout that should be commited back to the client.
graph - The graph the edge belongs to.
edge - The edge that the label belongs to.

printDataOutput

public void printDataOutput(GraphMLWriteContext context,
                            Graph graph,
                            Object nodeedge,
                            XmlWriter writer)

getPrecedence

public int getPrecedence()

getDataProviderKey

protected Object getDataProviderKey()

getAttrNameValue

protected String getAttrNameValue()

printKeyAttributes

public void printKeyAttributes(GraphMLWriteContext context,
                               XmlWriter writer)

printKeyOutput

public void printKeyOutput(GraphMLWriteContext context,
                           XmlWriter ips)

dumpNodes

protected void dumpNodes(XmlWriter writer,
                         Node rootNode)
Write all child nodes of the given root node to the xml writer.

Parameters:
writer - The xml writer to write to
rootNode - The parent node to be dumped


Copyright © 2000-2007 yWorks GmbH. All rights reserved