package PCG.HomeWork1;

// import java awt/swing packages
import javax.swing.UIManager;

/**
 * Überschrift:   1. Aufgabe: Elementare Java3D Programmierung
 * Beschreibung:  Ziel dieser Aufgabe ist es, eine Java3D-Szene aufzubauen.
 *                Dazu sollen unterschiedliche Techniken, die Java3D anbietet,
 *                genutzt werden (z.B. "Level Of Detail", Interpolatoren,
 *                Picking, Loader, ...).
 * Copyright:     Copyright (c) 2001
 * Organisation:
 * @author Fabian Wleklinski (fabian@wleklinski.de)
 * @version 1.0
 */
public class HomeWork1 {

        /**
         * Constructor.
         */
        public HomeWork1() {

                // Create a new instance of the main frame, which contains all
                // the valueable stuff of this application.
                MainFrame oFrame = new MainFrame();

                // set the size of the main frame to a medium large window.
                oFrame.setSize( 640, 480 );

                // Center the main frame on screen.
                this.centerFrame( oFrame );

                // now go and make the frame visible!
                oFrame.show();
        }

        /**
         * Centers the given frame on screen.
         */
        private void centerFrame( javax.swing.JFrame oFrame ) {
                java.awt.Dimension screenSize =
                        java.awt.Toolkit.getDefaultToolkit().getScreenSize();

                java.awt.Dimension frameSize = oFrame.getSize();

                if (frameSize.height > screenSize.height)
                        frameSize.height = screenSize.height;

                if (frameSize.width > screenSize.width)
                        frameSize.width = screenSize.width;

                oFrame.setLocation(
                        (screenSize.width - frameSize.width) / 2,
                        (screenSize.height - frameSize.height) / 2
                );
        }

        /**
         * Main method, does the main thing :-)
         */
        public static void main(String[] args) {
                try {
                        UIManager.setLookAndFeel(
                                UIManager.getSystemLookAndFeelClassName() );
                } catch( Exception curException ) {
                        curException.printStackTrace();
                }
                new HomeWork1();
        }
}