Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#75 Exceptions when dynamically changing a graph

closed-works-for-me
nobody
None
5
2010-04-29
2010-04-29
sciss
No

It should be possible to dynamically add and remove children of a tree or graph. It seems Prefuse is having big hickups here, probably due to race conditions. Even when cancelling the animators, exceptions are common when bulk adding or removing children (note that i verified that all insertions and removals are in correct order). this might be due to my custom pred / succ fields, so fixing the child-order problem reported earlier might also solve this problem....

[code]
java.lang.IllegalArgumentException: Invalid row index: 25
at prefuse.data.tuple.TupleManager.getTuple(Unknown Source)
at prefuse.data.Table.getTuple(Unknown Source)
at prefuse.data.CascadedTable$Listener.tableChanged(Unknown Source)
at prefuse.data.Table.fireTableEvent(Unknown Source)
at prefuse.data.Table.handleColumnChanged(Unknown Source)
at prefuse.data.Table.columnChanged(Unknown Source)
at prefuse.data.column.AbstractColumn.fireColumnEvent(Unknown Source)
at prefuse.data.column.IntColumn.setInt(Unknown Source)
at prefuse.data.column.IntColumn.set(Unknown Source)
at prefuse.data.column.AbstractColumn.revertToDefault(Unknown Source)
at prefuse.data.Table.removeRow(Unknown Source)
at prefuse.data.Graph.removeEdge(Unknown Source)
at prefuse.data.Graph.removeNode(Unknown Source)
at prefuse.data.Tree.removeChild(Unknown Source)
at prefuse.data.Tree.removeChild(Unknown Source)
at de.sciss.synth.swing.NodeTreePanel.de$sciss$synth$swing$NodeTreePanel$$deleteChild(NodeTreePanel.scala:276)
at de.sciss.synth.swing.NodeTreePanel$$anonfun$de$sciss$synth$swing$NodeTreePanel$$nlRemoveNode$1.apply(NodeTreePanel.scala:327)
at de.sciss.synth.swing.NodeTreePanel$$anonfun$de$sciss$synth$swing$NodeTreePanel$$nlRemoveNode$1.apply(NodeTreePanel.scala:324)
at scala.Option.foreach(Option.scala:122)
at de.sciss.synth.swing.NodeTreePanel.de$sciss$synth$swing$NodeTreePanel$$nlRemoveNode(NodeTreePanel.scala:324)
at de.sciss.synth.swing.NodeTreePanel$$anonfun$2.apply(NodeTreePanel.scala:90)
at de.sciss.synth.swing.NodeTreePanel$$anonfun$2.apply(NodeTreePanel.scala:87)
at de.sciss.synth.Model$$anonfun$dispatch$1.apply(Model.scala:39)
at de.sciss.synth.Model$$anonfun$dispatch$1.apply(Model.scala:38)
at scala.collection.Iterator$class.foreach(Iterator.scala:627)
at scala.collection.LinearSeqLike$$anon$1.foreach(LinearSeqLike.scala:53)
at scala.collection.IterableLike$class.foreach(IterableLike.scala:80)
at scala.collection.immutable.Queue.foreach(Queue.scala:31)
at de.sciss.synth.Model$class.dispatch(Model.scala:38)
at de.sciss.synth.NodeManager.dispatch(NodeManager.scala:46)
at de.sciss.synth.NodeManager.de$sciss$synth$NodeManager$$dispatchBoth(NodeManager.scala:102)
at de.sciss.synth.NodeManager$$anonfun$nodeChange$1.apply(NodeManager.scala:80)
at de.sciss.synth.NodeManager$$anonfun$nodeChange$1.apply(NodeManager.scala:78)
at scala.Option.foreach(Option.scala:122)
at de.sciss.synth.NodeManager.nodeChange(NodeManager.scala:78)
at de.sciss.synth.Server$multiResponder$.de$sciss$synth$Server$multiResponder$$dispatchMessage(Server.scala:650)
at de.sciss.synth.Server$multiResponder$$anonfun$run$1.apply(Server.scala:645)
at de.sciss.synth.Server$multiResponder$$anonfun$run$1.apply(Server.scala:645)
at scala.collection.Iterator$class.foreach(Iterator.scala:627)
at scala.collection.LinearSeqLike$$anon$1.foreach(LinearSeqLike.scala:53)
at scala.collection.IterableLike$class.foreach(IterableLike.scala:80)
at scala.collection.immutable.Queue.foreach(Queue.scala:31)
at de.sciss.synth.Server$multiResponder$.run(Server.scala:645)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:633)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

29.04.2010 01:40:02 prefuse.action.ActionList run
WARNUNG: Row index out of bounds: -1
java.lang.IllegalArgumentException: Row index out of bounds: -1
at prefuse.data.column.ObjectColumn.get(Unknown Source)
at prefuse.data.Table.get(Unknown Source)
at prefuse.data.tuple.TableTuple.get(Unknown Source)
at prefuse.action.layout.graph.NodeLinkTreeLayout.getParams(Unknown Source)
at prefuse.action.layout.graph.NodeLinkTreeLayout.apportion(Unknown Source)
at prefuse.action.layout.graph.NodeLinkTreeLayout.firstWalk(Unknown Source)
at prefuse.action.layout.graph.NodeLinkTreeLayout.firstWalk(Unknown Source)
at prefuse.action.layout.graph.NodeLinkTreeLayout.firstWalk(Unknown Source)
at prefuse.action.layout.graph.NodeLinkTreeLayout.run(Unknown Source)
at prefuse.action.ActionList.run(Unknown Source)
at prefuse.action.Action.run(Unknown Source)
at prefuse.activity.Activity.runActivity(Unknown Source)
at prefuse.activity.ActivityManager.run(Unknown Source)

java.lang.IllegalArgumentException: Row index out of bounds: -1
at prefuse.data.column.BooleanColumn.setBoolean(Unknown Source)
at prefuse.data.Table.setBoolean(Unknown Source)
at prefuse.visual.VisualTable.setValidated(Unknown Source)
at prefuse.visual.VisualTable.fireTableEvent(Unknown Source)
at prefuse.data.Table.handleColumnChanged(Unknown Source)
at prefuse.data.Table.columnChanged(Unknown Source)
at prefuse.data.column.AbstractColumn.fireColumnEvent(Unknown Source)
at prefuse.data.column.BooleanColumn.setBoolean(Unknown Source)
at prefuse.data.column.BooleanColumn.set(Unknown Source)
at prefuse.data.column.AbstractColumn.revertToDefault(Unknown Source)
at prefuse.data.Table.removeRow(Unknown Source)
at prefuse.data.CascadedTable.removeCascadedRow(Unknown Source)
at prefuse.data.CascadedTable$Listener.tableChanged(Unknown Source)
at prefuse.data.Table.fireTableEvent(Unknown Source)
at prefuse.data.Table.removeRow(Unknown Source)
at prefuse.data.Graph.removeNode(Unknown Source)
at prefuse.data.Tree.removeChild(Unknown Source)
at prefuse.data.Tree.removeChild(Unknown Source)
at de.sciss.synth.swing.NodeTreePanel.de$sciss$synth$swing$NodeTreePanel$$deleteChild(NodeTreePanel.scala:276)
at de.sciss.synth.swing.NodeTreePanel$$anonfun$de$sciss$synth$swing$NodeTreePanel$$nlRemoveNode$1.apply(NodeTreePanel.scala:327)
at de.sciss.synth.swing.NodeTreePanel$$anonfun$de$sciss$synth$swing$NodeTreePanel$$nlRemoveNode$1.apply(NodeTreePanel.scala:324)
at scala.Option.foreach(Option.scala:122)
at de.sciss.synth.swing.NodeTreePanel.de$sciss$synth$swing$NodeTreePanel$$nlRemoveNode(NodeTreePanel.scala:324)
at de.sciss.synth.swing.NodeTreePanel$$anonfun$2.apply(NodeTreePanel.scala:90)
at de.sciss.synth.swing.NodeTreePanel$$anonfun$2.apply(NodeTreePanel.scala:87)
at de.sciss.synth.Model$$anonfun$dispatch$1.apply(Model.scala:39)
at de.sciss.synth.Model$$anonfun$dispatch$1.apply(Model.scala:38)
at scala.collection.Iterator$class.foreach(Iterator.scala:627)
at scala.collection.LinearSeqLike$$anon$1.foreach(LinearSeqLike.scala:53)
at scala.collection.IterableLike$class.foreach(IterableLike.scala:80)
at scala.collection.immutable.Queue.foreach(Queue.scala:31)
at de.sciss.synth.Model$class.dispatch(Model.scala:38)
at de.sciss.synth.NodeManager.dispatch(NodeManager.scala:46)
at de.sciss.synth.NodeManager.de$sciss$synth$NodeManager$$dispatchBoth(NodeManager.scala:102)
at de.sciss.synth.NodeManager$$anonfun$nodeChange$1.apply(NodeManager.scala:80)
at de.sciss.synth.NodeManager$$anonfun$nodeChange$1.apply(NodeManager.scala:78)
at scala.Option.foreach(Option.scala:122)
at de.sciss.synth.NodeManager.nodeChange(NodeManager.scala:78)
at de.sciss.synth.Server$multiResponder$.de$sciss$synth$Server$multiResponder$$dispatchMessage(Server.scala:650)
at de.sciss.synth.Server$multiResponder$$anonfun$run$1.apply(Server.scala:645)
at de.sciss.synth.Server$multiResponder$$anonfun$run$1.apply(Server.scala:645)
at scala.collection.Iterator$class.foreach(Iterator.scala:627)
at scala.collection.LinearSeqLike$$anon$1.foreach(LinearSeqLike.scala:53)
at scala.collection.IterableLike$class.foreach(IterableLike.scala:80)
at scala.collection.immutable.Queue.foreach(Queue.scala:31)
at de.sciss.synth.Server$multiResponder$.run(Server.scala:645)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:633)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
[/code]

Discussion

  • sciss
    sciss
    2010-04-29

    • status: open --> closed-works-for-me
     
  • sciss
    sciss
    2010-04-29

    Okay, after digging into the code (very cleanly written, i must say!), i figured that the ActivityManager is running on its own Thread which is not the AWT event thread, and that the Activities are run synchronized on the Visualization. After wrapping my graph manipulation code in vis.synchronized { } blocks, the exceptions are gone. It looks like that solved the issues.