Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » zest: GraphViewer removeNode removeRelationship
zest: GraphViewer removeNode removeRelationship [message #487696] Thu, 24 September 2009 03:52 Go to next message
Paul Richardson is currently offline Paul Richardson
Messages: 33
Registered: July 2009
Member
Morning,

I wonder if the methods removeNode and removeRelationship can be made accessible by the zest core. At the moment, they are part of AbstractStructuredGraphViewer. This is not exported and GraphViewer does not override them.

It means that I cannot properly delete nodes from a graph.

Cheers

phantomjinx
Re: zest: GraphViewer removeNode removeRelationship [message #487709 is a reply to message #487696] Thu, 24 September 2009 04:32 Go to previous messageGo to next message
Paul Richardson is currently offline Paul Richardson
Messages: 33
Registered: July 2009
Member
Dont normally reply to my own posts but seems a correction is required.

What I though was needed when deleting a node to use the removeNode method from the viewer. It turns out that I can call node.dispose() instead.

The only problem I have found is that in order to delete a node I have to select it, which adds it to the selection array in the graph. Seems this array is not cleared when the node is disposed.

Workaround is to do graph.setSelection(null) before calling dispose but it would be nice if this was done internally by the graph.

Cheers

PGR
Re: zest: GraphViewer removeNode removeRelationship [message #495997 is a reply to message #487696] Fri, 06 November 2009 17:52 Go to previous message
Miles Parker is currently offline Miles Parker
Messages: 1338
Registered: July 2009
Senior Member
Paul,

I don't think it's really an intended part of the design to be editing the (view) graph nodes and edges directly. A much better approach is to use a backing model and then provide context menu items to remove the node form the backing model. Then on refresh Zest will handle the rest.

hth,

Miles
Previous Topic:MarqueeSelectionTool selection behavior
Next Topic:[Zest] Auto Srolling
Goto Forum:
  


Current Time: Thu Aug 21 20:15:13 EDT 2014

Powered by FUDForum. Page generated in 0.02703 seconds