private void startLambdaInvocation(VMObservableEvent event) { org.lgna.project.ast.UserLambda lambda = (UserLambda) event.getObject(); ComponentThread thread = event.getThread(); double startTime = event.getTime(); org.lgna.project.ast.AbstractMethod method = (AbstractMethod) event.getProperties()[0]; // We ignore scene activation if (!method.getName().contentEquals("sceneActivated")) { AbstractEventNode<?> eventNode = EventNodeFactory.createEventNode(lambda, thread, startTime, null); ((LambdaEventNode) eventNode).setInvokingEventMethod(method); pushEventNode(eventNode, false); } }
private void endLambdaInvocation(VMObservableEvent event) { org.lgna.project.ast.UserLambda lambda = (UserLambda) event.getObject(); org.lgna.project.ast.AbstractMethod method = (AbstractMethod) event.getProperties()[0]; ComponentThread thread = event.getThread(); double endTime = event.getTime(); if (!method.getName().contentEquals("sceneActivated")) { AbstractEventNode<?> eventNode = popEventNode(thread, false); lambdaEventNodes.add((LambdaEventNode) eventNode); if ((eventNode != null) && (eventNode.getAstNode() == lambda) && (eventNode.getThread() == thread)) { eventNode.setEndTime(endTime); } else { throw new ExecutionObserverException("EventNode invalid: " + eventNode.toString(), event); } } }