Example usage for javafx.scene.input KeyCode ADD

List of usage examples for javafx.scene.input KeyCode ADD

Introduction

In this page you can find the example usage for javafx.scene.input KeyCode ADD.

Prototype

KeyCode ADD

To view the source code for javafx.scene.input KeyCode ADD.

Click Source Link

Document

Constant for the Add key.

Usage

From source file:ambroafb.general.countcombobox.CountComboBox.java

private void addKeyListeners() {
    KeyCode plus = KeyCode.ADD;
    KeyCode minus = KeyCode.SUBTRACT;//from  w  w w . j av  a 2s  . c  o m
    setOnKeyPressed((KeyEvent event) -> {
        KeyCode eventKey = event.getCode();
        CountComboBoxItem selectedItem = getSelectionModel().getSelectedItem();
        if (selectedItem == null)
            return;
        CountComboBoxContainer selectedDrawItem = containers.get(selectedItem.getUniqueIdentifier());

        if (eventKey.equals(plus)) {
            selectedDrawItem.increaseNumberBy(counter);
        } else if (eventKey.equals(minus)) {
            selectedDrawItem.decreaseNumberBy(counter);
        }
        refreshButtonCell();
    });
}