use of bisq.desktop.components.AutoTooltipLabel in project bisq-desktop by bisq-network.
the class TradesChartsView method initialize.
@Override
public void initialize() {
toolBox = getToolBox();
createCharts();
createTable();
// set empty string for layout
nrOfTradeStatisticsLabel = new AutoTooltipLabel(" ");
nrOfTradeStatisticsLabel.setId("num-offers");
nrOfTradeStatisticsLabel.setPadding(new Insets(-5, 0, -10, 5));
root.getChildren().addAll(toolBox, priceChart, volumeChart, tableView, nrOfTradeStatisticsLabel);
timeUnitChangeListener = (observable, oldValue, newValue) -> {
if (newValue != null) {
model.setTickUnit((TradesChartsViewModel.TickUnit) newValue.getUserData());
priceAxisX.setTickLabelFormatter(getTimeAxisStringConverter());
volumeAxisX.setTickLabelFormatter(getTimeAxisStringConverter());
}
};
priceAxisYWidthListener = (observable, oldValue, newValue) -> {
priceAxisYWidth = (double) newValue;
layoutChart();
};
volumeAxisYWidthListener = (observable, oldValue, newValue) -> {
volumeAxisYWidth = (double) newValue;
layoutChart();
};
tradeStatisticsByCurrencyListener = c -> nrOfTradeStatisticsLabel.setText(Res.get("market.trades.nrOfTrades", model.tradeStatisticsByCurrency.size()));
parentHeightListener = (observable, oldValue, newValue) -> layout();
priceColumnLabelListener = (o, oldVal, newVal) -> priceColumn.setGraphic(new AutoTooltipLabel(newVal));
}
use of bisq.desktop.components.AutoTooltipLabel in project bisq-desktop by bisq-network.
the class ClosedTradesView method setDateColumnCellFactory.
private void setDateColumnCellFactory() {
dateColumn.setCellValueFactory((offer) -> new ReadOnlyObjectWrapper<>(offer.getValue()));
dateColumn.setCellFactory(new Callback<TableColumn<ClosedTradableListItem, ClosedTradableListItem>, TableCell<ClosedTradableListItem, ClosedTradableListItem>>() {
@Override
public TableCell<ClosedTradableListItem, ClosedTradableListItem> call(TableColumn<ClosedTradableListItem, ClosedTradableListItem> column) {
return new TableCell<ClosedTradableListItem, ClosedTradableListItem>() {
@Override
public void updateItem(final ClosedTradableListItem item, boolean empty) {
super.updateItem(item, empty);
if (item != null)
setGraphic(new AutoTooltipLabel(model.getDate(item)));
else
setGraphic(null);
}
};
}
});
}
use of bisq.desktop.components.AutoTooltipLabel in project bisq-desktop by bisq-network.
the class ClosedTradesView method setVolumeColumnCellFactory.
private void setVolumeColumnCellFactory() {
volumeColumn.setCellValueFactory((offer) -> new ReadOnlyObjectWrapper<>(offer.getValue()));
volumeColumn.setCellFactory(new Callback<TableColumn<ClosedTradableListItem, ClosedTradableListItem>, TableCell<ClosedTradableListItem, ClosedTradableListItem>>() {
@Override
public TableCell<ClosedTradableListItem, ClosedTradableListItem> call(TableColumn<ClosedTradableListItem, ClosedTradableListItem> column) {
return new TableCell<ClosedTradableListItem, ClosedTradableListItem>() {
@Override
public void updateItem(final ClosedTradableListItem item, boolean empty) {
super.updateItem(item, empty);
if (item != null)
setGraphic(new AutoTooltipLabel(model.getVolume(item)));
else
setGraphic(null);
}
};
}
});
}
use of bisq.desktop.components.AutoTooltipLabel in project bisq-desktop by bisq-network.
the class FailedTradesView method setVolumeColumnCellFactory.
private void setVolumeColumnCellFactory() {
volumeColumn.setCellValueFactory((offer) -> new ReadOnlyObjectWrapper<>(offer.getValue()));
volumeColumn.setCellFactory(new Callback<TableColumn<FailedTradesListItem, FailedTradesListItem>, TableCell<FailedTradesListItem, FailedTradesListItem>>() {
@Override
public TableCell<FailedTradesListItem, FailedTradesListItem> call(TableColumn<FailedTradesListItem, FailedTradesListItem> column) {
return new TableCell<FailedTradesListItem, FailedTradesListItem>() {
@Override
public void updateItem(final FailedTradesListItem item, boolean empty) {
super.updateItem(item, empty);
if (item != null)
setGraphic(new AutoTooltipLabel(model.getVolume(item)));
else
setGraphic(null);
}
};
}
});
}
use of bisq.desktop.components.AutoTooltipLabel in project bisq-desktop by bisq-network.
the class BuyerStep4View method addContent.
// /////////////////////////////////////////////////////////////////////////////////////////
// Content
// /////////////////////////////////////////////////////////////////////////////////////////
@SuppressWarnings("PointlessBooleanExpression")
@Override
protected void addContent() {
FormBuilder.addTitledGroupBg(gridPane, gridRow, 5, Res.get("portfolio.pending.step5_buyer.groupTitle"), 0);
FormBuilder.addLabelTextField(gridPane, gridRow, getBtcTradeAmountLabel(), model.getTradeVolume(), Layout.FIRST_ROW_DISTANCE);
FormBuilder.addLabelTextField(gridPane, ++gridRow, getFiatTradeAmountLabel(), model.getFiatVolume());
FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.get("portfolio.pending.step5_buyer.refunded"), model.getSecurityDeposit());
FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.get("portfolio.pending.step5_buyer.tradeFee"), model.getTradeFee());
final String miningFee = model.dataModel.isMaker() ? Res.get("portfolio.pending.step5_buyer.makersMiningFee") : Res.get("portfolio.pending.step5_buyer.takersMiningFee");
FormBuilder.addLabelTextField(gridPane, ++gridRow, miningFee, model.getTxFee());
withdrawTitledGroupBg = FormBuilder.addTitledGroupBg(gridPane, ++gridRow, 1, Res.get("portfolio.pending.step5_buyer.withdrawBTC"), Layout.GROUP_DISTANCE);
FormBuilder.addLabelTextField(gridPane, gridRow, Res.get("portfolio.pending.step5_buyer.amount"), model.getPayoutAmount(), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
final Tuple2<Label, InputTextField> tuple2 = FormBuilder.addLabelInputTextField(gridPane, ++gridRow, Res.get("portfolio.pending.step5_buyer.withdrawToAddress"));
withdrawAddressLabel = tuple2.first;
withdrawAddressLabel.setManaged(false);
withdrawAddressLabel.setVisible(false);
withdrawAddressTextField = tuple2.second;
withdrawAddressTextField.setManaged(false);
withdrawAddressTextField.setVisible(false);
HBox hBox = new HBox();
hBox.setSpacing(10);
useSavingsWalletButton = new AutoTooltipButton(Res.get("portfolio.pending.step5_buyer.moveToBisqWallet"));
useSavingsWalletButton.setDefaultButton(false);
Label label = new AutoTooltipLabel(Res.get("shared.OR"));
label.setPadding(new Insets(5, 0, 0, 0));
withdrawToExternalWalletButton = new AutoTooltipButton(Res.get("portfolio.pending.step5_buyer.withdrawExternal"));
withdrawToExternalWalletButton.setDefaultButton(false);
hBox.getChildren().addAll(useSavingsWalletButton, label, withdrawToExternalWalletButton);
GridPane.setRowIndex(hBox, ++gridRow);
GridPane.setColumnIndex(hBox, 1);
GridPane.setMargin(hBox, new Insets(15, 10, 0, 0));
gridPane.getChildren().add(hBox);
useSavingsWalletButton.setOnAction(e -> {
handleTradeCompleted();
model.dataModel.tradeManager.addTradeToClosedTrades(trade);
});
withdrawToExternalWalletButton.setOnAction(e -> onWithdrawal());
String key = "tradeCompleted" + trade.getId();
// noinspection ConstantConditions
if (!DevEnv.isDevMode() && DontShowAgainLookup.showAgain(key)) {
DontShowAgainLookup.dontShowAgain(key, true);
new Notification().headLine(Res.get("notification.tradeCompleted.headline")).notification(Res.get("notification.tradeCompleted.msg")).autoClose().show();
}
}
Aggregations