Runs instance of the JPWorld
component inside the stand-alone application with own JFrame
.
More...
Public Member Functions | |
RunStandalone () | |
Adds main component JPWorld to the content pane. | |
Static Public Member Functions | |
static void | main (String[] args) |
Main program entry that creates and shows GUI. | |
Private Attributes | |
JPWorld | wopComponent = new JPWorld () |
Main component is instance of the JPWorld . | |
Static Private Attributes | |
static final long | serialVersionUID = -6852878245259708233L |
Implements java.io.Serializable interface. |
Runs instance of the JPWorld
component inside the stand-alone application with own JFrame
.
Definition at line 15 of file RunStandalone.java.
RunStandalone.RunStandalone | ( | ) |
Adds main component JPWorld
to the content pane.
Definition at line 30 of file RunStandalone.java.
References JPWorld.startTests(), and wopComponent.
Referenced by main().
{ super( "IP1-1.1: Multithreaded World of Particles (inefficient but educational)" ); setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE ); /* Adjust window dimensions not to exceed screen dimensions ... */ Dimension win = new Dimension( 1024, 600 ); Dimension scsz = Toolkit.getDefaultToolkit().getScreenSize(); win.width = Math.min( win.width, scsz.width ); win.height = Math.min( win.height, scsz.height - 40 ); setSize( win ); setMinimumSize( new Dimension( 330, 100 ) ); /* ... then center window on the screen. */ setLocation( ( scsz.width - win.width )/2, ( scsz.height - 40 - win.height )/2 ); /* Register the thread tester component, then make frame visible */ add( wopComponent ); addKeyListener( wopComponent ); setVisible( true ); /* Start T1 & T2 tests delayed for 1 sec */ wopComponent.startTests( 1f /*sec delay*/ ); }
static void RunStandalone.main | ( | String[] | args ) | [static] |
Main program entry that creates and shows GUI.
args | main program arguments |
Definition at line 67 of file RunStandalone.java.
References RunStandalone().
{ /* Create and show GUI */ Runnable doCreateAndShowGUI = new Runnable () { public void run () { new RunStandalone (); } }; SwingUtilities.invokeLater( doCreateAndShowGUI ); }
final long RunStandalone.serialVersionUID = -6852878245259708233L [static, private] |
Implements java.io.Serializable interface.
Definition at line 20 of file RunStandalone.java.
JPWorld RunStandalone.wopComponent = new JPWorld () [private] |
Main component is instance of the JPWorld
.
Definition at line 25 of file RunStandalone.java.
Referenced by RunStandalone().