Search in sources :

Example 1 with CheckBox

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());
}
Also used : CheckBox(javafx.scene.control.CheckBox) JFXCheckBox(com.jfoenix.controls.JFXCheckBox)

Example 2 with CheckBox

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();
}
Also used : Insets(javafx.geometry.Insets) JFXCheckBox(com.jfoenix.controls.JFXCheckBox) JFXCheckBox(com.jfoenix.controls.JFXCheckBox) CheckBox(javafx.scene.control.CheckBox) FlowPane(javafx.scene.layout.FlowPane) Scene(javafx.scene.Scene) StackPane(javafx.scene.layout.StackPane)

Example 3 with CheckBox

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);
}
Also used : Insets(javafx.geometry.Insets) Button(javafx.scene.control.Button) CheckBox(javafx.scene.control.CheckBox)

Example 4 with CheckBox

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()));
}
Also used : TextArea(javafx.scene.control.TextArea) FormBuilder.addLabelTextArea(io.bitsquare.gui.util.FormBuilder.addLabelTextArea) FormBuilder.addLabelCheckBox(io.bitsquare.gui.util.FormBuilder.addLabelCheckBox) CheckBox(javafx.scene.control.CheckBox) Label(javafx.scene.control.Label)

Example 5 with CheckBox

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()));
    }
}
Also used : FormBuilder.addCheckBox(io.bitsquare.gui.util.FormBuilder.addCheckBox) CheckBox(javafx.scene.control.CheckBox)

Aggregations

CheckBox (javafx.scene.control.CheckBox)19 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