|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttesting.physicsEngine.guiTest.AbstractTestEnvironment
public abstract class AbstractTestEnvironment
Abstract class that is used to create basic simulations using the physics engine (for testing and demo purposes). This renders simple shapes without using the game engine framework.
Field Summary | |
---|---|
protected static int |
DISPLAY_HEIGHT
|
protected static int |
DISPLAY_WIDTH
|
protected int |
loopCount
|
protected java.util.List<PhysicalParameters> |
myNewBodies
|
protected boolean |
needsReset
|
protected java.lang.String |
recentUserActivity
|
Constructor Summary | |
---|---|
AbstractTestEnvironment(java.lang.String title)
Create an AbstractTestEnvironment of given title. |
Method Summary | |
---|---|
protected java.util.List<PhysicalParameters> |
createWalls(int wallThickness)
|
protected void |
drawGUItext(java.awt.Graphics2D g)
Demo customisable GUI render |
(package private) abstract 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) abstract 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 |
protected void |
mouseClick(java.awt.Point p)
Notification that the mouse was clicked |
void |
run()
Initializes and runs the simulation. |
protected void |
stop()
Stops the simulation |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int DISPLAY_WIDTH
protected static final int DISPLAY_HEIGHT
protected boolean needsReset
protected java.lang.String recentUserActivity
protected java.util.List<PhysicalParameters> myNewBodies
protected int loopCount
Constructor Detail |
---|
public AbstractTestEnvironment(java.lang.String title)
title
- Method Detail |
---|
protected void stop()
abstract PhysicsEngine initEngine()
abstract java.util.List<PhysicalParameters> initBodies()
protected void drawGUItext(java.awt.Graphics2D g)
g
- The graphics context to use for rendering herepublic void run()
protected void mouseClick(java.awt.Point p)
p
- The point at which the mouse was clickedprotected void keyHit(char c)
c
- The character of key hitprotected java.util.List<PhysicalParameters> createWalls(int wallThickness)
wallThickness
- the thickness of the walls
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |