How to Save Port Constraints to a GraphML File
Applies to: GraphML 3.0, GraphML 2.4, yFiles 2.5, yFiles 2.4 print article email article

Type: Questions & Answers

This article describes how port constraints can be saved in a GraphML file.

When saving a graph to a GraphML file, by default PortConstraints are not stored in this file. Nevertheless the GraphML package already provides input and output handlers that can easily be registered to the yext.graphml.graph2D.GraphMLIOHandler as follows:
GraphMLIOHandler ioh = new GraphMLIOHandler();
//yext.graphml.graph2D.PortConstraintInputHandler
ioh.addInputHandler( new PortConstraintInputHandler());
//yext.graphml.graph2D.PortConstraintOutputHandler
ioh.addOutputHandler(new PortConstraintOutputHandler(), GraphMLConstants.SCOPE_EDGE);
Using this GraphMLIOHandler will now guarantee that set PortConstraints will be stored and reloaded.
Note
PortConstraintInputHandler will add new DataProviders to the graph for the source and target port constraints if they are not yet registered.

Keywords: GraphML - PortConstraint - store - save - file - PortConstraintInputHandler - PortConstraintOutputHandler - GraphMLIOHandler

Provide feedback:
How useful was this article?    less 1 2 3 4 5 more
Email address (optional):
COPYRIGHT © 2008 yWorks · ALL RIGHTS RESERVED imprint | top | home