Examples of SwitchNode


Examples of com.ardor3d.scenegraph.extension.SwitchNode

        t.getSceneHints().setRenderBucketType(RenderBucketType.Ortho);
        t.getSceneHints().setLightCombineMode(LightCombineMode.Off);
        t.setTranslation(new Vector3(0, 20, 0));
        _root.attachChild(t);

        final SwitchNode switchNode = new SwitchNode();

        Box box = new Box("Box", new Vector3(), 2, 1, 1);
        box.setModelBound(new BoundingBox());
        box.setTranslation(new Vector3(0, 0, 0));
        switchNode.attachChild(box);

        box = new Box("Box", new Vector3(), 1, 2, 1);
        box.setModelBound(new BoundingBox());
        box.setTranslation(new Vector3(0, 0, 0));
        box.setRandomColors();
        switchNode.attachChild(box);

        box = new Box("Box", new Vector3(), 1, 1, 2);
        box.setModelBound(new BoundingBox());
        box.setTranslation(new Vector3(0, 0, 0));
        box.setRandomColors();
        switchNode.attachChild(box);
        switchNode.getSceneHints().setCullHint(CullHint.Dynamic);

        _root.attachChild(switchNode);
        _root.getSceneHints().setCullHint(CullHint.Never);

        _logicalLayer.registerTrigger(new InputTrigger(new KeyPressedCondition(Key.SPACE), new TriggerAction() {
            public void perform(final Canvas source, final TwoInputStates inputStates, final double tpf) {
                switchNode.shiftVisibleRight();
            }
        }));

        final TextureState ts = new TextureState();
        ts.setEnabled(true);
View Full Code Here

Examples of com.google.template.soy.soytree.SwitchNode

        "  {/switch}\n";

    List<StandaloneNode> nodes = parseTemplateBody(templateBody);
    assertEquals(1, nodes.size());

    SwitchNode sn = (SwitchNode) nodes.get(0);
    assertEquals("$boo", sn.getExpr().toSourceString());
    assertTrue(sn.getExpr().getChild(0) instanceof DataRefNode);
    assertEquals(4, sn.numChildren());

    SwitchCaseNode scn0 = (SwitchCaseNode) sn.getChild(0);
    assertEquals("0", scn0.getExprListText());
    assertEquals(1, scn0.getExprList().size());
    assertTrue(scn0.getExprList().get(0).getChild(0) instanceof IntegerNode);

    SwitchCaseNode scn1 = (SwitchCaseNode) sn.getChild(1);
    assertEquals("$foo.goo", scn1.getExprListText());
    assertEquals(1, scn1.getExprList().size());
    assertTrue(scn1.getExprList().get(0).getChild(0) instanceof DataRefNode);

    SwitchCaseNode scn2 = (SwitchCaseNode) sn.getChild(2);
    assertEquals("-1, 1, $moo", scn2.getExprListText());
    assertEquals(3, scn2.getExprList().size());
    assertTrue(scn2.getExprList().get(0).getChild(0) instanceof NegativeOpNode);
    assertTrue(scn2.getExprList().get(1).getChild(0) instanceof IntegerNode);
    assertTrue(scn2.getExprList().get(2).getChild(0) instanceof DataRefNode);
    assertEquals("Bluh", ((RawTextNode) scn2.getChild(0)).getRawText());

    assertEquals(
        "Bloh", ((RawTextNode) ((SwitchDefaultNode) sn.getChild(3)).getChild(0)).getRawText());

    assertEquals(
        "{switch $boo}{case 0}Blah{case $foo.goo}Bleh{case -1, 1, $moo}Bluh{default}Bloh{/switch}",
        sn.toSourceString());
  }
View Full Code Here

Examples of jadx.core.dex.instructions.SwitchNode

      if (insn == null) {
        continue;
      }
      switch (insn.getType()) {
        case SWITCH:
          SwitchNode sw = (SwitchNode) insn;
          for (int target : sw.getTargets()) {
            addJump(insnByOffset, offset, target);
          }
          // default case
          int nextInsnOffset = InsnDecoder.getNextInsnOffset(insnByOffset, offset);
          if (nextInsnOffset != -1) {
View Full Code Here

Examples of jadx.core.dex.instructions.SwitchNode

        code.add("move-exception");
        break;

      case SWITCH:
        assert isFallback();
        SwitchNode sw = (SwitchNode) insn;
        code.add("switch(");
        addArg(code, insn.getArg(0));
        code.add(") {");
        code.incIndent();
        for (int i = 0; i < sw.getCasesCount(); i++) {
          String key = sw.getKeys()[i].toString();
          code.startLine("case ").add(key).add(": goto ");
          code.add(MethodGen.getLabelName(sw.getTargets()[i])).add(';');
        }
        code.startLine("default: goto ");
        code.add(MethodGen.getLabelName(sw.getDefaultCaseOffset())).add(';');
        code.decIndent();
        code.startLine('}');
        break;

      case NEW_INSTANCE:
View Full Code Here

Examples of jadx.core.dex.instructions.SwitchNode

    makeRegionIndent(code, cont.getRegion());
    code.startLine('}');
  }

  private CodeWriter makeSwitch(SwitchRegion sw, CodeWriter code) throws CodegenException {
    SwitchNode insn = (SwitchNode) sw.getHeader().getInstructions().get(0);
    InsnArg arg = insn.getArg(0);
    code.startLine("switch (");
    addArg(code, arg, false);
    code.add(") {");
    code.incIndent();
View Full Code Here

Examples of jadx.core.dex.instructions.SwitchNode

            }
            break;
          }

          case SWITCH:
            SwitchNode sn = (SwitchNode) insn;
            for (int k = 0; k < sn.getCasesCount(); k++) {
              FieldNode f = parentClass.getConstField(sn.getKeys()[k]);
              if (f != null) {
                sn.getKeys()[k] = new IndexInsnNode(InsnType.SGET, f.getFieldInfo(), 0);
              }
            }
            break;

          case RETURN:
View Full Code Here

Examples of javax.faces.flow.SwitchNode

        NavigationInfo info = getNavigationInfo(context, toFlowDocumentId, fromAction);
        FlowHandler flowHandler = context.getApplication().getFlowHandler();
       
        if (null != flowHandler &&
            null != info && null != info.switches && !info.switches.isEmpty()) {
            SwitchNode switchNode = info.switches.get(outcome);
            if (null != switchNode) {
                List<SwitchCase> cases = switchNode.getCases();
                for (SwitchCase cur : cases) {
                    if (cur.getCondition(context)) {
                        outcome = cur.getFromOutcome();
                        Flow newFlow = flowHandler.getFlow(context, toFlowDocumentId,
                                fromAction);
                        // If this outcome corresponds to an existing flow...
                        if (null != newFlow) {
                            result = synthesizeCaseStruct(context, newFlow, fromAction, outcome);
                        } else {
                            newFlow = flowHandler.getCurrentFlow(context);
                            if (null != newFlow) {
                                result = synthesizeCaseStruct(context, newFlow, fromAction, outcome);
                            }
                        }
                        if (null != result) {
                            break;
                        }
                    }
                }
                if (null == result) {
                    outcome = switchNode.getDefaultOutcome(context);
                    if (null != outcome) {
                        Flow currentFlow = flowHandler.getCurrentFlow(context);
                        if (null != currentFlow) {
                            result = synthesizeCaseStruct(context, currentFlow, fromAction, outcome);
                            if (null != result) {
View Full Code Here

Examples of javax.faces.flow.SwitchNode

       
        Flow flow = flowBuilder.getFlow();
        Assert.assertNotNull(flow);
        Assert.assertEquals("switch1", flow.getStartNodeId());
       
        SwitchNode switchNode = flow.getSwitches().get("switch1");
        Assert.assertNotNull(switchNode);
        Assert.assertEquals("exit", switchNode.getDefaultOutcome(facesContext));
       
        SwitchCase scn = switchNode.getCases().get(0);
        Assert.assertTrue(scn.getCondition(facesContext));
        Assert.assertEquals("case1", scn.getFromOutcome());
       
        scn = switchNode.getCases().get(1);
        Assert.assertTrue(scn.getCondition(facesContext));
        Assert.assertEquals("caseB", scn.getFromOutcome());

        scn = switchNode.getCases().get(2);
        Assert.assertTrue(scn.getCondition(facesContext));
        Assert.assertEquals("caseC", scn.getFromOutcome());
    }
View Full Code Here

Examples of javax.faces.flow.SwitchNode

        NavigationInfo info = getNavigationInfo(context, toFlowDocumentId, fromAction);
        FlowHandler flowHandler = context.getApplication().getFlowHandler();
       
        if (null != flowHandler &&
            null != info && null != info.switches && !info.switches.isEmpty()) {
            SwitchNode switchNode = info.switches.get(outcome);
            if (null != switchNode) {
                List<SwitchCase> cases = switchNode.getCases();
                for (SwitchCase cur : cases) {
                    if (cur.getCondition(context)) {
                        outcome = cur.getFromOutcome();
                        Flow newFlow = flowHandler.getFlow(context, toFlowDocumentId,
                                fromAction);
                        // If this outcome corresponds to an existing flow...
                        if (null != newFlow) {
                            result = synthesizeCaseStruct(context, newFlow, fromAction, outcome);
                        } else {
                            newFlow = flowHandler.getCurrentFlow(context);
                            if (null != newFlow) {
                                result = synthesizeCaseStruct(context, newFlow, fromAction, outcome);
                            }
                        }
                        if (null != result) {
                            break;
                        }
                    }
                }
                if (null == result) {
                    outcome = switchNode.getDefaultOutcome(context);
                    if (null != outcome) {
                        Flow currentFlow = flowHandler.getCurrentFlow(context);
                        if (null != currentFlow) {
                            result = synthesizeCaseStruct(context, currentFlow, fromAction, outcome);
                            if (null != result) {
View Full Code Here

Examples of javax.faces.flow.SwitchNode

        NavigationInfo info = getNavigationInfo(context, toFlowDocumentId, fromAction);
        FlowHandler flowHandler = context.getApplication().getFlowHandler();
       
        if (null != flowHandler &&
            null != info && null != info.switches && !info.switches.isEmpty()) {
            SwitchNode switchNode = info.switches.get(outcome);
            if (null != switchNode) {
                List<SwitchCase> cases = switchNode.getCases();
                for (SwitchCase cur : cases) {
                    if (cur.getCondition(context)) {
                        outcome = cur.getFromOutcome();
                        Flow newFlow = flowHandler.getFlow(context, toFlowDocumentId,
                                fromAction);
                        // If this outcome corresponds to an existing flow...
                        if (null != newFlow) {
                            result = synthesizeCaseStruct(context, newFlow, fromAction, outcome);
                        } else {
                            newFlow = flowHandler.getCurrentFlow(context);
                            if (null != newFlow) {
                                result = synthesizeCaseStruct(context, newFlow, fromAction, outcome);
                            }
                        }
                        if (null != result) {
                            break;
                        }
                    }
                }
                if (null == result) {
                    outcome = switchNode.getDefaultOutcome(context);
                    if (null != outcome) {
                        Flow currentFlow = flowHandler.getCurrentFlow(context);
                        if (null != currentFlow) {
                            result = synthesizeCaseStruct(context, currentFlow, fromAction, outcome);
                            if (null != result) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.