[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] SWT and Java3D - Resize problem

Hi all.

In Swing, if I set a frame as BorderLayout and add a universe(canvas3d) to it, then if the frame is resized, the universe is resized too with according scale. for e.g., if there is a ball with large size in the center of universe, and if the frame is resize to smaller, then the whole universe is resized accordingly too and you still can see the ball with large size (scaled of course) in the center of universe no matter how small the frame is resized to.

However, in SWT, the universe doesn't react like that when a shell is resized. if I make the height of the shell which contains the universe half, then the universe won't scale accordingly and you can only see half of the ball in the universe.

Any way to achieve the same effect as we do in SWING for the universe resizing?

Thanks

Xinuo

Code:

SWT_AWT_container = new Composite(parent, SWT.EMBEDDED);
SWT_AWT_container.setLayout(new FillLayout()); awt = SWT_AWT.new_Frame(SWT_AWT_container);
awt.setLayout(new BorderLayout());
GraphicsConfiguration gconf3d = SimpleUniverse.getPreferredConfiguration();
canvas = new Canvas3D(gconf3d);
awt.add(canvas, BorderLayout.CENTER);