testing.physicsEngine.guiTest
Class PegTest

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

public class PegTest
extends AbstractTestEnvironment

A Plinko-type simulation in which balls can be dropped by clicking on the view at any location.

Author:
Alex Sloan

Field Summary
 
Fields inherited from class testing.physicsEngine.guiTest.AbstractTestEnvironment
DISPLAY_HEIGHT, DISPLAY_WIDTH, loopCount, myNewBodies, needsReset, recentUserActivity
 
Constructor Summary
PegTest()
           
 
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

PegTest

public PegTest()
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

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

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

main

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