mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-25 05:06:45 +00:00
more efficient chart node selection
This commit is contained in:
parent
48336bb894
commit
f0ee99b78b
2 changed files with 7 additions and 8 deletions
|
@ -82,9 +82,9 @@ public class BalanceChart extends LineChart<Number, Number> {
|
||||||
|
|
||||||
for(int i = 0; i < balanceSeries.getData().size(); i++) {
|
for(int i = 0; i < balanceSeries.getData().size(); i++) {
|
||||||
XYChart.Data<Number, Number> data = balanceSeries.getData().get(i);
|
XYChart.Data<Number, Number> data = balanceSeries.getData().get(i);
|
||||||
|
if(transactionEntry.getBlockTransaction().getDate() != null && data.getXValue().equals(transactionEntry.getBlockTransaction().getDate().getTime()) && data.getExtraValue() != null) {
|
||||||
Node symbol = lookup(".chart-line-symbol.data" + i);
|
Node symbol = lookup(".chart-line-symbol.data" + i);
|
||||||
if(symbol != null) {
|
if(symbol != null) {
|
||||||
if(transactionEntry.getBlockTransaction().getDate() != null && data.getXValue().equals(transactionEntry.getBlockTransaction().getDate().getTime()) && data.getExtraValue() != null) {
|
|
||||||
symbol.getStyleClass().add("selected");
|
symbol.getStyleClass().add("selected");
|
||||||
selectedEntry = transactionEntry;
|
selectedEntry = transactionEntry;
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,11 +86,10 @@ public class UtxosChart extends BarChart<String, Number> {
|
||||||
|
|
||||||
for(int i = 0; i < utxoSeries.getData().size(); i++) {
|
for(int i = 0; i < utxoSeries.getData().size(); i++) {
|
||||||
XYChart.Data<String, Number> data = utxoSeries.getData().get(i);
|
XYChart.Data<String, Number> data = utxoSeries.getData().get(i);
|
||||||
|
|
||||||
|
if((data.getExtraValue() != null && entries.contains((Entry)data.getExtraValue())) || (data.getExtraValue() == null && entries.size() == totalUtxos)) {
|
||||||
Node bar = lookup(".data" + i);
|
Node bar = lookup(".data" + i);
|
||||||
if(bar != null) {
|
if(bar != null) {
|
||||||
if(data.getExtraValue() != null && entries.contains((Entry)data.getExtraValue())) {
|
|
||||||
bar.getStyleClass().add("selected");
|
|
||||||
} else if(data.getExtraValue() == null && entries.size() == totalUtxos) {
|
|
||||||
bar.getStyleClass().add("selected");
|
bar.getStyleClass().add("selected");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue