Package org.tod.meta.steps

Examples of org.tod.meta.steps.ProgramStep


                if (ile instanceof ICallerSideEvent) {
                    event = (ICallerSideEvent) ile;
                    if (event.getOperationBehavior() != null) {
                        lineNum = TypeUtils.calculateLineNumber(event.getOperationBehavior(), event.getOperationBytecodeIndex());
                        // Generate the program event.
                        ProgramStep step = ProgramStepFactory.stepFromTOD(getTODSession(), event, true, runningLive);
                        if (step != null && lineNum == currentLine) {
                            steps.addFirst(step);
                        }

                        if (previousEvent == null && event.getOperationBehavior() != null) {
                            previousEvent = event;
                        }
                    }
                }
            } while (lineNum == currentLine && events.hasNext()); //&& (isEventOnLine(event, currentLine) || this.isEventBeforeLine(event, currentLine)));
        }

        if (destinationLine == -1 && event != null) {
            result.newLine = TypeUtils.calculateLineNumber(event.getOperationBehavior(), event.getOperationBytecodeIndex());
        } else {
            result.newLine = destinationLine;
        }

        if (previousEvent == null) {
            result.behavior = this.behavior; // no events were found
            result.targetEvent = event;
            result.lastEvent = event;
        } else {
            result.targetEvent = event;
            result.behavior = event.getOperationBehavior();
            result.lastEvent = previousEvent;
        }
       
        if (events.hasNext()) {
            result.afterLastEvent = events.next();
        }
       
        if (!runningLive && !isLive()) {
            runningLive = (result.lastEvent == null) || (result.lastEvent.equals(lastEvent) && !events.hasNext() && result.newLine == liveLine ) || (lineNumber == result.newLine && !events.hasNext());
            if (runningLive) {
                result.newLine = liveLine;
                result.behavior = this.liveBehavior;
            }
        }
       
        // Generate the conditional test event, if any.
        ProgramStep conditionalStep = ProgramStepFactory.conditionalStep(session, event, result.newLine, lastLine, true);
        if (conditionalStep != null) {
            steps.addLast(conditionalStep);
        }
       
        // Generate the loop conditional test event, if any.
        ProgramStep loopStep = ProgramStepFactory.loopStep(session, event, result.newLine, lastLine, true);
        if (loopStep != null) {
            steps.addLast(loopStep);
        }
       
        result.steps = steps.iterator();
View Full Code Here


                        previousEvent = event;
                        event = (ICallerSideEvent) ile;
                        int lineNum = TypeUtils.calculateLineNumber(event.getOperationBehavior(), event.getOperationBytecodeIndex());
                        if (lineNum != -1 ) {
                            validEvent = event;
                            ProgramStep step = ProgramStepFactory.stepFromTOD(this.getTODSession(), event, false, false);
                            if (step != null) {
                                steps.addLast(step);
                            }
                        }
                    } else if (!this.isEventOnLine(ile, targetLine)) {
                        break;
                    }
                }
                if (events.hasPrevious()) {
                    ile = events.previous();
                }
            } while (events.hasPrevious());
           

            // Don't skip any events! If the last event wasn't on this line,
            // go forward so that it will be seen again.
            if (!this.isEventOnLine(ile, targetLine)) {
                events.next();
            }
        }

        if (validEvent == null) {
            result.behavior = this.behavior; // TODO: might break
        } else {
            result.newLine = TypeUtils.calculateLineNumber(validEvent.getOperationBehavior(), validEvent.getOperationBytecodeIndex());
            result.targetEvent = validEvent;
            result.lastEvent = validEvent;
            result.behavior = validEvent.getOperationBehavior();
        }

        // Generate the conditional test event, if any.
        ProgramStep step = ProgramStepFactory.conditionalStep(session, event, lastLine, result.newLine, false);
        if (step != null) {
            steps.addLast(step);
        }       
        // Generate the loop conditional test event, if any.
        ProgramStep loopStep = ProgramStepFactory.loopStep(session, event, lastLine, result.newLine, false);
        if (loopStep != null) {
            steps.addLast(loopStep);
        }
       
        result.forward = false;
View Full Code Here

    @Override
    public void steppedOver(StateInfo info) {
        String stepAudio = "";
        if (info.hasNext()) {
            ProgramStep step = info.next();

            AudioAction action = map.get(step.getType());
            action.setStep(step);
            stepAudio = action.speak();
        }
        // Speak the text (if any), plus the line number and class.
        int lineNumber = info.getLineNumber();
View Full Code Here

    @Override
    public void steppedBackOver(StateInfo info) {
        if (!info.hasNext()) {
            return;
        }
        ProgramStep step = info.next();
       
        AudioAction action = map.get(step.getType());
        action.setStep(step);
        if(TextToSpeechOptions.isScreenReading()) {
            speech.speak(action.speak(), SpeechPriority.HIGH);
        }
    }
View Full Code Here

TOP

Related Classes of org.tod.meta.steps.ProgramStep

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.