Pasi:
This could be a different problem. Are you using 2 universes? Please
send us a test program.
Thanks
Uma
Java3D Team
----- Begin Included Message -----
>From [EMAIL PROTECTED] Thu Feb 10 07:26:05 2000
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Priority: 3
X-MSMail-Priority: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
Date: Thu, 10 Feb 2000 14:52:01 +0200
From: Pasi Paasiala <[EMAIL PROTECTED]>
Subject: Re: [JAVA3D] maybe new BUG ?
To: [EMAIL PROTECTED]
This problem appears also when setting the scheduling bounds more than once.
java.lang.IndexOutOfBoundsException: Index: -1, Size: 0
at java.util.ArrayList.RangeCheck(ArrayList.java:490)
at java.util.ArrayList.remove(ArrayList.java:372)
at
javax.media.j3d.BoundingLeafRetained.removeUser(BoundingLeafRetained.java:18
5)
at
javax.media.j3d.BehaviorRetained.setSchedulingBoundingLeaf(BehaviorRetained.
java:168)
at
javax.media.j3d.Behavior.setSchedulingBoundingLeaf(Behavior.java:181)
Pasi
----- Original Message -----
From: Daniel del Río <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 07, 2000 2:06 AM
Subject: [JAVA3D] maybe new BUG ?
> Hi everyone,
>
> The problem arises when two or more Universes are working together, then
> if the ColoringAttributes from one shape is changed (under some
> circumstances) the following message is showed:
>
> --------------------------------------------------------------------------
-------------------------------------
>
> java.lang.IndexOutOfBoundsException: Index: -1, Size: 0
> at java.util.ArrayList.RangeCheck(ArrayList.java, Compiled Code)
>
> at java.util.ArrayList.remove(ArrayList.java:372)
> at
> javax.media.j3d.RenderMolecule.addRenderAtom(RenderMolecule.java:851)
>
> at
> javax.media.j3d.RenderBin.findRenderMolecule(RenderBin.java:3115)
> at
> javax.media.j3d.RenderBin.reInsertRenderAtom(RenderBin.java:2627)
> at
>
javax.media.j3d.RenderBin.processRenderMoleculeNodeComponentChanged(RenderBi
n.java:1000)
>
> at javax.media.j3d.RenderBin.processMessages(RenderBin.java:759)
>
> at
>
javax.media.j3d.StructureUpdateThread.doWork(StructureUpdateThread.java:79)
>
> at javax.media.j3d.J3dThread.run(J3dThread.java:256)
> --------------------------------------------------------------------------
-------------------------------------
>
> This code reproduces the bug pressing two times the "Change Color"
> Button: (only tested for W98 and Java3D 1.2 Beta1).
>
> kind regards
> Dani del Rio.
> ---------------------------------------------
>
> import javax.swing.*;
> import javax.swing.event.*;
> import java.awt.*;
> import java.awt.event.*;
> import javax.media.j3d.*;
> import javax.vecmath.Color3f;
> import com.sun.j3d.utils.geometry.Box;
> import com.sun.j3d.utils.universe.*;
>
> public class TestBug {
>
> private Appearance app;
> private ColoringAttributes ca;
> private PolygonAttributes pa;
> private Box box;
>
> public TestBug() {
>
> createAppearance();
> box = new Box(0.2f, 0.2f, 0.2f, app);
> BranchGroup root = new BranchGroup();
> root.addChild(box);
>
> GraphicsConfiguration config =
> SimpleUniverse.getPreferredConfiguration();
> Canvas3D canvas = new Canvas3D(config);
> canvas.setSize(new Dimension(400, 300));
> SimpleUniverse universe = new SimpleUniverse(canvas);
>
> universe.getViewingPlatform().setNominalViewingTransform();
> universe.addBranchGraph(root);
>
> JButton b1 = new JButton("Change Color");
> b1.addActionListener(new ActionListener() {
> public void actionPerformed(ActionEvent e) {
> ca.setColor(1.0f, 1.0f, 0.0f);
> }
> });
>
> JFrame frame = new JFrame("Frame 1");
> frame.addWindowListener(new WindowAdapter() {
> public void windowClosing(WindowEvent e) {
> System.exit(0);
> }
> });
> Container pane1 = frame.getContentPane();
> pane1.add(canvas, BorderLayout.CENTER);
> pane1.add(b1, BorderLayout.SOUTH);
> frame.setSize(new Dimension(400, 300));
> frame.pack();
> frame.setVisible(true);
>
> // ***************************************
> // ***************************************
> Canvas3D c = new Canvas3D(config);
> c.setSize(new Dimension(400, 300));
> SimpleUniverse uni = new SimpleUniverse(c);
> uni.getViewingPlatform().setNominalViewingTransform();
>
> JButton button = new JButton("Change Color");
> button.addActionListener(new ActionListener() {
> public void actionPerformed(ActionEvent e) {
> ca.setColor(0.0f, 1.0f, 1.0f);
> }
> });
> JFrame f = new JFrame("Frame 2");
> Container pane = f.getContentPane();
> pane.add(c, BorderLayout.CENTER);
> pane.add(button, BorderLayout.SOUTH);
> f.setSize(new Dimension(400, 300));
> f.pack();
> f.setVisible(true);
> }
>
> private void createAppearance() {
> app = new Appearance();
>
> app.setCapability(Appearance.ALLOW_COLORING_ATTRIBUTES_READ);
>
> app.setCapability(Appearance.ALLOW_COLORING_ATTRIBUTES_WRITE);
>
> pa = new PolygonAttributes();
> pa.setPolygonMode(PolygonAttributes.POLYGON_LINE);
> pa.setCullFace(PolygonAttributes.CULL_NONE);
> app.setPolygonAttributes(pa);
>
> ca = new ColoringAttributes();
> ca.setCapability(ColoringAttributes.ALLOW_COLOR_READ);
> ca.setCapability(ColoringAttributes.ALLOW_COLOR_WRITE);
> app.setColoringAttributes(ca);
> }
>
> public static void main(String[] args) {
> TestBug test = new TestBug();
> }
> }
>
>
===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff JAVA3D-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".
----- End Included Message -----
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".