Go to the documentation of this file.00001
00002 import java.awt.Dimension;
00003 import java.awt.Toolkit;
00004
00005 import javax.swing.JFrame;
00006 import javax.swing.SwingUtilities;
00007
00008
00009
00010
00011
00012
00013
00014
00015 public class RunStandalone extends JFrame
00016 {
00017
00018
00019
00020 private static final long serialVersionUID = -6852878245259708233L;
00021
00022
00023
00024
00025 private JPWorld wopComponent = new JPWorld ();
00026
00027
00028
00029
00030 public RunStandalone ()
00031 {
00032 super(
00033 "IP1-1.1: Multithreaded World of Particles (inefficient but educational)"
00034 );
00035
00036 setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
00037
00038
00039
00040 Dimension win = new Dimension( 1024, 600 );
00041 Dimension scsz = Toolkit.getDefaultToolkit().getScreenSize();
00042 win.width = Math.min( win.width, scsz.width );
00043 win.height = Math.min( win.height, scsz.height - 40 );
00044 setSize( win );
00045 setMinimumSize( new Dimension( 330, 100 ) );
00046
00047
00048
00049 setLocation( ( scsz.width - win.width )/2, ( scsz.height - 40 - win.height )/2 );
00050
00051
00052
00053 add( wopComponent );
00054 addKeyListener( wopComponent );
00055 setVisible( true );
00056
00057
00058
00059 wopComponent.startTests( 1f );
00060 }
00061
00062
00063
00064
00065
00066
00067 public static void main( String[] args )
00068 {
00069
00070
00071 Runnable doCreateAndShowGUI = new Runnable () {
00072 public void run () {
00073 new RunStandalone ();
00074 }
00075 };
00076
00077 SwingUtilities.invokeLater( doCreateAndShowGUI );
00078 }
00079 }