testing.physicsEngine.guiTest
Class SeesawTest

java.lang.Object
  extended by testing.physicsEngine.guiTest.AbstractTestEnvironment
      extended by testing.physicsEngine.guiTest.SeesawTest

public class SeesawTest
extends AbstractTestEnvironment

A demo that shows how a rotating system is implemented using the physics engine. The rotational damping can be tweaked from the view, and gravity can be turned on or off.

Author:
Alex Sloan

Field Summary
 
Fields inherited from class testing.physicsEngine.guiTest.AbstractTestEnvironment
DISPLAY_HEIGHT, DISPLAY_WIDTH, loopCount, myNewBodies, needsReset, recentUserActivity
 
Constructor Summary
SeesawTest()
           
 
Method Summary
protected  void drawGUItext(java.awt.Graphics2D g)
          Demo customisable GUI render
(package private)  java.util.List<PhysicalParameters> initBodies()
          This method must be implemented by extending classes, it returns the list of PhysicalParameters representing each of the bodies in the world, set to their initial positions.
(package private)  PhysicsEngine initEngine()
          This method must be implemented by extending classes, and returns the PhysicsEngine properly initialized.
protected  void keyHit(char c)
          Notification that a key was pressed
static void main(java.lang.String[] args)
           
protected  void mouseClick(java.awt.Point p)
          Notification that the mouse was clicked
 
Methods inherited from class testing.physicsEngine.guiTest.AbstractTestEnvironment
createWalls, run, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SeesawTest

public SeesawTest()
Method Detail

initBodies

java.util.List<PhysicalParameters> initBodies()
Description copied from class: AbstractTestEnvironment
This method must be implemented by extending classes, it returns the list of PhysicalParameters representing each of the bodies in the world, set to their initial positions.

Specified by:
initBodies in class AbstractTestEnvironment

initEngine

PhysicsEngine initEngine()
Description copied from class: AbstractTestEnvironment
This method must be implemented by extending classes, and returns the PhysicsEngine properly initialized.

Specified by:
initEngine in class AbstractTestEnvironment

mouseClick

protected void mouseClick(java.awt.Point p)
Description copied from class: AbstractTestEnvironment
Notification that the mouse was clicked

Overrides:
mouseClick in class AbstractTestEnvironment
Parameters:
p - The point at which the mouse was clicked

keyHit

protected void keyHit(char c)
Description copied from class: AbstractTestEnvironment
Notification that a key was pressed

Overrides:
keyHit in class AbstractTestEnvironment
Parameters:
c - The character of key hit

drawGUItext

protected void drawGUItext(java.awt.Graphics2D g)
Description copied from class: AbstractTestEnvironment
Demo customisable GUI render

Overrides:
drawGUItext in class AbstractTestEnvironment
Parameters:
g - The graphics context to use for rendering here

main

public static void main(java.lang.String[] args)