From 07f799ae411f8ec2a32c8231c9e280b5f57adfaa Mon Sep 17 00:00:00 2001 From: Manfred Karrer Date: Sat, 23 Apr 2016 00:54:10 +0200 Subject: [PATCH] Improve wording, show altcoin in button --- .../markets/charts/MarketsChartsView.java | 33 ++++++++++++------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/gui/src/main/java/io/bitsquare/gui/main/markets/charts/MarketsChartsView.java b/gui/src/main/java/io/bitsquare/gui/main/markets/charts/MarketsChartsView.java index 915ddaa897..095b83026f 100644 --- a/gui/src/main/java/io/bitsquare/gui/main/markets/charts/MarketsChartsView.java +++ b/gui/src/main/java/io/bitsquare/gui/main/markets/charts/MarketsChartsView.java @@ -27,10 +27,7 @@ import io.bitsquare.gui.main.offer.BuyOfferView; import io.bitsquare.gui.main.offer.SellOfferView; import io.bitsquare.gui.main.offer.offerbook.OfferBookListItem; import io.bitsquare.gui.util.BSFormatter; -import io.bitsquare.locale.BSResources; -import io.bitsquare.locale.CryptoCurrency; -import io.bitsquare.locale.FiatCurrency; -import io.bitsquare.locale.TradeCurrency; +import io.bitsquare.locale.*; import io.bitsquare.trade.offer.Offer; import javafx.beans.property.ReadOnlyObjectWrapper; import javafx.beans.property.SimpleStringProperty; @@ -69,6 +66,8 @@ public class MarketsChartsView extends ActivatableViewAndModel, VBox, Button> tupleSell = getOfferTable(Offer.Direction.SELL); buyOfferTableView = tupleBuy.first; sellOfferTableView = tupleSell.first; + buyOfferButton = tupleBuy.third; + sellOfferButton = tupleSell.third; HBox hBox = new HBox(); hBox.setSpacing(30); @@ -135,19 +136,29 @@ public class MarketsChartsView extends ActivatableViewAndModel { - model.onSetTradeCurrency(currencyComboBox.getSelectionModel().getSelectedItem()); + TradeCurrency tradeCurrency = currencyComboBox.getSelectionModel().getSelectedItem(); + model.onSetTradeCurrency(tradeCurrency); updateChartData(); }); model.getOfferBookListItems().addListener(changeListener); tradeCurrencySubscriber = EasyBind.subscribe(model.tradeCurrency, - newValue -> { - String code = newValue.getCode(); - areaChart.setTitle("Offer book for " + newValue.getName()); + tradeCurrency -> { + String code = tradeCurrency.getCode(); + String tradeCurrencyName = tradeCurrency.getName(); + areaChart.setTitle("Offer book for " + tradeCurrencyName); priceColumnLabel.set("Price (" + code + "/BTC)"); volumeColumnLabel.set("Volume (" + code + ")"); xAxis.setLabel(priceColumnLabel.get()); xAxis.setTickLabelFormatter(new NumberAxis.DefaultFormatter(xAxis, "", "")); + + if (CurrencyUtil.isCryptoCurrency(code)) { + buyOfferButton.setText("I want to sell bitcoin / buy " + tradeCurrencyName); + sellOfferButton.setText("I want to buy bitcoin / sell " + tradeCurrencyName); + } else { + buyOfferButton.setText("I want to sell bitcoin"); + sellOfferButton.setText("I want to buy bitcoin"); + } }); buyOfferTableView.setItems(model.getTop3BuyOfferList()); @@ -316,7 +327,7 @@ public class MarketsChartsView extends ActivatableViewAndModel titleLabel.prefWidthProperty().bind(tableView.widthProperty())); @@ -355,10 +366,10 @@ public class MarketsChartsView extends ActivatableViewAndModel(xAxis, yAxis); areaChart.setAnimated(false);