Search in sources :

Example 1 with MaterialDesignLabel

use of jgnash.uifx.resource.font.MaterialDesignLabel in project jgnash by ccavanaugh.

the class SelectAccountSecuritiesDialog method createButtonBox.

private VBox createButtonBox() {
    final VBox vBox = new VBox();
    vBox.setFillWidth(true);
    vBox.getStyleClass().add("form");
    moveToTarget = new Button("", new MaterialDesignLabel(MaterialDesignLabel.MDIcon.CHEVRON_RIGHT));
    moveToTarget.getStyleClass().add(StyleClass.LIST_BUTTON_STYLE);
    moveToSource = new Button("", new MaterialDesignLabel(MaterialDesignLabel.MDIcon.CHEVRON_LEFT));
    moveToSource.getStyleClass().add(StyleClass.LIST_BUTTON_STYLE);
    moveToTarget.setMaxWidth(Double.MAX_VALUE);
    moveToSource.setMaxWidth(Double.MAX_VALUE);
    sourceListView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
    targetListView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
    sourceListView.selectionModelProperty().addListener(listener -> bindMoveButtonsToListItems());
    targetListView.selectionModelProperty().addListener(listener -> bindMoveButtonsToListItems());
    bindMoveButtonsToListItems();
    moveToTarget.setOnAction(event -> moveItemsToTarget());
    moveToSource.setOnAction(event -> moveItemsToSource());
    vBox.getChildren().addAll(moveToTarget, moveToSource);
    return vBox;
}
Also used : Button(javafx.scene.control.Button) MaterialDesignLabel(jgnash.uifx.resource.font.MaterialDesignLabel) VBox(javafx.scene.layout.VBox)

Example 2 with MaterialDesignLabel

use of jgnash.uifx.resource.font.MaterialDesignLabel in project jgnash by ccavanaugh.

the class ExceptionDialog method initialize.

@FXML
private void initialize() {
    message.setGraphic(new MaterialDesignLabel(MaterialDesignLabel.MDIcon.EXCLAMATION_TRIANGLE, ThemeManager.getBaseTextHeight() * Alert.HEIGHT_MULTIPLIER, Color.DARKRED));
    closeButton.setOnAction(event -> ((Stage) parent.get().getWindow()).close());
    clipboardButton.setOnAction(event -> {
        Clipboard clipboard = Clipboard.getSystemClipboard();
        Map<DataFormat, Object> map = new HashMap<>();
        map.put(DataFormat.PLAIN_TEXT, stackTrace);
        clipboard.setContent(map);
    });
}
Also used : HashMap(java.util.HashMap) DataFormat(javafx.scene.input.DataFormat) MaterialDesignLabel(jgnash.uifx.resource.font.MaterialDesignLabel) Clipboard(javafx.scene.input.Clipboard) InjectFXML(jgnash.uifx.util.InjectFXML) FXML(javafx.fxml.FXML)

Example 3 with MaterialDesignLabel

use of jgnash.uifx.resource.font.MaterialDesignLabel in project jgnash by ccavanaugh.

the class ControlsTest method start.

@Override
public void start(final Stage primaryStage) {
    Engine engine = createEngine();
    Objects.requireNonNull(engine);
    ThemeManager.restoreLastUsedTheme();
    DecimalTextField decimalTextField = new DecimalTextField();
    DecimalTextField decimalTextField2 = new DecimalTextField();
    decimalTextField2.scaleProperty().set(4);
    primaryStage.setTitle("Controls Test");
    Button btn = new Button();
    btn.setText("getDecimal()");
    // Create the DatePicker.
    DatePicker datePicker = new DatePickerEx();
    datePicker.setOnAction(event -> {
        LocalDate date = datePicker.getValue();
        System.out.println("Selected date: " + date);
    });
    decimalTextField.decimalProperty().addListener((observable, oldValue, newValue) -> System.out.println("decimalTextField: " + newValue));
    decimalTextField2.decimalProperty().addListener((observable, oldValue, newValue) -> System.out.println("decimalTextField2: " + newValue));
    ObjectProperty<BigDecimal> decimal = new SimpleObjectProperty<>();
    decimalTextField2.decimalProperty().bindBidirectional(decimal);
    decimal.set(BigDecimal.TEN);
    btn.setOnAction(event -> {
        decimal.set(BigDecimal.ONE);
        System.out.println(decimalTextField2.getDecimal());
    });
    System.out.println(decimal.isBound());
    System.out.println(decimalTextField2.decimalProperty().isBound());
    TransactionNumberComboBox numberComboBox = new TransactionNumberComboBox();
    numberComboBox.accountProperty().set(engine.getAccountList().get(0));
    Button exceptionButton = new Button("Show Exception");
    exceptionButton.setOnAction(event -> StaticUIMethods.displayException(new Exception("Test exception")));
    SecurityComboBox securityComboBox = new SecurityComboBox();
    TextFieldEx textFieldEx = new TextFieldEx();
    PopOverButton popOverButton = new PopOverButton(new MaterialDesignLabel(MaterialDesignLabel.MDIcon.SWAP_HORIZONTAL));
    popOverButton.setContentNode(new DecimalTextField());
    DetailedDecimalTextField detailedDecimalTextField2 = new DetailedDecimalTextField();
    VBox vBox = new VBox();
    vBox.getChildren().addAll(decimalTextField, decimalTextField2, datePicker, new AccountComboBox(), numberComboBox, btn, exceptionButton, securityComboBox, new TimePeriodComboBox(), textFieldEx, popOverButton, detailedDecimalTextField2);
    primaryStage.setScene(new Scene(vBox, 300, 420));
    ThemeManager.applyStyleSheets(primaryStage.getScene());
    primaryStage.getScene().getRoot().getStyleClass().addAll("form", "dialog");
    primaryStage.show();
    primaryStage.requestFocus();
}
Also used : DatePickerEx(jgnash.uifx.control.DatePickerEx) TextFieldEx(jgnash.uifx.control.TextFieldEx) TimePeriodComboBox(jgnash.uifx.control.TimePeriodComboBox) Scene(javafx.scene.Scene) LocalDate(java.time.LocalDate) BigDecimal(java.math.BigDecimal) IOException(java.io.IOException) DetailedDecimalTextField(jgnash.uifx.control.DetailedDecimalTextField) SimpleObjectProperty(javafx.beans.property.SimpleObjectProperty) DetailedDecimalTextField(jgnash.uifx.control.DetailedDecimalTextField) DecimalTextField(jgnash.uifx.control.DecimalTextField) AccountComboBox(jgnash.uifx.control.AccountComboBox) Button(javafx.scene.control.Button) PopOverButton(jgnash.uifx.control.PopOverButton) PopOverButton(jgnash.uifx.control.PopOverButton) MaterialDesignLabel(jgnash.uifx.resource.font.MaterialDesignLabel) DatePicker(javafx.scene.control.DatePicker) SecurityComboBox(jgnash.uifx.control.SecurityComboBox) TransactionNumberComboBox(jgnash.uifx.control.TransactionNumberComboBox) VBox(javafx.scene.layout.VBox) Engine(jgnash.engine.Engine)

Aggregations

MaterialDesignLabel (jgnash.uifx.resource.font.MaterialDesignLabel)3 Button (javafx.scene.control.Button)2 VBox (javafx.scene.layout.VBox)2 IOException (java.io.IOException)1 BigDecimal (java.math.BigDecimal)1 LocalDate (java.time.LocalDate)1 HashMap (java.util.HashMap)1 SimpleObjectProperty (javafx.beans.property.SimpleObjectProperty)1 FXML (javafx.fxml.FXML)1 Scene (javafx.scene.Scene)1 DatePicker (javafx.scene.control.DatePicker)1 Clipboard (javafx.scene.input.Clipboard)1 DataFormat (javafx.scene.input.DataFormat)1 Engine (jgnash.engine.Engine)1 AccountComboBox (jgnash.uifx.control.AccountComboBox)1 DatePickerEx (jgnash.uifx.control.DatePickerEx)1 DecimalTextField (jgnash.uifx.control.DecimalTextField)1 DetailedDecimalTextField (jgnash.uifx.control.DetailedDecimalTextField)1 PopOverButton (jgnash.uifx.control.PopOverButton)1 SecurityComboBox (jgnash.uifx.control.SecurityComboBox)1