src/nl/knokko/gui/testing/GuiTestHelper.java
/**
	 * Attempts to click at the middle of a component that claims to show the
	 * specified text. If such a component is found, the mouse will be moved to the
	 * middle of the component and the mouse will click there. If such a component
	 * can't be found, a TestException will be thrown.
	 * 
	 * @param text   The text to search for
	 * @param button The mouse button to click with
	 */
Attempts to click at the middle of a component that claims to show the
specified text. If such a component is found, the mouse will be moved to the
middle of the component and the mouse will click there. If such a component
can't be found, a TestException will be thrown.

@param text   The text to search for
@param button The mouse button to click with
Attempts to click at the middle of a component that claims to show the specified text . If such a component is found the mouse will be moved to the middle of the component and the mouse will click there . If such a component can ' t be found a TestException will be thrown . @param text The text to search for @param button The mouse button to click with
public void click(String text, int button) {
		TextShowingComponent.Pair pair = getPairWithText(text);
		if (pair != null) {
			Point2D.Float point = pair.getPosition();
			if (point.x < 0 || point.x > 1 || point.y < 0 || point.y > 1) {
				delay(1000);
				throw new TestException("The component with text " + text + " is out of window bounds:" + point);
			}
			click(point.x, point.y, button);
		} else {
			throw new TestException("No component with text " + text + " can be found");
		}
	}
public void click ( String text , int button ) { TextShowingComponent . Pair pair = getPairWithText ( text ) ; if ( pair != null ) { Point2D . Float point = pair . getPosition ( ) ; if ( point . x < 0 || point . x > 1 || point . y < 0 || point . y > 1 ) { delay ( 1000 ) ; throw new TestException ( "The component with text " + text + " is out of window bounds:" + point ) ; } click ( point . x , point . y , button ) ; } else { throw new TestException ( "No component with text " + text + " can be found" ) ; } }
Attempts to click at the middle of a component that claims to show the
 specified text.
Attempts to click at the middle of a component that claims to show the specified text .
// Delay to get a better overview