use of javafx.scene.control.CheckBox in project JFoenix by jfoenixadmin.
the class JFXCheckBoxOldSkin method layoutChildren.
@Override
protected void layoutChildren(final double x, final double y, final double w, final double h) {
final CheckBox checkBox = getSkinnable();
boxWidth = snapSize(container.prefWidth(-1));
boxHeight = snapSize(container.prefHeight(-1));
final double computeWidth = Math.min(checkBox.prefWidth(-1), checkBox.minWidth(-1)) + labelOffset + 2 * padding;
final double labelWidth = Math.min(computeWidth - boxWidth, w - snapSize(boxWidth)) + labelOffset + 2 * padding;
final double labelHeight = Math.min(checkBox.prefHeight(labelWidth), h);
maxHeight = Math.max(boxHeight, labelHeight);
final double xOffset = computeXOffset(w, labelWidth + boxWidth, checkBox.getAlignment().getHpos()) + x;
final double yOffset = computeYOffset(h, maxHeight, checkBox.getAlignment().getVpos()) + x;
if (invalid) {
rightLine.setStartX((boxWidth + padding - labelOffset) / 2 - boxWidth / 5.5);
rightLine.setStartY(maxHeight - padding - lineThick);
rightLine.setEndX((boxWidth + padding - labelOffset) / 2 - boxWidth / 5.5);
rightLine.setEndY(maxHeight - padding - lineThick);
leftLine.setStartX((boxWidth + padding - labelOffset) / 2 - boxWidth / 5.5);
leftLine.setStartY(maxHeight - padding - lineThick);
leftLine.setEndX((boxWidth + padding - labelOffset) / 2 - boxWidth / 5.5);
leftLine.setEndY(maxHeight - padding - lineThick);
transition = new CheckBoxTransition();
if (getSkinnable().isSelected())
transition.play();
invalid = false;
}
layoutLabelInArea(xOffset + boxWidth, yOffset, labelWidth, maxHeight, checkBox.getAlignment());
container.resize(boxWidth, boxHeight);
positionInArea(container, xOffset, yOffset, boxWidth, maxHeight, 0, checkBox.getAlignment().getHpos(), checkBox.getAlignment().getVpos());
}
use of javafx.scene.control.CheckBox in project JFoenix by jfoenixadmin.
the class CheckBoxDemo method start.
@Override
public void start(Stage stage) {
FlowPane main = new FlowPane();
main.setVgap(20);
main.setHgap(20);
CheckBox cb = new CheckBox("CheckBox");
JFXCheckBox jfxCheckBox = new JFXCheckBox("JFX CheckBox");
JFXCheckBox customJFXCheckBox = new JFXCheckBox("JFX CheckBox");
customJFXCheckBox.getStyleClass().add("custom-jfx-check-box");
main.getChildren().add(cb);
main.getChildren().add(jfxCheckBox);
main.getChildren().add(customJFXCheckBox);
StackPane pane = new StackPane();
pane.getChildren().add(main);
StackPane.setMargin(main, new Insets(100));
pane.setStyle("-fx-background-color:WHITE");
final Scene scene = new Scene(pane, 600, 200);
scene.getStylesheets().add(CheckBoxDemo.class.getResource("/resources/css/jfoenix-components.css").toExternalForm());
stage.setTitle("JFX CheckBox Demo ");
stage.setScene(scene);
stage.setResizable(false);
stage.show();
}
use of javafx.scene.control.CheckBox in project FXyzLib by Birdasaur.
the class BillBoardBehaviorTest method createOverlay.
private void createOverlay() {
Button b = new Button("Activate");
b.setPrefSize(150, 40);
b.setFocusTraversable(false);
b.setOnAction(e -> {
if (!active) {
bill.startBillboardBehavior();
active = true;
b.setText("Disable");
} else {
bill.stopBillboardBehavior();
active = false;
b.setText("Enable");
}
});
CheckBox c = new CheckBox("Toggle Cylindrical Mode");
c.setFont(Font.font(24));
c.setFocusTraversable(false);
c.setOnAction(e -> {
if (c.isSelected()) {
bill.setBillboardMode(BillboardBehavior.BillboardMode.CYLINDRICAL);
} else {
bill.setBillboardMode(BillboardBehavior.BillboardMode.SPHERICAL);
}
});
StackPane.setAlignment(b, Pos.TOP_LEFT);
StackPane.setMargin(b, new Insets(10));
StackPane.setAlignment(c, Pos.CENTER_LEFT);
StackPane.setMargin(c, new Insets(10));
rootPane.getChildren().addAll(b, c);
}
use of javafx.scene.control.CheckBox in project bitsquare by bitsquare.
the class ShowWalletDataWindow method addContent.
private void addContent() {
Tuple2<Label, TextArea> labelTextAreaTuple2 = addLabelTextArea(gridPane, ++rowIndex, "Wallet data:", "");
TextArea textArea = labelTextAreaTuple2.second;
Label label = labelTextAreaTuple2.first;
label.setMinWidth(150);
textArea.setPrefHeight(500);
textArea.setStyle("-fx-font-size: 10;");
CheckBox isUpdateCheckBox = addLabelCheckBox(gridPane, ++rowIndex, "Include private keys:", "").second;
isUpdateCheckBox.setSelected(false);
isUpdateCheckBox.selectedProperty().addListener((observable, oldValue, newValue) -> {
textArea.setText(walletService.exportWalletData(isUpdateCheckBox.isSelected()));
});
textArea.setText(walletService.exportWalletData(isUpdateCheckBox.isSelected()));
actionButtonText("Copy to clipboard");
onAction(() -> Utilities.copyToClipboard(textArea.getText()));
}
use of javafx.scene.control.CheckBox in project bitsquare by bitsquare.
the class Overlay method addDontShowAgainCheckBox.
protected void addDontShowAgainCheckBox() {
if (dontShowAgainId != null && preferences != null) {
if (dontShowAgainText == null)
dontShowAgainText = "Don't show again";
CheckBox dontShowAgainCheckBox = addCheckBox(gridPane, rowIndex, dontShowAgainText, buttonDistance - 1);
GridPane.setColumnIndex(dontShowAgainCheckBox, 0);
GridPane.setHalignment(dontShowAgainCheckBox, HPos.LEFT);
dontShowAgainCheckBox.setOnAction(e -> preferences.dontShowAgain(dontShowAgainId, dontShowAgainCheckBox.isSelected()));
}
}
Aggregations