Menu

expand graph layout to fit JFrame Size

JIT
2005-06-29
2013-05-29
  • JIT

    JIT - 2005-06-29

    If I use JFrame, I'd have to use:

    frame.pack();
    frame.show();

    to let the whole thing appear. I actually want the graph layout to be the size I want to set when it appears, not some standard size. Which part of the code do I need to look at?

    To make the question more clear, I want from :
    http://www.doc.ic.ac.uk/~ijt04/original.jpg

    to:
    http://www.doc.ic.ac.uk/~ijt04/preference.jpg

    Dumb question but thanks anyway! :)

     
    • Joshua O'Madadhain

      I'm not sure what your "original" and "preference" are trying to show.  Are you saying that you want the dimension of your layout to be a specific size?  If so, see Layout.resize().

      Joshua

       
    • JIT

      JIT - 2005-06-30

      Thanks! I used this and this is exactly what I want. But another problem arises..

      ISOMLayout layout = new ISOMLayout(graph) ;
             layout.resize(new Dimension(900,1600));
             vv =  new VisualizationViewer(layout, pr);

      When I use this, the ISOMLayout seems to be not the way it used to be.. Any suggestions?

      see:
      http://www.doc.ic.ac.uk/~ijt04/change1.jpg

       
      • Joshua O'Madadhain

        Like the rest of our current layout algorithms, ISOMLayout works based on a random initial layout, and some inputs are more problematic for some of our algorithms.  Try running your test again--or re-laying-out the algorithm inside your test--and see if things improve.

        Joshua

         
    • JIT

      JIT - 2005-06-30

      Thanks Joshua,

      I will try to treak it.

      I am also trying to find a good layout for my data (protein interaction networks) The best one seems to be the SpringEmbedded layout which is a implementation of KK layout.

      Have you guys implemented this before? If not I may have to write it from scratch :'(

      :) Thanks again

      J

       
      • D. Fisher

        D. Fisher - 2005-07-01

        We have a KKLayout... what are you asking for?

         
    • Nobody/Anonymous

      I am trying to implement a better version of KK layout from GINY:

      http://csbi.sourceforge.net/screenshots.html (something like this..)

      GINY's code is very similar to JUNG, but I have some problem implementing it..

      Just a suggestion that the KK layout in GINY can be adapted to the KK layout in JUNG?

      It would be sooo good if sch layout is implmented in JUNG..

       
    • Nobody/Anonymous

      Hi,

      If you have implemented a better version of KK layout then plz provide sample code in forum so that it would be usefull to other people also.

      Thanks

       

Log in to post a comment.