Ejemplo n.º 1
0
 @Override
 public void preload(GlContext ctx) {
   defaultAction.preload(ctx);
   for (Case c : cases) {
     c.action.preload(ctx);
   }
 }
Ejemplo n.º 2
0
 @Override
 public Executor createExecutor(GlContext ctx, Scope scope) {
   final BooleanExpression.Evaluator[] evaluators =
       new BooleanExpression.Evaluator[cases.length];
   final Executor[] executors = new Executor[cases.length];
   for (int ii = 0; ii < cases.length; ii++) {
     Case caze = cases[ii];
     evaluators[ii] = caze.condition.createEvaluator(scope);
     executors[ii] = caze.action.createExecutor(ctx, scope);
   }
   final Executor defaultExecutor = defaultAction.createExecutor(ctx, scope);
   return new Executor() {
     public void execute() {
       for (int ii = 0; ii < cases.length; ii++) {
         if (evaluators[ii].evaluate()) {
           executors[ii].execute();
           return;
         }
       }
       defaultExecutor.execute();
     }
   };
 }
Ejemplo n.º 3
0
 @Override
 public void preload(GlContext ctx) {
   for (ActionConfig action : actions) {
     action.preload(ctx);
   }
 }