runs now on windows

This commit is contained in:
7u83 2017-03-26 21:36:53 +02:00
parent 87f361ac61
commit 608fba2530
5 changed files with 53 additions and 7 deletions

View File

@ -1,4 +1,4 @@
#Sun, 26 Mar 2017 14:28:26 +0100
#Sun, 26 Mar 2017 21:28:05 +0100
annotation.processing.enabled=true
annotation.processing.enabled.in.editor=false
annotation.processing.processors.list=

View File

@ -40,6 +40,7 @@
<Events>
<EventHandler event="mouseWheelMoved" listener="java.awt.event.MouseWheelListener" parameters="java.awt.event.MouseWheelEvent" handler="formMouseWheelMoved"/>
<EventHandler event="mousePressed" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="formMousePressed"/>
<EventHandler event="mouseReleased" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="formMouseReleased"/>
</Events>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>

View File

@ -503,6 +503,8 @@ System.out.printf("v1 %f, v2 %f\n",v1,v2);
return;
}
num_bars = data.size();
c_mm = data.getMinMax(first_bar, last_bar);
if (c_mm == null) {
return;
@ -603,6 +605,9 @@ System.out.printf("v1 %f, v2 %f\n",v1,v2);
if (Globals.se==null){
return;
}
super.paintComponent(g);
// Calculate the number of pixels for 1 em
@ -620,7 +625,9 @@ System.out.printf("v1 %f, v2 %f\n",v1,v2);
first_bar = (int) (clip_bounds.x / (this.x_unit_width * this.em_size));
last_bar = 1 + (int) ((clip_bounds.x + clip_bounds.width - (this.y_legend_width * em_size)) / (this.x_unit_width * this.em_size));
num_bars = data.size(); // + (int) (clip_bounds.width / (this.x_unit_width * this.em_size))+5;
// num_bars = data.size(); // + (int) (clip_bounds.width / (this.x_unit_width * this.em_size))+5;
// num_bars=1;
c_font_height = g.getFontMetrics().getHeight();
@ -663,6 +670,9 @@ System.out.printf("v1 %f, v2 %f\n",v1,v2);
public void mousePressed(java.awt.event.MouseEvent evt) {
formMousePressed(evt);
}
public void mouseReleased(java.awt.event.MouseEvent evt) {
formMouseReleased(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
@ -678,9 +688,14 @@ System.out.printf("v1 %f, v2 %f\n",v1,v2);
}// </editor-fold>//GEN-END:initComponents
private void formMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_formMousePressed
if (!evt.isPopupTrigger()) {
System.out.printf("There was a mosue event\n");
if (!evt.isPopupTrigger() || true) {
System.out.printf("But there was no pupe trigger\n");
return;
};
}
// this.invalidate();
this.ctxMenu.setVisible(true);
@ -708,6 +723,27 @@ System.out.printf("v1 %f, v2 %f\n",v1,v2);
this.repaint();
}//GEN-LAST:event_formMouseWheelMoved
private void formMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_formMouseReleased
System.out.printf("There was a mosue event released\n");
if (!evt.isPopupTrigger()) {
System.out.printf("But there was no pupe trigger\n");
return;
}
// this.invalidate();
this.ctxMenu.setVisible(true);
this.ctxMenu.show(this, evt.getX(), evt.getY());
this.invalidate();
this.repaint();
}//GEN-LAST:event_formMouseReleased
void setCompression(int timeFrame) {
javax.swing.SwingUtilities.invokeLater(() -> {
data = Globals.se.getOHLCdata(timeFrame);

View File

@ -139,6 +139,9 @@ public class EditAutoTraderList extends javax.swing.JPanel {
for (int r = 0; r < model.getRowCount(); r++) {
Boolean e = (Boolean) list.getValueAt(r, list.getColumn("Enabled").getModelIndex());
if (e==null){
continue;
}
if (!e) {
continue;
}

View File

@ -62,9 +62,10 @@ public class NewMDIApplication extends javax.swing.JFrame {
*/
public NewMDIApplication() {
initComponents();
Globals.frame = this;
this.setLocationRelativeTo(this);
this.setTitle("SeSim - Stock Exchange Simmulator");
// Globals.frame = this;
// this.setLocationRelativeTo(this);
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) {
@ -738,6 +739,8 @@ public class NewMDIApplication extends javax.swing.JFrame {
*/
public static void main(String args[]) throws IllegalAccessException, InstantiationException {
System.out.printf("Main called\n");
Globals.initGlobals();
//System.exit(0);
Globals.se = new Exchange();
@ -750,11 +753,14 @@ public class NewMDIApplication extends javax.swing.JFrame {
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
System.out.printf("In run method now\n");
String x = new java.io.File(NewMDIApplication.class.getProtectionDomain()
.getCodeSource()
.getLocation()
.getPath()).toString(); //.getName();
System.out.printf("Creating Application\n");
new NewMDIApplication().setVisible(true);
}
});