use of javafx.scene.layout.AnchorPane in project jphp by jphp-compiler.
the class UXWindow method makeVirtualLayout.
@Signature
public void makeVirtualLayout(Environment env) {
Parent layout = getLayout(env);
data(env, "~~virtual-layout", Memory.wrap(env, layout));
getWrappedObject().getScene().setRoot(new AnchorPane());
}
use of javafx.scene.layout.AnchorPane in project bitsquare by bitsquare.
the class MainView method createFooter.
private AnchorPane createFooter() {
// line
Separator separator = new Separator();
separator.setId("footer-pane-line");
separator.setPrefHeight(1);
setLeftAnchor(separator, 0d);
setRightAnchor(separator, 0d);
setTopAnchor(separator, 0d);
// BTC
Label btcInfoLabel = new Label();
btcInfoLabel.setId("footer-pane");
btcInfoLabel.textProperty().bind(model.btcInfo);
ProgressBar blockchainSyncIndicator = new ProgressBar(-1);
blockchainSyncIndicator.setPrefWidth(120);
blockchainSyncIndicator.setMaxHeight(10);
blockchainSyncIndicator.progressProperty().bind(model.btcSyncProgress);
model.walletServiceErrorMsg.addListener((ov, oldValue, newValue) -> {
if (newValue != null) {
btcInfoLabel.setId("splash-error-state-msg");
if (btcNetworkWarnMsgPopup == null) {
btcNetworkWarnMsgPopup = new Popup<>().warning(newValue);
btcNetworkWarnMsgPopup.show();
}
} else {
btcInfoLabel.setId("footer-pane");
if (btcNetworkWarnMsgPopup != null)
btcNetworkWarnMsgPopup.hide();
}
});
model.btcSyncProgress.addListener((ov, oldValue, newValue) -> {
if ((double) newValue >= 1) {
blockchainSyncIndicator.setVisible(false);
blockchainSyncIndicator.setManaged(false);
}
});
HBox blockchainSyncBox = new HBox();
blockchainSyncBox.setSpacing(10);
blockchainSyncBox.setAlignment(Pos.CENTER);
blockchainSyncBox.getChildren().addAll(btcInfoLabel, blockchainSyncIndicator);
setLeftAnchor(blockchainSyncBox, 10d);
setBottomAnchor(blockchainSyncBox, 7d);
// version
Label versionLabel = new Label();
versionLabel.setId("footer-pane");
versionLabel.setTextAlignment(TextAlignment.CENTER);
versionLabel.setAlignment(Pos.BASELINE_CENTER);
versionLabel.setText(model.version);
root.widthProperty().addListener((ov, oldValue, newValue) -> {
versionLabel.setLayoutX(((double) newValue - versionLabel.getWidth()) / 2);
});
setBottomAnchor(versionLabel, 7d);
// P2P Network
Label p2PNetworkLabel = new Label();
p2PNetworkLabel.setId("footer-pane");
setRightAnchor(p2PNetworkLabel, 33d);
setBottomAnchor(p2PNetworkLabel, 7d);
p2PNetworkLabel.textProperty().bind(model.p2PNetworkInfo);
ImageView p2PNetworkIcon = new ImageView();
setRightAnchor(p2PNetworkIcon, 10d);
setBottomAnchor(p2PNetworkIcon, 7d);
p2PNetworkIcon.setOpacity(0.4);
p2PNetworkIcon.idProperty().bind(model.p2PNetworkIconId);
p2PNetworkLabel.idProperty().bind(model.p2pNetworkLabelId);
model.p2pNetworkWarnMsg.addListener((ov, oldValue, newValue) -> {
if (newValue != null) {
p2PNetworkWarnMsgPopup = new Popup<>().warning(newValue);
p2PNetworkWarnMsgPopup.show();
} else if (p2PNetworkWarnMsgPopup != null) {
p2PNetworkWarnMsgPopup.hide();
}
});
model.bootstrapComplete.addListener((observable, oldValue, newValue) -> {
p2PNetworkIcon.setOpacity(1);
});
return new AnchorPane(separator, blockchainSyncBox, versionLabel, p2PNetworkLabel, p2PNetworkIcon) {
{
setId("footer-pane");
setMinHeight(30);
setMaxHeight(30);
}
};
}
use of javafx.scene.layout.AnchorPane in project bitsquare by bitsquare.
the class AltCoinAccountsView method buildForm.
///////////////////////////////////////////////////////////////////////////////////////////
// Base form
///////////////////////////////////////////////////////////////////////////////////////////
private void buildForm() {
addTitledGroupBg(root, gridRow, 1, "Manage accounts");
Tuple2<Label, ListView> tuple = addLabelListView(root, gridRow, "Your altcoin accounts:", Layout.FIRST_ROW_DISTANCE);
GridPane.setValignment(tuple.first, VPos.TOP);
paymentAccountsListView = tuple.second;
paymentAccountsListView.setPrefHeight(2 * Layout.LIST_ROW_HEIGHT + 14);
paymentAccountsListView.setCellFactory(new Callback<ListView<PaymentAccount>, ListCell<PaymentAccount>>() {
@Override
public ListCell<PaymentAccount> call(ListView<PaymentAccount> list) {
return new ListCell<PaymentAccount>() {
final Label label = new Label();
final ImageView icon = ImageUtil.getImageViewById(ImageUtil.REMOVE_ICON);
final Button removeButton = new Button("", icon);
final AnchorPane pane = new AnchorPane(label, removeButton);
{
label.setLayoutY(5);
removeButton.setId("icon-button");
AnchorPane.setRightAnchor(removeButton, 0d);
}
@Override
public void updateItem(final PaymentAccount item, boolean empty) {
super.updateItem(item, empty);
if (item != null && !empty) {
label.setText(item.getAccountName());
removeButton.setOnAction(e -> onDeleteAccount(item));
setGraphic(pane);
} else {
setGraphic(null);
}
}
};
}
});
Tuple3<Button, Button, Button> tuple3 = add3ButtonsAfterGroup(root, ++gridRow, "Add new account", "Export Accounts", "Import Accounts");
addAccountButton = tuple3.first;
exportButton = tuple3.second;
importButton = tuple3.third;
}
use of javafx.scene.layout.AnchorPane in project bitsquare by bitsquare.
the class ArbitratorSelectionView method addLanguageGroup.
///////////////////////////////////////////////////////////////////////////////////////////
// UI builder
///////////////////////////////////////////////////////////////////////////////////////////
private void addLanguageGroup() {
addTitledGroupBg(root, gridRow, 1, "Which languages do you speak?");
Tuple2<Label, ListView> tuple = addLabelListView(root, gridRow, "Your languages:", Layout.FIRST_ROW_DISTANCE);
GridPane.setValignment(tuple.first, VPos.TOP);
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 Label();
final ImageView icon = ImageUtil.getImageViewById(ImageUtil.REMOVE_ICON);
final Button removeButton = new Button("", 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);
}
}
};
}
});
languageComboBox = addLabelComboBox(root, ++gridRow, "", 15).second;
languageComboBox.setPromptText("Add language");
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 bitsquare by bitsquare.
the class FiatAccountsView method buildForm.
///////////////////////////////////////////////////////////////////////////////////////////
// Base form
///////////////////////////////////////////////////////////////////////////////////////////
private void buildForm() {
addTitledGroupBg(root, gridRow, 1, "Manage accounts");
Tuple2<Label, ListView> tuple = addLabelListView(root, gridRow, "Your national currency\naccounts:", Layout.FIRST_ROW_DISTANCE);
GridPane.setValignment(tuple.first, VPos.TOP);
tuple.first.setTextAlignment(TextAlignment.RIGHT);
paymentAccountsListView = tuple.second;
paymentAccountsListView.setPrefHeight(2 * Layout.LIST_ROW_HEIGHT + 14);
paymentAccountsListView.setCellFactory(new Callback<ListView<PaymentAccount>, ListCell<PaymentAccount>>() {
@Override
public ListCell<PaymentAccount> call(ListView<PaymentAccount> list) {
return new ListCell<PaymentAccount>() {
final Label label = new Label();
final ImageView icon = ImageUtil.getImageViewById(ImageUtil.REMOVE_ICON);
final Button removeButton = new Button("", icon);
final AnchorPane pane = new AnchorPane(label, removeButton);
{
label.setLayoutY(5);
removeButton.setId("icon-button");
AnchorPane.setRightAnchor(removeButton, 0d);
}
@Override
public void updateItem(final PaymentAccount item, boolean empty) {
super.updateItem(item, empty);
if (item != null && !empty) {
label.setText(item.getAccountName());
removeButton.setOnAction(e -> onDeleteAccount(item));
setGraphic(pane);
} else {
setGraphic(null);
}
}
};
}
});
Tuple3<Button, Button, Button> tuple3 = add3ButtonsAfterGroup(root, ++gridRow, "Add new account", "Export Accounts", "Import Accounts");
addAccountButton = tuple3.first;
exportButton = tuple3.second;
importButton = tuple3.third;
}
Aggregations