Register a built-in event so that it can be fired for libraries, etc. Supported events include: pre – at the very top of the draw() method (safe to draw) draw – at the end of the draw() method (safe to draw) post – after draw() has exited (not safe to draw) pause – called when t
(String methodName, Object target)
| 1540 | * @param target the target object that should receive the event |
| 1541 | */ |
| 1542 | public void registerMethod(String methodName, Object target) { |
| 1543 | if (methodName.equals("mouseEvent")) { |
| 1544 | registerWithArgs("mouseEvent", target, new Class[] { processing.event.MouseEvent.class }); |
| 1545 | |
| 1546 | } else if (methodName.equals("keyEvent")) { |
| 1547 | registerWithArgs("keyEvent", target, new Class[] { processing.event.KeyEvent.class }); |
| 1548 | |
| 1549 | } else if (methodName.equals("touchEvent")) { |
| 1550 | registerWithArgs("touchEvent", target, new Class[] { processing.event.TouchEvent.class }); |
| 1551 | |
| 1552 | } else { |
| 1553 | registerNoArgs(methodName, target); |
| 1554 | } |
| 1555 | } |
| 1556 | |
| 1557 | |
| 1558 | private void registerNoArgs(String name, Object o) { |
no test coverage detected