Examples of InputState


Examples of com.ardor3d.input.InputState

        }));
    }

    private boolean offerKeyInputToUI(final TwoInputStates inputStates) {
        boolean consumed = false;
        final InputState current = inputStates.getCurrent();

        // Keyboard checks
        {
            final KeyboardState previousKState = inputStates.getPrevious().getKeyboardState();
            final KeyboardState currentKState = current.getKeyboardState();
            if (!currentKState.getKeysDown().isEmpty()) {
                // new presses
                final EnumSet<Key> pressed = currentKState.getKeysPressedSince(previousKState);
                if (!pressed.isEmpty()) {
                    for (final Key key : pressed) {
View Full Code Here

Examples of com.ardor3d.input.InputState

     *            our two InputState objects, detailing a before and after snapshot of the input system.
     * @return true if a UI element consumed the event described by inputStates.
     */
    private boolean offerMouseInputToUI(final TwoInputStates inputStates) {
        boolean consumed = false;
        final InputState current = inputStates.getCurrent();

        // Mouse checks.
        if (!isIgnoreMouseInputOnGrabbed() || _mouseManager == null
                || _mouseManager.getGrabbed() != GrabbedState.GRABBED) {
            final MouseState previousMState = inputStates.getPrevious().getMouseState();
            final MouseState currentMState = current.getMouseState();
            if (previousMState != currentMState) {

                // Check for presses.
                if (currentMState.hasButtonState(ButtonState.DOWN)) {
                    final EnumSet<MouseButton> pressed = currentMState.getButtonsPressedSince(previousMState);
View Full Code Here

Examples of com.ardor3d.input.InputState

            }
        }));

        logicalLayer.registerTrigger(new InputTrigger(new AnyKeyCondition(), new TriggerAction() {
            public void perform(final Canvas source, final TwoInputStates inputStates, final double tpf) {
                final InputState current = inputStates.getCurrent();

                System.out.println("Key character pressed: " + current.getKeyboardState().getKeyEvent().getKeyChar());
            }
        }));
    }
View Full Code Here

Examples of org.graylog2.plugin.inputs.InputState

    @POST
    @Timed
    @Path("/{inputId}/launch")
    public Response launchExisting(@PathParam("inputId") String inputId) {
        final InputState inputState = inputRegistry.getInputState(inputId);

        final MessageInput input;
        if (inputState == null) {
            input = inputRegistry.getPersisted(inputId);
        } else {
            input = inputState.getMessageInput();
        }

        if (input == null) {
            final String message = "Cannot launch input <" + inputId + ">. Input not found.";
            LOG.info(message);
View Full Code Here

Examples of org.graylog2.plugin.inputs.InputState

    public InputState launch(final MessageInput input, String id) {
        return launch(input, id, false);
    }

    public InputState launch(final MessageInput input, String id, boolean register) {
        final InputState inputState = new InputState(input, id);
        inputStates.add(inputState);

        return launch(input, inputState, register);
    }
View Full Code Here

Examples of org.graylog2.plugin.inputs.InputState

            launchPersisted(input);
        }
    }

    public InputState terminate(MessageInput input) {
        InputState inputState = stop(input);

        if (inputState != null) {
            inputState.setState(InputState.InputStateType.TERMINATED);
            finishedTermination(inputState);
        }

        return inputState;
    }
View Full Code Here

Examples of org.graylog2.plugin.inputs.InputState

        return inputState;
    }

    public InputState stop(MessageInput input) {
        InputState inputState = getRunningInputState(input.getId());

        if (inputState != null) {
            try {
                input.stop();
            } catch (Exception e) {
                LOG.warn("Stopping input <{}> failed, removing anyway: {}", input.getId(), e);
            }
            inputState.setState(InputState.InputStateType.STOPPED);
            finishedStop(inputState);
        }

        return inputState;
    }
View Full Code Here

Examples of org.graylog2.plugin.inputs.InputState

    @Produces(MediaType.APPLICATION_JSON)
    @ApiResponses(value = {
            @ApiResponse(code = 404, message = "No such input on this node.")
    })
    public Response launchExisting(@ApiParam(name = "inputId", required = true) @PathParam("inputId") String inputId) {
        InputState inputState = inputRegistry.getInputState(inputId);
        final MessageInput messageInput;

        if (inputState == null) {
            try {
                final Input input = inputService.find(inputId);
                messageInput = inputService.getMessageInput(input);
                messageInput.initialize();
            } catch (NoSuchInputTypeException | org.graylog2.database.NotFoundException e) {
                final String error = "Cannot launch input <" + inputId + ">. Input not found.";
                LOG.info(error);
                throw new NotFoundException(error);
            }
        } else
            messageInput = inputState.getMessageInput();

        if (messageInput == null) {
            final String error = "Cannot launch input <" + inputId + ">. Input not found.";
            LOG.info(error);
            throw new NotFoundException(error);
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.