Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [gef-dev] FigureCanvas and Viewport


The Figure inside the Viewport must return the appropriate preferredSize().  One way to do this is to use an XYLayout.
Another way is to use a FreeformLayer as the Viewports contents.  But you must also use a FreeformViewport.



"Tomas Pinos" <tomas@xxxxxxxxxxxxxxx>
Sent by: gef-dev-admin@xxxxxxxxxxx

11/08/2002 09:58 AM
Please respond to gef-dev

       
        To:        <gef-dev@xxxxxxxxxxx>
        cc:        
        Subject:        Re: [gef-dev] FigureCanvas and Viewport

       


Hi,
 
I experienced the same "problem". You write that your figure contains a number of images - how do you calculate their preferred size and the size of their parent figure? Have you implemented a special layout for it? I would suggest to check the figure sizes - if they were "large" enough, the canvas would scroll probably.
 
Hope it helps,
Tomas
 
----- Original Message -----
From: Joel G Rivera-Gonzalez
To: gef-dev@xxxxxxxxxxx
Sent: Friday, November 08, 2002 12:15 AM
Subject: [gef-dev] FigureCanvas and Viewport

Hello to all
 
All right here is the deal…
I need to do an application using draw2d.  Everything is going smoothly until I tried to implement scrollbar functionality on the application.  I am trying to use FigureCanvas (canvas) and Viewport (viewport).  The viewport contains n number of images.  Those images can be move around the canvas, so I need to expand and shrink it as needed…The scroll area (the canvas) should be the size of the shell and the viewport should be as big as needed…the problem is I thought that if the viewport is bigger than the canvas it should allow you to scroll around…but this is not happening…any one have a suggestion?
 
Here is more-or-less what I’m doing….
 
      FigureCanvas canvas = new FigureCanvas(shell);
Viewport vp = new Viewport();
      ...
      vp.setSize(1000, 1000);
...
canvas.setSize(500,  500);
      canvas.setScrollBarVisibility(FigureCanvas.ALWAYS);
      ...
canvas.setContents(vp);
      ...  
      shell.open();
      shell.pack();
 
 
Thanks…


Best Regards,
Joel
--------------------------------------
Joel G Rivera-Gonzalez
IBM TJ Watson Research Center
19 Skyline Dr
Hawthorne, NY 10532-2119


Back to the top