0

I want to create a TreeView in which i store all nodes of my graph. when i modify the name of the nodes, i want this name be update on my treeview...But i don't know how to process can you help me please?

I try to add the name of the node when i am adding new nodes :

Here is my method addNode :

@Override
public void addNode(final double currentZoomFactor) {
    String s;

    final double windowXOffset = graphEditorContainer.windowXProperty().get() / currentZoomFactor;
    final double windowYOffset = graphEditorContainer.windowYProperty().get() / currentZoomFactor;

    final GNode node = GraphFactory.eINSTANCE.createGNode();
    node.setY(NODE_INITIAL_Y + windowYOffset);

    node.setType(GreySkinConstants.GREY_NODE);
    node.setX(NODE_INITIAL_X + windowXOffset);
    node.setId(allocateNewId());
   //node.setNomClasse("nom_classe");

    final GConnector input = GraphFactory.eINSTANCE.createGConnector();
    node.getConnectors().add(input);
    input.setType(GreySkinConstants.GREY_OUTPUT_CONNECTOR);

    final GConnector output = GraphFactory.eINSTANCE.createGConnector();
    node.getConnectors().add(output);
    output.setType(GreySkinConstants.GREY_OUTPUT_CONNECTOR);

    Commands.addNode(graphEditor.getModel(), node);

    GraphEditorDemoController.getInstance().getClasse_Listview().getItems().add(node.getNomClasse());
}
  • I do not understand what you mean with 'how to process'. – hotzst Jan 11 '16 at 16:00
  • Sorry my english is not very good..i just want to say how can do it ? (algorithm) – user5772710 Jan 11 '16 at 21:47
  • You code example is incomplete, as it does not show how the nodes are added to the scene graph. I guess this happens in one of the last two methods. Can you supply the code for those as well in your question. – hotzst Jan 12 '16 at 06:26

0 Answers0