[jgrapht-users] removeEdge null pointer exception (JGraphT w/ JGraph)
Brought to you by:
barak_naveh,
perfecthash
From: Haoqi Z. <hq...@ee...> - 2010-08-12 00:14:10
|
Hi there, I am starting to use JGraph (v5) and JGraphT for a graph applet and in particular would like to allow a user to click on an edge to remove it. The problem I am encountering is that when I call removeEdge when the click event is triggered, it removes the edge, but then throws a null pointer exception in one of the edge listeners. This only happens if I am removing the edge that is being clicked on -- if I remove a different edge there is no problem. The removeEdge call is wrapped within a SwingUtilities.InvokeLater, but to no avail. My code looks something like this: [within the marqueeEvent handler's mouse press event] ... DefaultEdge e = (DefaultEdge)jgraphAdapter.getValue(cell); SwingUtilities.invokeLater(new Runnable(){ public void run(){ graph.removeEdge(e); } }); If you have encountered this issue before, know of a fix, or have ideas on this, please let me know. Thanks! Best, Haoqi |