Removed some out-commentd code, design and code separation
This commit is contained in:
parent
26aa4385f5
commit
4a68336f5a
@ -1,4 +1,4 @@
|
||||
#Fri, 07 Apr 2017 22:40:21 +0200
|
||||
#Fri, 07 Apr 2017 22:58:15 +0200
|
||||
annotation.processing.enabled=true
|
||||
annotation.processing.enabled.in.editor=false
|
||||
annotation.processing.processors.list=
|
||||
|
@ -147,7 +147,7 @@ public class EditAutoTraderList extends javax.swing.JPanel {
|
||||
}
|
||||
money += (Double) list.getValueAt(r, list.getColumn("Money").getModelIndex());
|
||||
shares += (Double) list.getValueAt(r, list.getColumn("Shares").getModelIndex());
|
||||
System.out.printf("Row: %d %f %f\n", r, money, shares);
|
||||
// System.out.printf("Row: %d %f %f\n", r, money, shares);
|
||||
}
|
||||
return money / shares;
|
||||
}
|
||||
|
@ -194,7 +194,7 @@ public class EditPreferencesDialog extends javax.swing.JDialog {
|
||||
|
||||
void resetUI() {
|
||||
for (Window w : Window.getWindows()) {
|
||||
System.out.print("Setting frame\n");
|
||||
|
||||
SwingUtilities.updateComponentTreeUI(w);
|
||||
w.pack();
|
||||
}
|
||||
|
@ -243,6 +243,7 @@
|
||||
</NonVisualComponents>
|
||||
<Properties>
|
||||
<Property name="defaultCloseOperation" type="int" value="3"/>
|
||||
<Property name="title" type="java.lang.String" value="SeSim - Stock Exchange Simmulator"/>
|
||||
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[640, 480]"/>
|
||||
</Property>
|
||||
|
@ -65,12 +65,8 @@ public class NewMDIApplication extends javax.swing.JFrame {
|
||||
*/
|
||||
public NewMDIApplication() {
|
||||
initComponents();
|
||||
|
||||
this.chartSrollPane.setVerticalScrollBarPolicy(VERTICAL_SCROLLBAR_NEVER);
|
||||
// Globals.frame = this;
|
||||
this.setLocationRelativeTo(null);
|
||||
System.out.printf("Set title\n");
|
||||
setTitle("SeSim - Stock Exchange Simmulator");
|
||||
}
|
||||
|
||||
AutoTraderInterface createTraderNew(Exchange se, long id, String name, double money, double shares, JSONObject cfg) {
|
||||
@ -210,6 +206,7 @@ public class NewMDIApplication extends javax.swing.JFrame {
|
||||
jSplitPane1.setTopComponent(jSplitPane2);
|
||||
|
||||
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
|
||||
setTitle("SeSim - Stock Exchange Simmulator");
|
||||
setMinimumSize(new java.awt.Dimension(640, 480));
|
||||
|
||||
stopButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/icons/stop.gif"))); // NOI18N
|
||||
|
@ -73,16 +73,13 @@ public class RandomTraderA extends AutoTraderBase implements AccountListener {
|
||||
a.setListener(this);
|
||||
|
||||
long delay = (long) (getRandom(initial_delay[0], initial_delay[1]) * 1000);
|
||||
setStatus("Inital delay: %d\n", delay);
|
||||
setStatus("Inital delay: %d", delay);
|
||||
timerTask = se.timer.startTimerTask(this, delay);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long timerTask() {
|
||||
// System.out.printf("Enter TimerTask for %d / %d\n", System.identityHashCode(this), Thread.currentThread().getId());
|
||||
sesim.Exchange.Account a = se.getAccount(account_id);
|
||||
// System.out.printf("Have Account %d\n", Thread.currentThread().getId());
|
||||
// Globals.se.ua(a);
|
||||
long rc = this.doTrade();
|
||||
setStatus("Sleeping for %d ms", rc);
|
||||
return rc;
|
||||
@ -117,8 +114,8 @@ public class RandomTraderA extends AutoTraderBase implements AccountListener {
|
||||
}
|
||||
|
||||
void setStatus(String format, Object... arguments) {
|
||||
// String s = String.format(format, arguments);
|
||||
// System.out.printf("%s: %s\n", this.getName(), s);
|
||||
String s = String.format(format, arguments);
|
||||
System.out.printf("%s: %s\n", this.getName(), s);
|
||||
}
|
||||
|
||||
private Float[] to_float(JSONArray a) {
|
||||
|
Loading…
Reference in New Issue
Block a user