private Point getPoint(Coordinates where, String action) { // If coordinates exist then we want to update the last known mouse position and then use it in // the action. if (where != null) { lastMousePosition = where.inViewPort(); } if (lastMousePosition != null) { return lastMousePosition; } throw new InvalidCoordinatesException("Invalid coordinates to " + action + " on"); }
private HtmlElement getElementForOperation(Coordinates potentialCoordinates) { if (potentialCoordinates != null) { return (HtmlElement) potentialCoordinates.getAuxiliary(); } if (currentActiveElement == null) { throw new InvalidCoordinatesException("About to perform an interaction that relies" + " on the active element, but there isn't one."); } return currentActiveElement; }