Login  Register

Re: Mac Canvas3D location bug

Posted by Sven Gothel on Oct 07, 2013; 2:30pm
URL: https://forum.jogamp.org/Mac-Canvas3D-location-bug-tp4030052p4030188.html

On 10/07/2013 04:26 PM, Manu [via jogamp] wrote:

> Sorry, I spoke a little too fast about applets. Moving a 3D canvas in an
> applet doesn't work all the time.
> When you try to move horizontally the canvas 3D with the splitter of the
> following example, its location isn't always correct.
>
> import java.awt.GraphicsEnvironment;
> import javax.media.j3d.*;
> import javax.swing.*;
> import com.sun.j3d.utils.universe.SimpleUniverse;
>
> public class Canvas3DPositionTest extends JApplet {
>   public void init() {
>     // Create a new canvas 3D
>     GraphicsConfigTemplate3D gc = new GraphicsConfigTemplate3D();
>     Canvas3D canvas = new Canvas3D(GraphicsEnvironment.getLocalGraphicsEnvironment().
>         getDefaultScreenDevice().getBestConfiguration(gc));
>     new SimpleUniverse(canvas);
>
>     // Build a GUI where the canvas 3D is located at top right of the frame
>     // and can be resized with split panes dividers
>     JSplitPane verticalSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT,
>         true, new JScrollPane(), canvas);    
>     verticalSplitPane.setResizeWeight(0.5);
>     JSplitPane horizontalSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
>         true, new JScrollPane(), verticalSplitPane);
>     horizontalSplitPane.setResizeWeight(0.5);
>     JRootPane intermediateRootPane = new JRootPane();
>     intermediateRootPane.setContentPane(horizontalSplitPane);
>     add(intermediateRootPane);
>   }
> }
>
Can you please reference the now existing unit tests ? Thank you!

>
> Be sure to test under Java 6 and 7 because the applet doesn't behave the same
> in a browser.

Don't know how to test applets w/ java6 in a browser when java7 is installed.

~Sven



signature.asc (911 bytes) Download Attachment