Removed some out-commentd code, design and code separation

This commit is contained in:
7u83 2017-04-07 22:59:15 +02:00
parent 26aa4385f5
commit 4a68336f5a
6 changed files with 8 additions and 13 deletions

View File

@ -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=true
annotation.processing.enabled.in.editor=false annotation.processing.enabled.in.editor=false
annotation.processing.processors.list= annotation.processing.processors.list=

View File

@ -147,7 +147,7 @@ public class EditAutoTraderList extends javax.swing.JPanel {
} }
money += (Double) list.getValueAt(r, list.getColumn("Money").getModelIndex()); money += (Double) list.getValueAt(r, list.getColumn("Money").getModelIndex());
shares += (Double) list.getValueAt(r, list.getColumn("Shares").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; return money / shares;
} }

View File

@ -194,7 +194,7 @@ public class EditPreferencesDialog extends javax.swing.JDialog {
void resetUI() { void resetUI() {
for (Window w : Window.getWindows()) { for (Window w : Window.getWindows()) {
System.out.print("Setting frame\n");
SwingUtilities.updateComponentTreeUI(w); SwingUtilities.updateComponentTreeUI(w);
w.pack(); w.pack();
} }

View File

@ -243,6 +243,7 @@
</NonVisualComponents> </NonVisualComponents>
<Properties> <Properties>
<Property name="defaultCloseOperation" type="int" value="3"/> <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"> <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[640, 480]"/> <Dimension value="[640, 480]"/>
</Property> </Property>

View File

@ -65,12 +65,8 @@ public class NewMDIApplication extends javax.swing.JFrame {
*/ */
public NewMDIApplication() { public NewMDIApplication() {
initComponents(); initComponents();
this.chartSrollPane.setVerticalScrollBarPolicy(VERTICAL_SCROLLBAR_NEVER); this.chartSrollPane.setVerticalScrollBarPolicy(VERTICAL_SCROLLBAR_NEVER);
// Globals.frame = this;
this.setLocationRelativeTo(null); 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) { 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); jSplitPane1.setTopComponent(jSplitPane2);
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("SeSim - Stock Exchange Simmulator");
setMinimumSize(new java.awt.Dimension(640, 480)); setMinimumSize(new java.awt.Dimension(640, 480));
stopButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/icons/stop.gif"))); // NOI18N stopButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/icons/stop.gif"))); // NOI18N

View File

@ -73,16 +73,13 @@ public class RandomTraderA extends AutoTraderBase implements AccountListener {
a.setListener(this); a.setListener(this);
long delay = (long) (getRandom(initial_delay[0], initial_delay[1]) * 1000); 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); timerTask = se.timer.startTimerTask(this, delay);
} }
@Override @Override
public long timerTask() { 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); 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(); long rc = this.doTrade();
setStatus("Sleeping for %d ms", rc); setStatus("Sleeping for %d ms", rc);
return rc; return rc;
@ -117,8 +114,8 @@ public class RandomTraderA extends AutoTraderBase implements AccountListener {
} }
void setStatus(String format, Object... arguments) { void setStatus(String format, Object... arguments) {
// String s = String.format(format, arguments); String s = String.format(format, arguments);
// System.out.printf("%s: %s\n", this.getName(), s); System.out.printf("%s: %s\n", this.getName(), s);
} }
private Float[] to_float(JSONArray a) { private Float[] to_float(JSONArray a) {