use of javafx.scene.layout.AnchorPane in project bisq-desktop by bisq-network.
the class ArbitratorSelectionView method addLanguageGroup.
// /////////////////////////////////////////////////////////////////////////////////////////
// UI builder
// /////////////////////////////////////////////////////////////////////////////////////////
private void addLanguageGroup() {
addTitledGroupBg(root, gridRow, 1, Res.get("account.arbitratorSelection.whichLanguages"));
Tuple2<Label, ListView> tuple = addLabelListView(root, gridRow, Res.get("shared.yourLanguage"), Layout.FIRST_ROW_DISTANCE);
GridPane.setValignment(tuple.first, VPos.TOP);
// noinspection unchecked
languagesListView = tuple.second;
languagesListView.setMinHeight(3 * Layout.LIST_ROW_HEIGHT + 2);
languagesListView.setMaxHeight(6 * Layout.LIST_ROW_HEIGHT + 2);
languagesListView.setCellFactory(new Callback<ListView<String>, ListCell<String>>() {
@Override
public ListCell<String> call(ListView<String> list) {
return new ListCell<String>() {
final Label label = new AutoTooltipLabel();
final ImageView icon = ImageUtil.getImageViewById(ImageUtil.REMOVE_ICON);
final Button removeButton = new AutoTooltipButton("", icon);
final AnchorPane pane = new AnchorPane(label, removeButton);
{
label.setLayoutY(5);
removeButton.setId("icon-button");
AnchorPane.setRightAnchor(removeButton, 0d);
}
@Override
public void updateItem(final String item, boolean empty) {
super.updateItem(item, empty);
if (item != null && !empty) {
label.setText(LanguageUtil.getDisplayName(item));
removeButton.setOnAction(e -> onRemoveLanguage(item));
setGraphic(pane);
} else {
setGraphic(null);
}
}
};
}
});
// noinspection unchecked
languageComboBox = addLabelComboBox(root, ++gridRow, "", 15).second;
languageComboBox.setPromptText(Res.get("shared.addLanguage"));
languageComboBox.setConverter(new StringConverter<String>() {
@Override
public String toString(String code) {
return LanguageUtil.getDisplayName(code);
}
@Override
public String fromString(String s) {
return null;
}
});
languageComboBox.setOnAction(e -> onAddLanguage());
}
use of javafx.scene.layout.AnchorPane in project bisq-desktop by bisq-network.
the class TradeSubView method addContentPane.
private void addContentPane() {
contentPane = new AnchorPane();
HBox.setHgrow(contentPane, Priority.SOMETIMES);
getChildren().add(contentPane);
}
use of javafx.scene.layout.AnchorPane in project org.csstudio.display.builder by kasemir.
the class SymbolRepresentation method createJFXNode.
@Override
protected AnchorPane createJFXNode() throws Exception {
autoSize = model_widget.propAutoSize().getValue();
if (autoSize) {
model_widget.propWidth().setValue((int) Math.round(maxSize.getWidth()));
model_widget.propHeight().setValue((int) Math.round(maxSize.getHeight()));
}
AnchorPane symbol = new AnchorPane();
imagePane = new BorderPane();
imageView = new ImageView();
setImageIndex(Math.min(Math.max(model_widget.propInitialIndex().getValue(), 0), imagesList.size() - 1));
imageView.setPreserveRatio(model_widget.propPreserveRatio().getValue());
imageView.setSmooth(true);
imageView.fitHeightProperty().bind(symbol.prefHeightProperty());
imageView.fitWidthProperty().bind(symbol.prefWidthProperty());
imageView.imageProperty().bind(Bindings.createObjectBinding(() -> (getImageIndex() >= 0) ? imagesList.get(getImageIndex()) : getDefaultSymbol(), imageIndexProperty()));
imagePane.setCenter(imageView);
imagePane.setPrefWidth(model_widget.propWidth().getValue());
imagePane.setPrefHeight(model_widget.propHeight().getValue());
imagePane.setRotate(model_widget.propRotation().getValue());
AnchorPane.setLeftAnchor(imagePane, 0.0);
AnchorPane.setRightAnchor(imagePane, 0.0);
AnchorPane.setTopAnchor(imagePane, 0.0);
AnchorPane.setBottomAnchor(imagePane, 0.0);
BorderPane circlePane = new BorderPane();
indexLabelBackground = new Circle(16.0, Color.BLACK.deriveColor(0.0, 0.0, 0.0, 0.75));
indexLabelBackground.setStroke(Color.LIGHTGRAY.deriveColor(0.0, 1.0, 1.0, 0.75));
indexLabelBackground.setVisible(model_widget.propShowIndex().getValue());
circlePane.setCenter(indexLabelBackground);
AnchorPane.setLeftAnchor(circlePane, 0.0);
AnchorPane.setRightAnchor(circlePane, 0.0);
AnchorPane.setTopAnchor(circlePane, 0.0);
AnchorPane.setBottomAnchor(circlePane, 0.0);
indexLabel = new Label();
indexLabel.setAlignment(Pos.CENTER);
indexLabel.setFont(Font.font(indexLabel.getFont().getFamily(), FontWeight.BOLD, 16));
indexLabel.setTextFill(Color.WHITE);
indexLabel.setVisible(model_widget.propShowIndex().getValue());
indexLabel.textProperty().bind(Bindings.convert(imageIndexProperty()));
AnchorPane.setLeftAnchor(indexLabel, 0.0);
AnchorPane.setRightAnchor(indexLabel, 0.0);
AnchorPane.setTopAnchor(indexLabel, 0.0);
AnchorPane.setBottomAnchor(indexLabel, 0.0);
symbol.getChildren().addAll(imagePane, circlePane, indexLabel);
if (model_widget.propTransparent().getValue()) {
symbol.setBackground(null);
} else {
symbol.setBackground(new Background(new BackgroundFill(JFXUtil.convert(model_widget.propBackgroundColor().getValue()), CornerRadii.EMPTY, Insets.EMPTY)));
}
enabled = model_widget.propEnabled().getValue();
Styles.update(symbol, Styles.NOT_ENABLED, !enabled);
imageChanged(null, null, null);
return symbol;
}
use of javafx.scene.layout.AnchorPane in project blue by kunstmusik.
the class SimpleCSSEditor method editCSS.
public static void editCSS(Node node) {
// StyleManager.getInstance().addUserAgentStylesheet(null);
FXMLLoader loader = new FXMLLoader(SimpleCSSEditor.class.getResource("SimpleCSSEditor.fxml"));
try {
AnchorPane pane = loader.load();
SimpleCSSEditorController controller = loader.getController();
Stage stage = new Stage();
stage.setScene(new Scene(pane));
stage.setAlwaysOnTop(true);
stage.show();
controller.setNode(node);
} catch (IOException ex) {
Exceptions.printStackTrace(ex);
}
}
use of javafx.scene.layout.AnchorPane in project RIS-PACS by KyleRemil.
the class Main method start.
@Override
public void start(Stage primaryStage) {
try {
AnchorPane root = (AnchorPane) FXMLLoader.load(getClass().getResource("../com/rispacs/view/LoginView.fxml"));
Scene scene = new Scene(root);
scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm());
primaryStage.setScene(scene);
primaryStage.show();
} catch (Exception e) {
e.printStackTrace();
}
}
Aggregations