I want to get the value of the EReference from a Java program
I use this library: https://github.com/tesis-dynaware/graph-editor
Here is an example of xmi file generated :
<?xml version="1.0" encoding="ASCII"?>
<graph:GModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:graph="http://de.tesis.dynaware.grapheditor.model/1.0">
<nodes type="tree-node" x="1217.0" y="556.0">
<connectors type="tree-output" connections="//@connections.0 //@connections.1" connectionDetachedOnDrag="false"/>
</nodes>
<nodes type="tree-node" x="1020.0" y="756.0">
<connectors type="tree-input" connections="//@connections.0"/>
<connectors type="tree-output" connectionDetachedOnDrag="false"/>
</nodes>
<nodes type="tree-node" x="1260.0" y="775.0">
<connectors type="tree-input" connections="//@connections.1"/>
<connectors type="tree-output" connectionDetachedOnDrag="false"/>
</nodes>
<connections type="tree-connection" source="//@nodes.0/@connectors.0" target="//@nodes.1/@connectors.0"/>
<connections type="tree-connection" source="//@nodes.0/@connectors.0" target="//@nodes.2/@connectors.0"/>
</graph:GModel>
What i want is to get the value of the EReference source, and i must get for exemple : /@nodes.0/@connectors.0
I tried the code below
GModel gModel=model;
EList<GConnection> connections=gModel.getConnections();
for(GConnection connection : connections)
{
GConnector source=connection.getSource();
System.out.println(" valeur source =" +source);
}
but i obtain the result below :
valeur source=de.tesis.dynaware.grapheditor.model.impl.GConnectorImpl@21dd34be (id: null, type: tree-output, x: 0.0, y: 0.0, connectionDetachedOnDrag: false)