import com.sun.j3d.utils.geometry.ColorCube;
import javax.media.j3d.BranchGroup;
import com.sun.j3d.utils.universe.SimpleUniverse;
import javax.media.j3d.Canvas3D;
import javax.swing.*;

import java.util.*;
import java.awt.*;
/**
 * Insert the type's description here.
 * Creation date: (19.09.00 12:53:46)
 * @author:
 */
class JSplitPaneTest2 extends JFrame {
        private JPanel ivjJFrameContentPane = null;
        private JPanel ivjJPanel1 = null;
        private JSplitPane ivjJSplitPane1 = null;
        private JTree ivjJTree1 = null;
/**
 * JSplitPaneTest constructor comment.
 */
public JSplitPaneTest2() {
        super();
        initialize();
}
/**
 * JSplitPaneTest constructor comment.
 * @param title java.lang.String
 */
public JSplitPaneTest2(String title) {
        super(title);
}
/**
 * Return the JFrameContentPane property value.
 * @return javax.swing.JPanel
 */
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private javax.swing.JPanel getJFrameContentPane() {
        if (ivjJFrameContentPane == null) {
                try {
                        ivjJFrameContentPane = new javax.swing.JPanel();
                        ivjJFrameContentPane.setName("JFrameContentPane");
                        ivjJFrameContentPane.setLayout(new java.awt.BorderLayout());
                        getJFrameContentPane().add(getJSplitPane1(), "Center");
                        // user code begin {1}
                        // user code end
                } catch (java.lang.Throwable ivjExc) {
                        // user code begin {2}
                        // user code end
                        handleException(ivjExc);
                }
        }
        return ivjJFrameContentPane;
}
/**
 * Return the JPanel1 property value.
 * @return javax.swing.JPanel
 */
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private javax.swing.JPanel getJPanel1() {
        if (ivjJPanel1 == null) {
                try {
                        ivjJPanel1 = new javax.swing.JPanel();
                        ivjJPanel1.setName("JPanel1");
                        ivjJPanel1.setLayout(new java.awt.BorderLayout());
                        // user code begin {1}
                                Canvas3D c3d = new MyCanvas3D();
                                ivjJPanel1.add("Center", c3d);

                                BranchGroup bg = new BranchGroup();
                                bg.addChild(new ColorCube(0.4));
                                bg.compile();

                                SimpleUniverse su = new SimpleUniverse(c3d);
                                su.getViewingPlatform().setNominalViewingTransform();
                                su.addBranchGraph(bg);

                        // user code end
                } catch (java.lang.Throwable ivjExc) {
                        // user code begin {2}
                        // user code end
                        handleException(ivjExc);
                }
        }
        return ivjJPanel1;
}
/**
 * Return the JSplitPane1 property value.
 * @return javax.swing.JSplitPane
 */
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private javax.swing.JSplitPane getJSplitPane1() {
        if (ivjJSplitPane1 == null) {
                try {
                        ivjJSplitPane1 = new javax.swing.JSplitPane(javax.swing.JSplitPane.HORIZONTAL_SPLIT);
                        ivjJSplitPane1.setName("JSplitPane1");

                        //ajp  set continuous layout to tru
                        ivjJSplitPane1.setContinuousLayout(true);

                        getJSplitPane1().add(getJTree1(), "left");
                        getJSplitPane1().add(getJPanel1(), "right");
                        // user code begin {1}
                        // user code end
                } catch (java.lang.Throwable ivjExc) {
                        // user code begin {2}
                        // user code end
                        handleException(ivjExc);
                }
        }
        return ivjJSplitPane1;
}
/**
 * Return the JTree1 property value.
 * @return javax.swing.JTree
 */
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private javax.swing.JTree getJTree1() {
        if (ivjJTree1 == null) {
                try {
                        ivjJTree1 = new javax.swing.JTree();
                        ivjJTree1.setName("JTree1");
                        // user code begin {1}
                        // user code end
                } catch (java.lang.Throwable ivjExc) {
                        // user code begin {2}
                        // user code end
                        handleException(ivjExc);
                }
        }
        return ivjJTree1;
}
/**
 * Called whenever the part throws an exception.
 * @param exception java.lang.Throwable
 */
private void handleException(java.lang.Throwable exception) {

        /* Uncomment the following lines to print uncaught exceptions to stdout */
        // System.out.println("--------- UNCAUGHT EXCEPTION ---------");
        // exception.printStackTrace(System.out);
}
/**
 * Initialize the class.
 */
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private void initialize() {
        try {
                // user code begin {1}
                // user code end
                setName("JSplitPaneTest");
                setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
                setSize(426, 240);
                setContentPane(getJFrameContentPane());
        } catch (java.lang.Throwable ivjExc) {
                handleException(ivjExc);
        }
        // user code begin {2}
        // user code end
}
/**
 * main entrypoint - starts the part when it is run as an application
 * @param args java.lang.String[]
 */
public static void main(java.lang.String[] args) {
        try {
                JSplitPaneTest2 aJSplitPaneTest;
                aJSplitPaneTest = new JSplitPaneTest2();
                aJSplitPaneTest.addWindowListener(new java.awt.event.WindowAdapter() {
                        public void windowClosing(java.awt.event.WindowEvent e) {
                                System.exit(0);
                        };
                });
                aJSplitPaneTest.setVisible(true);
        } catch (Throwable exception) {
                System.err.println("Exception occurred in main() of javax.swing.JFrame");
                exception.printStackTrace(System.out);
        }
}
}


class MyCanvas3D extends Canvas3D {

    public MyCanvas3D() {
        super(null);
    }

    /**
     * Returns the preferred allowable size of the Canvas3D.
     *
     * @return a Dimension of the preferred component size.
     */
    public Dimension getPreferredSize()
    {
        return new Dimension(200, 300);
    }

    /**
     * Returns the minimum allowable size of the Canvas3D.
     *
     * @return a Dimension of the minimum component size.
     */
    public Dimension getMinimumSize()
    {
        return new Dimension(0, 0);
    }

}



