freeze again :-(

  • George Tryfon

    George Tryfon - 2005-09-27


    Touchgraph freezes when I use it with JRE 1.5 and Swing.
    Then I can only terminate the application from the console.

    Does anybody use Touchgraph with JRE 1.5 and Swing, without the freeze problem?

    Thank you

    • bobruney

      bobruney - 2005-10-14

      Somebody once posted a solution for this problem.

      It was something like running the renderer in its own thread, though im not sure.

      Somebody also said, recompiling Touchgraph under Java 5 would work, but doesnt work for me.

      Has anybody come up with a solution on how to get Touchgraph running under 1.5 and would might want to share it with us?

      Its a shame, that it looks like Touchgraph will die, if no Java 1.5 support is implemented.

    • mksheoran

      mksheoran - 2005-10-17

      Hi George,
      I am working propertly with 1.5. There was a deadloack issue on 1.5 but I get rid from that by making some changes in TG API.

      >Its a shame, that it looks like Touchgraph will die, if no Java 1.5 support is implemented.
      In my opinion, It will not die.

      --Manoj Kr. Sheoran

      • whof

        whof - 2005-10-17

        Can you please post your fix?  I have the same freezing issue and recompiling under 1.5 does not fix it.  I may eventually switch to JUNG or Prefuse but I need at least a short term fix since I am using TouchGraph in a production application.

    • mksheoran

      mksheoran - 2005-10-19

      Hi folks,
      Everybody know about the Java 5+ TG deallock problem. I get rid from it at my end and solution made by me is:-

      1. Open  HVScroll.DScrollbar class in TG source
      2. Avoid call of super in setIvalue maethod and write your own code for that. Becuase lock occurs over here.

      public int getValue(){
                  return val;           
              public void setValue(int v) { doubleValue = v; super.setValue(v); }
              private int val=0;
              public void setIValue(int v) {
      //            super.setValue(v);

      Hope it will help you.

      • whof

        whof - 2005-10-24

        Thanks!  This seems to work.  I wonder how to get this patch into the main source distribution?

      • bobruney

        bobruney - 2005-10-28


        this was just what I was waiting for (i didnt have a clue on what the deadlock might have its root at).

        Thank you very much, for sharing the code!

        Ive tested Touchgraph for the last 30 minutes with Java 5 and it worked.


      • Edward Glen

        Edward Glen - 2005-11-11

        Thanks for the fix!... I was getting frustrated trying to locate the problem.

        If you're ever in Vancouver BC, send me a message.. I'll show you around town :)

    • mksheoran

      mksheoran - 2005-10-27

      I think issue is not that is located by me but issue is somewhere else it's just a JUGAAD.  There should not be a deadlock condition at all but happening and quite wrong. I thing provision can be maid in TGLayout.relax and etc but still need to drill-down more and hope Alex can help us better for the same.

    • mksheoran

      mksheoran - 2005-11-04

      Do you think TG is capable to handle thousands of nodes?   Have you tested it with thousand of nodes?


    • Geir Ove Grønmo

      I've just fixed a problem that caused a deadlock. TouchGraph uses several threads to update the GUI. This is not allowed in Swing, so several threads ended up locking on the TGPanel instance and the AWT objects. The patch below delegates all GUI repainting to the Swing thread, and thus avoids deadlock. The GUI is a *lot* faster with this patch too. :)

      Index: com/touchgraph/graphlayout/

      RCS file: /cvsroot/touchgraph/src/com/touchgraph/graphlayout/,v
      retrieving revision 1.20
      diff -r1.20
      > import javax.swing.SwingUtilities;
      <         tgPanel.repaintAfterMove();
      >     SwingUtilities.invokeLater(new Runnable() {
      >             public void run() {
      >           tgPanel.repaintAfterMove();
      >         }
      >       });
      Index: com/touchgraph/graphlayout/
      RCS file: /cvsroot/touchgraph/src/com/touchgraph/graphlayout/,v
      retrieving revision 1.16
      diff -r1.16
      > import javax.swing.*;
      <         new Thread() {
      >       SwingUtilities.invokeLater(new Runnable() {
      <         }.start();
      >         });
      <         new Thread() {
      >         SwingUtilities.invokeLater(new Runnable() {
      <         }.start();
      >         });
      <         new Thread() {
      >         SwingUtilities.invokeLater(new Runnable() {
      <         }.start();
      >         });
      Index: com/touchgraph/graphlayout/interaction/
      RCS file: /cvsroot/touchgraph/src/com/touchgraph/graphlayout/interaction/,v
      retrieving revision 1.22
      diff -r1.22
      <          Thread scrollThread = new Thread() {
      >          Runnable scrollThread = new Runnable() {
      <         scrollThread.start();
      >     SwingUtilities.invokeLater(scrollThread);


Log in to post a comment.