graphView.setEdgesCountTotal(Integer.parseInt(reader.getAttributeValue(null, "edgestotal")));
graphView.setMutualEdgesEnabled(Integer.parseInt(reader.getAttributeValue(null, "mutualedgesenabled")));
graphView.setMutualEdgesTotal(Integer.parseInt(reader.getAttributeValue(null, "mutualedgestotal")));
graphView.setNodesEnabled(Integer.parseInt(reader.getAttributeValue(null, "nodesenabled")));
TreeStructure mainStructure = graphStructure.getMainView().getStructure();
TreeStructure treeStructure = graphView.getStructure();
boolean end = false;
while (reader.hasNext() && !end) {
int type = reader.next();
switch (type) {
case XMLStreamReader.START_ELEMENT:
String name = reader.getLocalName();
if (ELEMENT_VIEW_NODE.equalsIgnoreCase(name)) {
Boolean enabled = Boolean.parseBoolean(reader.getAttributeValue(null, "enabled"));
AbstractNode mainNode = mainStructure.getNodeAt(Integer.parseInt(reader.getAttributeValue(null, "mainpre")));
AbstractNode parentNode = treeStructure.getNodeAt(Integer.parseInt(reader.getAttributeValue(null, "parent")));
AbstractNode node = new AbstractNode(mainNode.getNodeData(), graphView.getViewId(), 0, 0, 0, parentNode);
Integer inDegree = Integer.parseInt(reader.getAttributeValue(null, "enabledindegree"));
Integer outDegree = Integer.parseInt(reader.getAttributeValue(null, "enabledoutdegree"));
Integer mutualDegree = Integer.parseInt(reader.getAttributeValue(null, "enabledmutualdegree"));
node.setEnabledInDegree(inDegree);
node.setEnabledOutDegree(outDegree);
node.setEnabledMutualDegree(mutualDegree);
node.setEnabled(enabled);
treeStructure.insertAsChild(node, parentNode);
} else if (ELEMENT_VIEW_EDGE.equalsIgnoreCase(name)) {
AbstractEdge edge = graphStructure.getEdgeFromDictionnary(Integer.parseInt(reader.getAttributeValue(null, "id")));
AbstractNode source = edge.getSource(graphView.getViewId());
AbstractNode target = edge.getTarget(graphView.getViewId());
source.getEdgesOutTree().add(edge);