Fix wrong column values

This commit is contained in:
Manfred Karrer 2016-08-29 16:30:52 +02:00
parent a5f83c436a
commit 8169b0f768
2 changed files with 5 additions and 38 deletions

View File

@ -83,10 +83,9 @@ public class TradesChartsView extends ActivatableViewAndModel<VBox, TradesCharts
private SortedList<TradeStatistics> sortedList;
private Label nrOfTradeStatisticsLabel;
private ListChangeListener<TradeStatistics> tradeStatisticsByCurrencyListener;
private TableColumn<TradeStatistics, TradeStatistics> priceColumn;
private ChangeListener<Number> selectedTabIndexListener;
private SingleSelectionModel<Tab> tabPaneSelectionModel;
private TableColumn<TradeStatistics, TradeStatistics> volumeColumn, marketColumn;
private TableColumn<TradeStatistics, TradeStatistics> priceColumn, volumeColumn, marketColumn;
private MonadicBinding<Void> currencySelectionBinding;
private Subscription currencySelectionSubscriber;
@ -569,14 +568,14 @@ public class TradesChartsView extends ActivatableViewAndModel<VBox, TradesCharts
public void updateItem(final TradeStatistics item, boolean empty) {
super.updateItem(item, empty);
if (item != null)
setText(getDirectionLabel(item));
setText(getPaymentMethodLabel(item));
else
setText("");
}
};
}
});
paymentMethodColumn.setComparator((o1, o2) -> getDirectionLabel(o1).compareTo(getDirectionLabel(o2)));
paymentMethodColumn.setComparator((o1, o2) -> getPaymentMethodLabel(o1).compareTo(getPaymentMethodLabel(o2)));
tableView.getColumns().add(paymentMethodColumn);
// direction
@ -593,14 +592,14 @@ public class TradesChartsView extends ActivatableViewAndModel<VBox, TradesCharts
public void updateItem(final TradeStatistics item, boolean empty) {
super.updateItem(item, empty);
if (item != null)
setText(getPaymentMethodLabel(item));
setText(getDirectionLabel(item));
else
setText("");
}
};
}
});
directionColumn.setComparator((o1, o2) -> getPaymentMethodLabel(o1).compareTo(getPaymentMethodLabel(o2)));
directionColumn.setComparator((o1, o2) -> getDirectionLabel(o1).compareTo(getDirectionLabel(o2)));
tableView.getColumns().add(directionColumn);
tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);

View File

@ -1,32 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ This file is part of Bitsquare.
~
~ Bitsquare is free software: you can redistribute it and/or modify it
~ under the terms of the GNU Affero General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or (at
~ your option) any later version.
~
~ Bitsquare is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
~ License for more details.
~
~ You should have received a copy of the GNU Affero General Public License
~ along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
-->
<?import javafx.geometry.Insets?>
<?import javafx.scene.layout.*?>
<VBox fx:id="root" fx:controller="io.bitsquare.gui.main.markets.offerbook.OfferBookChartView"
spacing="20.0" fillWidth="true"
AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0"
AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"
xmlns:fx="http://javafx.com/fxml">
<padding>
<Insets bottom="10.0" left="20.0" top="10.0" right="20"/>
</padding>
</VBox>