Examples of TriggerAction


Examples of com.ardor3d.input.logical.TriggerAction

        projectedGrid = new ProjectedGrid("ProjectedGrid", externalCamera, 100, 70, 0.01f, new WaterHeightGenerator(),
                _timer);
        _root.attachChild(projectedGrid);

        _logicalLayer.registerTrigger(new InputTrigger(new KeyPressedCondition(Key.SPACE), new TriggerAction() {
            public void perform(final Canvas source, final TwoInputStates inputStates, final double tpf) {
                projectedGrid.setFreezeUpdate(!projectedGrid.isFreezeUpdate());
                updateText();
            }
        }));
        _logicalLayer.registerTrigger(new InputTrigger(new KeyPressedCondition(Key.ONE), new TriggerAction() {
            public void perform(final Canvas source, final TwoInputStates inputStates, final double tpf) {
                projectedGrid.setNrUpdateThreads(projectedGrid.getNrUpdateThreads() - 1);
                updateText();
            }
        }));
        _logicalLayer.registerTrigger(new InputTrigger(new KeyPressedCondition(Key.TWO), new TriggerAction() {
            public void perform(final Canvas source, final TwoInputStates inputStates, final double tpf) {
                projectedGrid.setNrUpdateThreads(projectedGrid.getNrUpdateThreads() + 1);
                updateText();
            }
        }));
        _logicalLayer.registerTrigger(new InputTrigger(new KeyPressedCondition(Key.THREE), new TriggerAction() {
            public void perform(final Canvas source, final TwoInputStates inputStates, final double tpf) {
                projectedGrid.setDrawDebug(!projectedGrid.isDrawDebug());
                updateText();
            }
        }));
        _logicalLayer.registerTrigger(new InputTrigger(new KeyPressedCondition(Key.FOUR), new TriggerAction() {
            public void perform(final Canvas source, final TwoInputStates inputStates, final double tpf) {
                projectedGrid.setDrawDebug(true);
                animateExternalCamera = !animateExternalCamera;
                updateText();
            }
View Full Code Here

Examples of com.ardor3d.input.logical.TriggerAction

        final BasicText repeatText = BasicText.createDefaultTextLabel("text", getWrapText(controller));
        repeatText.setTranslation(5, 10 + speedText.getHeight(), 0);
        _root.attachChild(repeatText);

        // Add a trigger to change the repeat type on the controller
        _logicalLayer.registerTrigger(new InputTrigger(new KeyPressedCondition(Key.R), new TriggerAction() {
            public void perform(final Canvas source, final TwoInputStates inputStates, final double tpf) {
                switch (controller.getRepeatType()) {
                    case CLAMP:
                        controller.setRepeatType(RepeatType.CYCLE);
                        break;
                    case CYCLE:
                        controller.setRepeatType(RepeatType.WRAP);
                        break;
                    case WRAP:
                        controller.setRepeatType(RepeatType.CLAMP);
                        break;
                }
                repeatText.setText(getWrapText(controller));
            }
        }));

        // Add a slow down command
        _logicalLayer.registerTrigger(new InputTrigger(new KeyPressedCondition(Key.LBRACKET), new TriggerAction() {
            public void perform(final Canvas source, final TwoInputStates inputState, final double tpf) {
                controller.setSpeed(getNewSpeed(false, controller));
                speedText.setText(getSpeedText(controller));
            }
        }));

        // Add a speed up command
        _logicalLayer.registerTrigger(new InputTrigger(new KeyPressedCondition(Key.RBRACKET), new TriggerAction() {
            public void perform(final Canvas source, final TwoInputStates inputState, final double tpf) {
                controller.setSpeed(getNewSpeed(true, controller));
                speedText.setText(getSpeedText(controller));
            }
        }));
View Full Code Here

Examples of com.ardor3d.input.logical.TriggerAction

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

        _logicalLayer.registerTrigger(new InputTrigger(new KeyPressedCondition(Key.SPACE), new TriggerAction() {
            public void perform(final Canvas source, final TwoInputStates inputStates, final double tpf) {
                mode++;
                mode %= 3;
                switch (mode) {
                    case 0:
View Full Code Here

Examples of com.ardor3d.input.logical.TriggerAction

        // set the default as current
        manager.setActiveWidget(rotateWidget);

        // add triggers to change which widget is active
        manager.getLogicalLayer().registerTrigger(
                new InputTrigger(new KeyHeldCondition(Key.LSHIFT), new TriggerAction() {
                    @Override
                    public void perform(final Canvas source, final TwoInputStates inputStates, final double tpf) {
                        manager.setActiveWidget(scaleWidget);
                    }
                }));
        manager.getLogicalLayer().registerTrigger(
                new InputTrigger(new KeyReleasedCondition(Key.LSHIFT), new TriggerAction() {
                    @Override
                    public void perform(final Canvas source, final TwoInputStates inputStates, final double tpf) {
                        manager.setActiveWidget(rotateWidget);
                    }
                }));
        manager.getLogicalLayer().registerTrigger(
                new InputTrigger(new KeyHeldCondition(Key.LCONTROL), new TriggerAction() {
                    @Override
                    public void perform(final Canvas source, final TwoInputStates inputStates, final double tpf) {
                        manager.setActiveWidget(moveWidget);
                    }
                }));
        manager.getLogicalLayer().registerTrigger(
                new InputTrigger(new KeyReleasedCondition(Key.LCONTROL), new TriggerAction() {
                    @Override
                    public void perform(final Canvas source, final TwoInputStates inputStates, final double tpf) {
                        manager.setActiveWidget(rotateWidget);
                    }
                }));

        // add toggle for matrix mode on widgets.
        manager.getLogicalLayer().registerTrigger(new InputTrigger(new KeyPressedCondition(Key.R), new TriggerAction() {
            @Override
            public void perform(final Canvas source, final TwoInputStates inputStates, final double tpf) {
                rotateWidget.setInteractMatrix(rotateWidget.getInteractMatrix() == InteractMatrix.World ? InteractMatrix.Local
                        : InteractMatrix.World);
                rotateWidget.targetDataUpdated(manager);
                moveWidget.setInteractMatrix(rotateWidget.getInteractMatrix());
                moveWidget.targetDataUpdated(manager);
            }
        }));

        // add triggers to change which widget is active
        manager.getLogicalLayer().registerTrigger(
                new InputTrigger(new KeyPressedCondition(Key.SPACE), new TriggerAction() {
                    @Override
                    public void perform(final Canvas source, final TwoInputStates inputStates, final double tpf) {
                        manager.getSpatialTarget().setRotation(Matrix3.IDENTITY);
                        manager.fireTargetDataUpdated();
                    }
View Full Code Here

Examples of com.ardor3d.input.logical.TriggerAction

        final PhysicalLayer pl = new PhysicalLayer(keyboardWrapper, mouseWrapper, controllerWrapper, focusWrapper);

        logicalLayer.registerInput(canvas1, pl);

        logicalLayer.registerTrigger(new InputTrigger(new KeyPressedCondition(Key.H), new TriggerAction() {
            public void perform(final Canvas source, final TwoInputStates inputStates, final double tpf) {
                if (source != canvas1) {
                    return;
                }

                if (_showCursor1.get(canvas1)) {
                    mouseManager.setCursor(_cursor1);
                } else {
                    mouseManager.setCursor(_cursor2);
                }

                _showCursor1.put(canvas1, !_showCursor1.get(canvas1));
            }
        }));
        logicalLayer.registerTrigger(new InputTrigger(new KeyPressedCondition(Key.J), new TriggerAction() {
            public void perform(final Canvas source, final TwoInputStates inputStates, final double tpf) {
                if (source != canvas1) {
                    return;
                }

                mouseManager.setCursor(MouseCursor.SYSTEM_DEFAULT);
            }
        }));
        logicalLayer.registerTrigger(new InputTrigger(new KeyPressedCondition(Key.G), new TriggerAction() {
            public void perform(final Canvas source, final TwoInputStates inputStates, final double tpf) {
                if (source != canvas1) {
                    return;
                }
View Full Code Here

Examples of org.apache.hadoop.chukwa.datatrigger.TriggerAction

      for(String actionName : classes) {
        Class<? extends TriggerAction> actionClass =
            (Class<? extends TriggerAction>) Class.forName(actionName);
        java.lang.reflect.Constructor<? extends TriggerAction> c =
            actionClass.getConstructor();
        TriggerAction action = c.newInstance();

        log.info(actionName + " handling " + files.length + " events");

        //send the files that were just added benieth the repos/ dir.
        FileStatus[] events = fs.listStatus(files);
        action.execute(conf, fs, events, TriggerEvent.POST_DEMUX_SUCCESS);
      }
    } catch(Exception e) {
      log.error(ExceptionUtil.getStackTrace(e));
      return false;
    }
View Full Code Here

Examples of org.apache.hadoop.chukwa.datatrigger.TriggerAction

      for(String actionName : classes) {
        Class<? extends TriggerAction> actionClass =
            (Class<? extends TriggerAction>) Class.forName(actionName);
        java.lang.reflect.Constructor<? extends TriggerAction> c =
            actionClass.getConstructor();
        TriggerAction action = c.newInstance();

        log.info(actionName + " handling " + files.length + " events");

        //send the files that were just added benieth the repos/ dir.
        FileStatus[] events = fs.listStatus(files);
        action.execute(conf, fs, events, TriggerEvent.POST_DEMUX_SUCCESS);
      }
    } catch(Exception e) {
      log.error(ExceptionUtil.getStackTrace(e));
      return false;
    }
View Full Code Here

Examples of org.teiid.query.sql.proc.TriggerAction

      TempMetadataStore childMetadata = new TempMetadataStore();
      TempMetadataAdapter tma = new TempMetadataAdapter(metadata, childMetadata);
      GroupContext externalGroups = new GroupContext();

    if (currentCommand instanceof TriggerAction) {
      TriggerAction ta = (TriggerAction)currentCommand;
      ta.setView(container);
        //TODO: it seems easier to just inline the handling here rather than have each of the resolvers check for trigger actions
        List<ElementSymbol> viewElements = ResolverUtil.resolveElementsInGroup(ta.getView(), metadata);
        if (type == Command.TYPE_UPDATE || type == Command.TYPE_INSERT) {
          ProcedureContainerResolver.addChanging(tma.getMetadataStore(), externalGroups, viewElements);
          ProcedureContainerResolver.addScalarGroup(SQLConstants.Reserved.NEW, tma.getMetadataStore(), externalGroups, viewElements, false);
        }
        if (type == Command.TYPE_UPDATE || type == Command.TYPE_DELETE) {
View Full Code Here

Examples of org.teiid.query.sql.proc.TriggerAction

        ((CreateUpdateProcedureCommand)c).setUserCommand(container);
      }
    }
    if (c != null) {
      if (c instanceof TriggerAction) {
        TriggerAction ta = (TriggerAction)c;
        ProcessorPlan plan = new TriggerActionPlanner().optimize(container, ta, idGenerator, metadata, capFinder, analysisRecord, context);
          sourceNode.setProperty(NodeConstants.Info.PROCESSOR_PLAN, plan);
          return true;
      }
      if (c.getCacheHint() != null) {
View Full Code Here

Examples of org.teiid.query.sql.proc.TriggerAction

     */
    public void resolveCommand(Command command, TempMetadataAdapter metadata, boolean resolveNullLiterals)
        throws QueryMetadataException, QueryResolverException, TeiidComponentException {
     
      if (command instanceof TriggerAction) {
        TriggerAction ta = (TriggerAction)command;
            resolveBlock(new CreateUpdateProcedureCommand(), ta.getBlock(), ta.getExternalGroupContexts(), metadata);
        return;
      }

        CreateUpdateProcedureCommand procCommand = (CreateUpdateProcedureCommand) command;

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.