testing.physicsEngine.guiTest
Class TestingUtilities

java.lang.Object
  extended by testing.physicsEngine.guiTest.TestingUtilities

public class TestingUtilities
extends java.lang.Object

Utility class for guiTests. Contains many static methods that are shared by various testing code.

Author:
Peng Shi

Constructor Summary
TestingUtilities()
           
 
Method Summary
static void drawPoints(java.awt.Graphics2D g, java.util.List<Vector2f> intersection)
           
static void drawWorld(java.awt.Graphics2D g, java.util.List<GeometricParameters> myParameters)
          Calls drawWorld with defaultColor for everything.
static void drawWorld(java.awt.Graphics2D g, java.util.List<GeometricParameters> myParameters, java.util.Map<GeometricParameters,java.awt.Color> parameterColor)
          Render the underlying physical world.
static void fillCircle(java.awt.Graphics2D g, Vector2f point, int radius, java.awt.Color color)
          Fill a given circle.
static javax.swing.JFrame getJFrame(javax.swing.JPanel panel, int width, int height)
          Obtain a JFrame window embedding the given panel, with given width and height.
static void testIntersection(java.awt.Graphics2D g, GeometricParameters a, GeometricParameters b)
          Test the intersection of two GeometricParameters, drawing the intersection points
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestingUtilities

public TestingUtilities()
Method Detail

fillCircle

public static void fillCircle(java.awt.Graphics2D g,
                              Vector2f point,
                              int radius,
                              java.awt.Color color)
Fill a given circle.

Parameters:
g -
point - centroid of the circle
radius -
color -

testIntersection

public static void testIntersection(java.awt.Graphics2D g,
                                    GeometricParameters a,
                                    GeometricParameters b)
Test the intersection of two GeometricParameters, drawing the intersection points

Parameters:
g -
a -
b -

drawPoints

public static void drawPoints(java.awt.Graphics2D g,
                              java.util.List<Vector2f> intersection)
Parameters:
intersection -

drawWorld

public static void drawWorld(java.awt.Graphics2D g,
                             java.util.List<GeometricParameters> myParameters,
                             java.util.Map<GeometricParameters,java.awt.Color> parameterColor)
Render the underlying physical world.

Parameters:
g -
myParameters -
parameterColor -

drawWorld

public static void drawWorld(java.awt.Graphics2D g,
                             java.util.List<GeometricParameters> myParameters)
Calls drawWorld with defaultColor for everything.

Parameters:
g -
myParameters -

getJFrame

public static javax.swing.JFrame getJFrame(javax.swing.JPanel panel,
                                           int width,
                                           int height)
Obtain a JFrame window embedding the given panel, with given width and height.

Parameters:
panel -
width -
height -
Returns: