Example usage for javafx.scene.input KeyCombination NO_MATCH

List of usage examples for javafx.scene.input KeyCombination NO_MATCH

Introduction

In this page you can find the example usage for javafx.scene.input KeyCombination NO_MATCH.

Prototype

KeyCombination NO_MATCH

To view the source code for javafx.scene.input KeyCombination NO_MATCH.

Click Source Link

Document

A KeyCombination that will match with no events.

Usage

From source file:org.openbase.display.DisplayView.java

private void init(final Stage primaryStage) throws InterruptedException, InitializationException {

    Runtime.getRuntime().addShutdownHook(new Thread() {
        @Override/* w w  w  . jav  a  2s .  c om*/
        public void run() {
            Platform.exit();
        }
    });

    try {
        // platform configuration
        Platform.setImplicitExit(false);
        primaryStage.setFullScreenExitKeyCombination(KeyCombination.NO_MATCH);
        this.primaryStage = primaryStage;

        Scene scene = new Scene(cardsPane);

        // configure hide key combination
        final KeyCombination escapeKey = new KeyCodeCombination(KeyCode.ESCAPE);
        scene.addEventHandler(KeyEvent.KEY_RELEASED, new EventHandler<KeyEvent>() {

            @Override
            public void handle(KeyEvent event) {
                if (escapeKey.match(event)) {
                    try {
                        setVisible(false);
                    } catch (CouldNotPerformException ex) {
                        ExceptionPrinter.printHistory(
                                new CouldNotPerformException("Could not execute key event!", ex), logger);
                    }
                }
            }
        });

        primaryStage.setScene(scene);

        try {
            broadcastServer = new DisplayServer(this);
            broadcastServer.init(JPService.getProperty(JPBroadcastDisplayScope.class).getValue());
            broadcastServer.activate();
        } catch (JPServiceException | CouldNotPerformException ex) {
            throw new CouldNotPerformException("Could not load display server!", ex);
        }

        try {
            displayServer = new DisplayServer(this);
            displayServer.init(JPService.getProperty(JPDisplayScope.class).getValue());
            displayServer.activate();
        } catch (JPServiceException | CouldNotPerformException ex) {
            throw new CouldNotPerformException("Could not load display server!", ex);
        }
        this.htmlLoader.init(getScreen());
    } catch (CouldNotPerformException ex) {
        throw new InitializationException(this, ex);
    }
}