Package syn3d.ui.test

Source Code of syn3d.ui.test.TestSyn3D

/* ========================
* JSynoptic : a free Synoptic editor
* ========================
*
* Project Info:  http://jsynoptic.sourceforge.net/index.html
*
* This program is free software; you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Foundation;
* either version 2.1 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with this
* program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307, USA.
*
* (C) Copyright 2001-2004, by :
*     Corporate:
*         EADS Corporate Research Center
*     Individual:
*         Nicolas Brodu
*
* $Id: TestSyn3D.java,v 1.9 2005/06/14 13:13:54 ogor Exp $
*
* Changes
* -------
* 30-Mar-2004 : Creation date (NB)
*
*/
package syn3d.ui.test;

import java.awt.HeadlessException;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.JFrame;
import javax.swing.JScrollPane;

import syn3d.base.java3d.Java3DPluginManager;
import syn3d.builtin.java3d.Java3DSyn3DBuiltin;
import syn3d.ui.SceneGraphEditor;
import syn3d.ui.java3d.SceneGraphModelJava3D;
import syn3d.ui.SceneGraphTree;

/**
* @author nicolas
*
* To change the template for this generated type comment go to
* Window - Preferences - Java - Code Generation - Code and Comments
*/
public class TestSyn3D extends JFrame {

  protected SceneGraphTree sceneTree;
  protected SceneGraphEditor editor;
  public Java3DPluginManager pluginManager;
   
    /**
     * @param title
     * @throws java.awt.HeadlessException
     */
    public TestSyn3D(String title) throws HeadlessException {
        super(title);
        // arbitrary bounds
        setBounds(0,0,640,480);
       
       
        pluginManager = new Java3DPluginManager();
       
        SceneGraphModelJava3D tm = new SceneGraphModelJava3D();
    sceneTree = new SceneGraphTree(tm);
    sceneTree.setAutoHighlight(true);
    editor=new SceneGraphEditor(sceneTree, pluginManager);
   
    Java3DSyn3DBuiltin builtin = (Java3DSyn3DBuiltin)pluginManager.getPlugin(Java3DSyn3DBuiltin.class);
    builtin.createFromKey("Scene",tm.getRootNode());
        getContentPane().add(new JScrollPane(sceneTree));
        this.addWindowListener(new WindowAdapter(){
            public void windowClosing(WindowEvent e) {
                System.exit(0);
            }
        });
    }

    public static void main(String[] args) {

        System.out.println("This is a test for the Syn3D infrastructure.");
        System.out.println("Please make sure your java environment is properly configured with respect to Xith3D/Java3D. JSynoptic does automatic detection, but for this test you're on your own.");
        System.out.println("Optional arguments are fully qualified class names of Syn3D plugins to load.");
      
        TestSyn3D testSyn3D = new TestSyn3D("Test Syn3D");
       
        for (int i=0; i<args.length; ++i) {
          testSyn3D.pluginManager.register(args[i]);
        }
        testSyn3D.show();
    }
}
TOP

Related Classes of syn3d.ui.test.TestSyn3D

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.