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);
}
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());
}
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);
}
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));
}
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);
}
Aggregations