Search in sources :

Example 16 with CheckBox

use of javafx.scene.control.CheckBox in project POL-POM-5 by PlayOnLinux.

the class UserInterfacePanel method populate.

private void populate() {
    this.title = new TextWithStyle(tr("User Interface Settings"), "title");
    this.themeGrid = new GridPane();
    this.themeGrid.getStyleClass().add("grid");
    this.themeGrid.setHgap(20);
    this.themeGrid.setVgap(10);
    // Change Theme
    this.themeTitle = new TextWithStyle(tr("Theme:"), "captionTitle");
    this.themes = new ComboBox<>();
    this.themes.getItems().setAll(Themes.all());
    this.themes.setValue(Themes.fromShortName(settingsManager.getTheme()).orElse(Themes.DEFAULT));
    this.themes.setOnAction(event -> {
        this.handleThemeChange();
        this.save();
    });
    // View Script Sources
    this.showScriptSource = new CheckBox();
    this.showScriptSource.setSelected(settingsManager.isViewScriptSource());
    this.showScriptSource.setOnAction(event -> this.save());
    this.showScriptDescription = new Label(tr("Select, if you want to view the source repository of the scripts"));
    // Scale UI
    this.scale = new Slider(8, 16, settingsManager.getScale());
    this.scaleDescription = new Label(tr("Scale the user interface."));
    this.scale.valueProperty().addListener((observableValue, oldValue, newValue) -> {
        this.pause.setOnFinished(event -> {
            getScene().getRoot().setStyle(String.format("-fx-font-size: %.2fpt;", newValue));
            this.save();
        });
        this.pause.playFromStart();
    });
    this.themeGrid.add(themeTitle, 0, 0);
    this.themeGrid.add(themes, 1, 0);
    this.themeGrid.add(showScriptSource, 0, 1);
    this.themeGrid.add(showScriptDescription, 1, 1);
    this.themeGrid.add(scale, 0, 2);
    this.themeGrid.add(scaleDescription, 1, 2);
}
Also used : TextWithStyle(org.phoenicis.javafx.views.common.TextWithStyle) GridPane(javafx.scene.layout.GridPane) Slider(javafx.scene.control.Slider) CheckBox(javafx.scene.control.CheckBox) Label(javafx.scene.control.Label)

Example 17 with CheckBox

use of javafx.scene.control.CheckBox in project trex-stateless-gui by cisco-system-traffic-generator.

the class UDPProtocolView method buildCustomProtocolView.

/**
     * Build custom view
     */
@Override
protected void buildCustomProtocolView() {
    // add src port
    srcPortCB = new CheckBox("Override source port");
    addCheckBox(srcPortCB, 13, 10);
    srcPort = new TextField();
    addInput(srcPort, 10, 210, 220);
    srcPort.disableProperty().bind(srcPortCB.selectedProperty().not());
    // add dst port
    dstPortCB = new CheckBox("Override destination port");
    addCheckBox(dstPortCB, 48, 10);
    dstPort = new TextField();
    addInput(dstPort, 45, 210, 220);
    dstPort.disableProperty().bind(dstPortCB.selectedProperty().not());
    // add length
    lengthCB = new CheckBox("Override length");
    addCheckBox(lengthCB, 83, 10);
    length = new TextField();
    addInput(length, 80, 210, 220);
    length.disableProperty().bind(lengthCB.selectedProperty().not());
}
Also used : CheckBox(javafx.scene.control.CheckBox) TextField(javafx.scene.control.TextField)

Example 18 with CheckBox

use of javafx.scene.control.CheckBox in project bitsquare by bitsquare.

the class OKPayForm method addCurrenciesGrid.

private void addCurrenciesGrid(boolean isEditable) {
    Label label = addLabel(gridPane, ++gridRow, "Supported currencies:", 0);
    GridPane.setValignment(label, VPos.TOP);
    FlowPane flowPane = new FlowPane();
    flowPane.setPadding(new Insets(10, 10, 10, 10));
    flowPane.setVgap(10);
    flowPane.setHgap(10);
    if (isEditable)
        flowPane.setId("flow-pane-checkboxes-bg");
    else
        flowPane.setId("flow-pane-checkboxes-non-editable-bg");
    CurrencyUtil.getAllOKPayCurrencies().stream().forEach(e -> {
        CheckBox checkBox = new CheckBox(e.getCode());
        checkBox.setMouseTransparent(!isEditable);
        checkBox.setSelected(okPayAccount.getTradeCurrencies().contains(e));
        checkBox.setMinWidth(60);
        checkBox.setMaxWidth(checkBox.getMinWidth());
        checkBox.setTooltip(new Tooltip(e.getName()));
        checkBox.setOnAction(event -> {
            if (checkBox.isSelected())
                okPayAccount.addCurrency(e);
            else
                okPayAccount.removeCurrency(e);
            updateAllInputsValid();
        });
        flowPane.getChildren().add(checkBox);
    });
    GridPane.setRowIndex(flowPane, gridRow);
    GridPane.setColumnIndex(flowPane, 1);
    gridPane.getChildren().add(flowPane);
}
Also used : Insets(javafx.geometry.Insets) CheckBox(javafx.scene.control.CheckBox) Tooltip(javafx.scene.control.Tooltip) Label(javafx.scene.control.Label) FlowPane(javafx.scene.layout.FlowPane)

Example 19 with CheckBox

use of javafx.scene.control.CheckBox in project bitsquare by bitsquare.

the class SendAlertMessageWindow method addContent.

private void addContent() {
    InputTextField keyInputTextField = addLabelInputTextField(gridPane, ++rowIndex, "Alert private key:", 10).second;
    Tuple2<Label, TextArea> labelTextAreaTuple2 = addLabelTextArea(gridPane, ++rowIndex, "Alert message:", "Enter message");
    TextArea alertMessageTextArea = labelTextAreaTuple2.second;
    Label first = labelTextAreaTuple2.first;
    first.setMinWidth(150);
    CheckBox isUpdateCheckBox = addLabelCheckBox(gridPane, ++rowIndex, "Is update notification:", "").second;
    isUpdateCheckBox.setSelected(true);
    InputTextField versionInputTextField = addLabelInputTextField(gridPane, ++rowIndex, "New version no.:").second;
    versionInputTextField.disableProperty().bind(isUpdateCheckBox.selectedProperty().not());
    sendButton = new Button("Send notification");
    sendButton.setOnAction(e -> {
        if (alertMessageTextArea.getText().length() > 0 && keyInputTextField.getText().length() > 0) {
            if (sendAlertMessageHandler.handle(new Alert(alertMessageTextArea.getText(), isUpdateCheckBox.isSelected(), versionInputTextField.getText()), keyInputTextField.getText()))
                hide();
            else
                new Popup().warning("The key you entered was not correct.").width(300).onClose(() -> blurAgain()).show();
        }
    });
    Button removeAlertMessageButton = new Button("Remove notification");
    removeAlertMessageButton.setOnAction(e -> {
        if (keyInputTextField.getText().length() > 0) {
            if (removeAlertMessageHandler.handle(keyInputTextField.getText()))
                hide();
            else
                new Popup().warning("The key you entered was not correct.").width(300).onClose(() -> blurAgain()).show();
        }
    });
    closeButton = new Button("Close");
    closeButton.setOnAction(e -> {
        hide();
        closeHandlerOptional.ifPresent(closeHandler -> closeHandler.run());
    });
    HBox hBox = new HBox();
    hBox.setSpacing(10);
    GridPane.setRowIndex(hBox, ++rowIndex);
    GridPane.setColumnIndex(hBox, 1);
    hBox.getChildren().addAll(sendButton, removeAlertMessageButton, closeButton);
    gridPane.getChildren().add(hBox);
    GridPane.setMargin(hBox, new Insets(10, 0, 0, 0));
}
Also used : HBox(javafx.scene.layout.HBox) Insets(javafx.geometry.Insets) TextArea(javafx.scene.control.TextArea) Button(javafx.scene.control.Button) InputTextField(io.bitsquare.gui.components.InputTextField) CheckBox(javafx.scene.control.CheckBox) Popup(io.bitsquare.gui.main.overlays.popups.Popup) Label(javafx.scene.control.Label) Alert(io.bitsquare.alert.Alert)

Example 20 with CheckBox

use of javafx.scene.control.CheckBox in project mybatis-generator-gui-extension by spawpaw.

the class CheckBoxControl method initView.

@Override
protected void initView() {
    checkBox = new CheckBox();
    layout.getChildren().addAll(checkBox);
    checkBox.setTooltip(tooltip);
}
Also used : CheckBox(javafx.scene.control.CheckBox)

Aggregations

CheckBox (javafx.scene.control.CheckBox)20 Label (javafx.scene.control.Label)5 TextField (javafx.scene.control.TextField)5 Insets (javafx.geometry.Insets)4 JFXCheckBox (com.jfoenix.controls.JFXCheckBox)3 Button (javafx.scene.control.Button)3 TextArea (javafx.scene.control.TextArea)3 ObservableValue (javafx.beans.value.ObservableValue)2 Scene (javafx.scene.Scene)2 Slider (javafx.scene.control.Slider)2 AnchorPane (javafx.scene.layout.AnchorPane)2 FlowPane (javafx.scene.layout.FlowPane)2 HBox (javafx.scene.layout.HBox)2 MultiplierType (com.exalttech.trex.ui.MultiplierType)1 MultiplierOption (com.exalttech.trex.ui.components.MultiplierOption)1 TextFieldTableViewCell (com.exalttech.trex.ui.components.TextFieldTableViewCell)1 Alert (io.bitsquare.alert.Alert)1 InputTextField (io.bitsquare.gui.components.InputTextField)1 Popup (io.bitsquare.gui.main.overlays.popups.Popup)1 FormBuilder.addCheckBox (io.bitsquare.gui.util.FormBuilder.addCheckBox)1