some scheduler testing testing

This commit is contained in:
7u83
2017-04-11 07:56:43 +02:00
parent f0888a55d0
commit 4dcc9d8d56
6 changed files with 38 additions and 24 deletions

View File

@ -44,26 +44,21 @@ public class Statistics extends javax.swing.JPanel {
new Timer().schedule(new TimerTask() {
@Override
public void run() {
System.out.printf("Statistics comming\n");
Exchange.Statistics s = Globals.se.getStatistics();
tradesLabel.setText(String.format("%d", s.trades));
if (s.heigh == null){
if (s.heigh == null) {
labelHigh.setText("--");
}
else {
} else {
labelHigh.setText(Globals.se.getMoneyFormatter().format(s.heigh));
}
if (s.low == null){
if (s.low == null) {
labelLow.setText("--");
}
else {
} else {
labelLow.setText(Globals.se.getMoneyFormatter().format(s.low));
}
}
}, 1000, 1000);

View File

@ -31,6 +31,8 @@ import gui.tools.NummericCellRenderer;
import java.awt.Component;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.swing.JTable;
import javax.swing.SwingUtilities;
@ -126,6 +128,15 @@ public class OrderBook extends javax.swing.JPanel implements Exchange.BookReceiv
cfgChanged();
// Globals.se.addBookReceiver(Exchange.OrderType.BUYLIMIT, this);
Globals.addCfgListener(this);
new Timer().schedule(new TimerTask() {
@Override
public void run() {
// System.out.printf("Update order book\n");
// UpdateOrderBook();
}
}, 1000, 1000);
}
boolean oupdate = false;