public class TestableWindowController
extends objectdraw.FrameWindowController
JApplet.AccessibleJApplet
Applet.AccessibleApplet
Panel.AccessibleAWTPanel
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
accessibleContext, rootPane, rootPaneCheckingEnabled
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
TestableWindowController()
This constructor forces TestableWindowController to wait for the initial window to
draw itself before exiting the constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
assertHas2DObject(Class<? extends objectdraw.Drawable2DInterface> shape,
objectdraw.Location loc,
Double width,
Double height,
Color color,
Boolean visible)
assert version of has2DObject
|
void |
assertHas2DObject(String hint,
Class<? extends objectdraw.Drawable2DInterface> 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<? extends objectdraw.Drawable2DInterface> 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, succeed otherwise.
|
void |
assertNo2DObject(String hint,
Class<? extends objectdraw.Drawable2DInterface> 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<? extends objectdraw.Drawable2DInterface> 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<? extends objectdraw.Drawable2DInterface> 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.
|
protected void |
helpinit()
This init registers our own Listener to the WindowController.
|
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.
|
begin, onMouseClick, onMouseDrag, onMouseEnter, onMouseExit, onMouseMove, onMousePress, onMouseRelease
destroy, getAudio, getImage, getTime, getVersion, init, placeInFrame, resize, setup, start, startController, startController, stop
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isRootPaneCheckingEnabled, paramString, remove, repaint, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, isValidateRoot, newAudioClip, play, play, resize, setStub, showStatus
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public TestableWindowController()
public JFrame getFrame()
public void waitForInit()
protected void helpinit()
helpinit
in class objectdraw.FrameWindowController
public void paint(Graphics g)
paint
in class objectdraw.FrameWindowController
public boolean has2DObject(Class<? extends objectdraw.Drawable2DInterface> 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<? extends objectdraw.Drawable2DInterface> 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<? extends objectdraw.Drawable2DInterface> 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<? extends objectdraw.Drawable2DInterface> 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<? extends objectdraw.Drawable2DInterface> 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<? extends objectdraw.Drawable2DInterface> 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.