/** * Called when a BlueJ event is raised. The event can be any BlueJEvent type. The implementation * of this method should check first whether the event type is of interest an return immediately * if it isn't. * * @param eventId A constant identifying the event. One of the event id constants defined in * BlueJEvent. * @param arg An event specific parameter. See BlueJEvent for definition. */ @Override public void blueJEvent(int eventId, Object arg) { initialise(); if (eventId == BlueJEvent.METHOD_CALL) { InvokerRecord ir = (InvokerRecord) arg; if (ir.getResultName() != null) { constructorCall(ir); } else { boolean isVoid = ir.hasVoidResult(); if (isVoid) { methodCall(ir.toStatement()); } else { methodCall(ir.toExpression()); } } } else if (eventId == BlueJEvent.EXECUTION_RESULT) { methodResult((ExecutionEvent) arg); } }