use of javafx.beans.binding.StringExpression in project VocabHunter by VocabHunter.
the class ProgressController method bindValueLabel.
private void bindValueLabel(final Label valueLabel, final ObservableNumberValue property) {
StringExpression binding = i18nManager.textBinding(PROGRESS_WORD_COUNT, property);
valueLabel.textProperty().bind(binding);
}
use of javafx.beans.binding.StringExpression in project VocabHunter by VocabHunter.
the class I18nManagerTest method validatePercentage.
private void validatePercentage(final String expected, final double value) {
SimpleDoubleProperty property = new SimpleDoubleProperty(value);
StringExpression result = target.textBinding(STATUS_MARKED_PERCENTAGE, property);
assertEquals(expected, result.getValue());
}
use of javafx.beans.binding.StringExpression in project NMEAParser by tvesalainen.
the class MainApp method start.
@Override
public void start(Stage stage) throws Exception {
Locale locale = Locale.getDefault();
bundle = I18n.get(locale);
// preferences
preferences = new ViewerPreferences();
ViewerPage preferencesPage = ViewerPage.loadPreferencePage(preferences, "/fxml/preferences.fxml", bundle);
service = new ViewerService(executor, preferences, locale);
StringBinding colorBinding = service.bindBackgroundColors();
StringExpression styleExpression = Bindings.concat("-fx-base: ", colorBinding, ";", "-fx-font-family: ", preferences.getBinding("fontFamily"), ";");
preferencesPage.getParent().styleProperty().bind(styleExpression);
// pages
ViewerPage sailPage1 = ViewerPage.loadPage(service, "/fxml/sailPage1.fxml", bundle, styleExpression);
service.start();
Property<Integer> currentPage = new SimpleObjectProperty<>(0);
preferences.bindInteger("currentPage", 0, currentPage);
Scene scene = new ViewerScene(stage, currentPage, preferencesPage, sailPage1);
scene.getStylesheets().add("/styles/Styles.css");
stage.setScene(scene);
// stage.setFullScreen(true);
I18n.bind(stage.titleProperty(), "mainTitle");
I18n.bind(stage.fullScreenExitHintProperty(), "fullScreenExitHint");
stage.show();
}
Aggregations