Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Is .clear() no longer supported?
Is .clear() no longer supported? [message #884142] Sun, 10 June 2012 07:59 Go to next message
Hassan M. is currently offline Hassan M.Friend
Messages: 9
Registered: September 2011
Location: Ohio
Junior Member
I've just downloaded the current version of Zest. One of the JAR files is called org.eclipse.zest.core_1.3.0.v20110221-2050.jar. So, my code uses a clear() method for clearing all the elements in a graph, like this:

wbsGraph = new Graph(this,SWT.NONE);
...
wbsGraph.clear();


But this doesn't work anymore. Was this method removed from the current version? Is there another way of doing this?

Re: Is .clear() no longer supported? [message #884293 is a reply to message #884142] Sun, 10 June 2012 18:35 Go to previous messageGo to next message
Fabian Steeg is currently offline Fabian SteegFriend
Messages: 76
Registered: July 2009
Member
I don't think this was ever supported in Zest 1.x - I remember adding it to Zest 2.x though:

http://git.eclipse.org/c/gef/org.eclipse.zest.git/commit/?id=3a37e2f51dc355a30642682defd99d14111cc9f7

It should work with the latest version of Zest 2, which is available from the Eclipse Marketplace.
Re: Is .clear() no longer supported? [message #884356 is a reply to message #884293] Sun, 10 June 2012 22:39 Go to previous message
Hassan M. is currently offline Hassan M.Friend
Messages: 9
Registered: September 2011
Location: Ohio
Junior Member
Okay, well that wasn't there. I got the sources and added that function (to Graph.java), and that seemed to work. However, I don't know what subGraphFigures are, but that part wasn't working so I just commented it out:

public void clear() {
	for (Iterator i = new ArrayList(connections).iterator(); i.hasNext();) {
		removeConnection((GraphConnection) i.next());
	}
	//for (Iterator i = new HashSet(subgraphFigures).iterator(); i.hasNext();) {
		//removeSubgraphFigure((IFigure) i.next());
	//}
	for (Iterator i = new ArrayList(nodes).iterator(); i.hasNext();) {
		removeNode((GraphNode) i.next());
	}
}


Anyway, thanks for the help!

[Updated on: Sun, 10 June 2012 22:40]

Report message to a moderator

Previous Topic:GraphicalEditor createActions() method is not called
Next Topic:Two OutLine Trees
Goto Forum:
  


Current Time: Tue Mar 19 03:29:16 GMT 2024

Powered by FUDForum. Page generated in 0.01988 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top