|
CS 1705 Library | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Panel
java.applet.Applet
javax.swing.JApplet
objectdraw.Controller
objectdraw.WindowController
objectdraw.FrameWindowController
objectdraw.TestableWindowController
public class TestableWindowController
TestableWindowController is an FrameWindowController with various methods to assert things about the state of the Window.
| Field Summary |
|---|
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
TestableWindowController()
This constructor forces TestableWindowController to wait for the initial window to draw itself before exiting the constructor. |
|
| Method Summary | |
|---|---|
void |
assertHas2DObject(Class shape,
objectdraw.Location loc,
Double width,
Double height,
Color color,
Boolean visible)
assert version of has2DObject |
void |
assertHas2DObject(String hint,
Class shape,
objectdraw.Location loc,
Double width,
Double height,
Color color,
Boolean visible)
assert version of has2DObject that has a specific hint to the user. |
void |
assertHasLine(objectdraw.Location start,
objectdraw.Location end,
Color color,
Boolean visible)
assertHasLine asserts the existence of a line with the specified parameters. |
void |
assertHasLine(String hint,
objectdraw.Location start,
objectdraw.Location end,
Color color,
Boolean visible)
assertHasLine asserts the existence of a line with the specified parameters. |
void |
assertNo2DObject(Class shape,
objectdraw.Location loc,
Double width,
Double height,
Color color,
Boolean visible)
inverse of assertHas2DObject, this method will fail if an object specified by the parameters is found, suceed otherwise. |
void |
assertNo2DObject(String hint,
Class shape,
objectdraw.Location loc,
Double width,
Double height,
Color color,
Boolean visible)
inverse of assertHas2DObject, this method will fail if an object specified by the parameters is found, suceed otherwise. |
void |
assertNoLine(objectdraw.Location start,
objectdraw.Location end,
Color color,
Boolean visible)
assertNoLine asserts the non-existence of a line with the specified parameters. |
void |
assertNoLine(String hint,
objectdraw.Location start,
objectdraw.Location end,
Color color,
Boolean visible)
assertNoLine iasserts the non-existence of a line with the specified parameters. |
objectdraw.Drawable2DInterface |
get2DObject(Class shape,
objectdraw.Location loc,
Double width,
Double height,
Color color,
Boolean visible)
get2dObject returns an arbitrary shape that meets the specified parameters. |
List<objectdraw.Drawable2DInterface> |
get2DObjects(Class shape,
objectdraw.Location loc,
Double width,
Double height,
Color color,
Boolean visible)
get2dObject gets a list of 2D object with the specified parameters. |
objectdraw.DrawingCanvas |
getCanvas()
Accessor function to get the DrawingCanvas from the frame. |
JFrame |
getFrame()
Get the top-level JFrame component. |
objectdraw.Line |
getLine(objectdraw.Location start,
objectdraw.Location end,
Color color,
Boolean visible)
getLine returns an arbitrary Line object that fits the parameters that are passed to the function. |
List<objectdraw.Line> |
getLines(objectdraw.Location start,
objectdraw.Location end,
Color color,
Boolean visible)
getLines gets a list of lines with the specified parameters. |
boolean |
has2DObject(Class shape,
objectdraw.Location loc,
Double width,
Double height,
Color color,
Boolean visible)
has2dObject determines existence of a 2D object with the specified parameters. |
boolean |
hasLine(objectdraw.Location start,
objectdraw.Location end,
Color color,
Boolean visible)
hasLine returns determines the existence of a line with the specified parameters. |
void |
paint(Graphics g)
Paint gets called by the system whenever the application needs to be repainted. |
void |
waitForInit()
This method forces the program to wait on a thread to release the init lock. |
| Methods inherited from class objectdraw.WindowController |
|---|
begin, onMouseClick, onMouseDrag, onMouseEnter, onMouseExit, onMouseMove, onMousePress, onMouseRelease |
| Methods inherited from class objectdraw.Controller |
|---|
destroy, getAudio, getImage, getTime, getVersion, init, placeInFrame, resize, start, startController, startController, stop |
| Methods inherited from class javax.swing.JApplet |
|---|
getAccessibleContext, getContentPane, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, remove, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, update |
| Methods inherited from class java.applet.Applet |
|---|
getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, setStub, showStatus |
| Methods inherited from class java.awt.Panel |
|---|
addNotify |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public TestableWindowController()
| Method Detail |
|---|
public JFrame getFrame()
public void waitForInit()
public void paint(Graphics g)
paint in class objectdraw.FrameWindowController
public boolean has2DObject(Class shape,
objectdraw.Location loc,
Double width,
Double height,
Color color,
Boolean visible)
shape - the shape of the object. null for any shape.loc - the location of the object on the canvas, null for any
location.width - the width of the object, null for any width.height - the height of the object, null for any height.color - the color of the object, null for any color.visible - whether the object is visible on the canvas or not.
pass null, if either.
public objectdraw.Drawable2DInterface get2DObject(Class shape,
objectdraw.Location loc,
Double width,
Double height,
Color color,
Boolean visible)
shape - the shape of the object. null for any shape.loc - the location of the object on the canvas, null for any
location.width - the width of the object, null for any width.height - the height of the object, null for any height.color - the color of the object, null for any color.visible - whether the object is visible on the canvas or not.
pass null, if either.
public objectdraw.Line getLine(objectdraw.Location start,
objectdraw.Location end,
Color color,
Boolean visible)
start - the starting point of the line, null for any starting locationend - the end location of the line, null for any end locationcolor - the color of the line, null for any color.visible - whether the line is visible on the canvas or not.
pass null, if either.
public List<objectdraw.Drawable2DInterface> get2DObjects(Class shape,
objectdraw.Location loc,
Double width,
Double height,
Color color,
Boolean visible)
shape - the shape of the object. null for any shape.loc - the location of the object on the canvas, null for any
location.width - the width of the object, null for any width.height - the height of the object, null for any height.color - the color of the object, null for any color.visible - whether the object is visible on the canvas or not.
pass null, if either.
public objectdraw.DrawingCanvas getCanvas()
public void assertHas2DObject(Class shape,
objectdraw.Location loc,
Double width,
Double height,
Color color,
Boolean visible)
shape - the shape of the object. null for any shape.loc - the location of the object on the canvas, null for any
location.width - the width of the object, null for any width.height - the height of the object, null for any height.color - the color of the object, null for any color.visible - whether the object is visible on the canvas or not.
pass null, if either.
public void assertNo2DObject(Class shape,
objectdraw.Location loc,
Double width,
Double height,
Color color,
Boolean visible)
shape - the shape of the object. null for any shape.loc - the location of the object on the canvas, null for any
location.width - the width of the object, null for any width.height - the height of the object, null for any height.color - the color of the object, null for any color.visible - whether the object is visible on the canvas or not.
pass null, if either.
public boolean hasLine(objectdraw.Location start,
objectdraw.Location end,
Color color,
Boolean visible)
start - the starting point of the line, null for any starting locationend - the end location of the line, null for any end locationcolor - the color of the line, null for any color.visible - whether the line is visible on the canvas or not.
pass null, if either.
public List<objectdraw.Line> getLines(objectdraw.Location start,
objectdraw.Location end,
Color color,
Boolean visible)
start - the starting point of the line, null for any starting locationend - the end location of the line, null for any end locationcolor - the color of the line, null for any color.visible - whether the line is visible on the canvas or not.
pass null, if either.
public void assertHasLine(objectdraw.Location start,
objectdraw.Location end,
Color color,
Boolean visible)
start - the starting point of the line, null for any starting locationend - the end location of the line, null for any end locationcolor - the color of the line, null for any color.visible - whether the line is visible on the canvas or not.
pass null, if either.
public void assertNoLine(objectdraw.Location start,
objectdraw.Location end,
Color color,
Boolean visible)
start - the starting point of the line, null for any starting locationend - the end location of the line, null for any end locationcolor - the color of the line, null for any color.visible - whether the line is visible on the canvas or not.
pass null, if either.
public void assertHas2DObject(String hint,
Class shape,
objectdraw.Location loc,
Double width,
Double height,
Color color,
Boolean visible)
hint - error message that should be displayed for a failed assertionshape - the shape of the object. null for any shape.loc - the location of the object on the canvas, null for any
location.width - the width of the object, null for any width.height - the height of the object, null for any height.color - the color of the object, null for any color.visible - whether the object is visible on the canvas or not.
pass null, if either.
public void assertNo2DObject(String hint,
Class shape,
objectdraw.Location loc,
Double width,
Double height,
Color color,
Boolean visible)
hint - error message that should be displayed for a failed assertionshape - the shape of the object. null for any shape.loc - the location of the object on the canvas, null for any
location.width - the width of the object, null for any width.height - the height of the object, null for any height.color - the color of the object, null for any color.visible - whether the object is visible on the canvas or not.
pass null, if either.
public void assertHasLine(String hint,
objectdraw.Location start,
objectdraw.Location end,
Color color,
Boolean visible)
hint - error message that should be displayed for a failed assertionstart - the starting point of the line, null for any starting locationend - the end location of the line, null for any end locationcolor - the color of the line, null for any color.visible - whether the line is visible on the canvas or not.
pass null, if either.
public void assertNoLine(String hint,
objectdraw.Location start,
objectdraw.Location end,
Color color,
Boolean visible)
hint - error message that should be displayed for a failed assertion.start - the starting point of the line, null for any starting locationend - the end location of the line, null for any end locationcolor - the color of the line, null for any color.visible - whether the line is visible on the canvas or not.
pass null, if either.
|
Last updated: Wed, Apr 1, 2009 12:29 AM EDT | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||