Some improvements

This commit is contained in:
7u83 2017-02-13 18:26:32 +01:00
parent 273dac9d26
commit 59ff1f3c0e
18 changed files with 533 additions and 152 deletions

View File

@ -68,12 +68,20 @@ public class Globals {
static final String TRADERPREFS = "Traders"; static final String TRADERPREFS = "Traders";
static final String DEVELSTATUS = "devel_status"; static final String DEVELSTATUS = "devel_status";
static final String GODMODE = "godmode"; public static final String GODMODE = "godmode";
static public sesim.Exchange se; static public sesim.Exchange se;
static public Preferences prefs; static public Preferences prefs;
public static class CfgStrings{
public static final String GODMODE = "godmode";
}
//CfgStrings
static void setLookAndFeel(String selected) { static void setLookAndFeel(String selected) {
try { try {

View File

@ -59,7 +59,7 @@
</Component> </Component>
</SubComponents> </SubComponents>
</Container> </Container>
<Component class="gui.OrderBookNew" name="orderBookNew1"> <Component class="gui.orderbook.OrderBookNew" name="orderBookNew1">
</Component> </Component>
</SubComponents> </SubComponents>
</Form> </Form>

View File

@ -85,7 +85,7 @@ public class LoggerDialog extends javax.swing.JDialog {
jScrollPane1 = new javax.swing.JScrollPane(); jScrollPane1 = new javax.swing.JScrollPane();
logArea = new javax.swing.JTextArea(); logArea = new javax.swing.JTextArea();
orderBookNew1 = new gui.OrderBookNew(); orderBookNew1 = new gui.orderbook.OrderBookNew();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
@ -161,6 +161,6 @@ public class LoggerDialog extends javax.swing.JDialog {
// Variables declaration - do not modify//GEN-BEGIN:variables // Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JScrollPane jScrollPane1; private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTextArea logArea; private javax.swing.JTextArea logArea;
private gui.OrderBookNew orderBookNew1; private gui.orderbook.OrderBookNew orderBookNew1;
// End of variables declaration//GEN-END:variables // End of variables declaration//GEN-END:variables
} }

View File

@ -168,6 +168,14 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem2ActionPerformed"/> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem2ActionPerformed"/>
</Events> </Events>
</MenuItem> </MenuItem>
<MenuItem class="javax.swing.JMenuItem" name="viewClock">
<Properties>
<Property name="text" type="java.lang.String" value="Clock"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="viewClockActionPerformed"/>
</Events>
</MenuItem>
<MenuItem class="javax.swing.JMenuItem" name="jMenuItem3"> <MenuItem class="javax.swing.JMenuItem" name="jMenuItem3">
<Properties> <Properties>
<Property name="text" type="java.lang.String" value="LogWindow"/> <Property name="text" type="java.lang.String" value="LogWindow"/>
@ -176,13 +184,11 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem3ActionPerformed"/> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem3ActionPerformed"/>
</Events> </Events>
</MenuItem> </MenuItem>
<MenuItem class="javax.swing.JMenuItem" name="viewClock"> <MenuItem class="javax.swing.JCheckBoxMenuItem" name="jCheckBoxMenuItem1">
<Properties> <Properties>
<Property name="text" type="java.lang.String" value="Clock"/> <Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" value="jCheckBoxMenuItem1"/>
</Properties> </Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="viewClockActionPerformed"/>
</Events>
</MenuItem> </MenuItem>
</SubComponents> </SubComponents>
</Menu> </Menu>
@ -217,9 +223,6 @@
<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>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[800, 561]"/>
</Property>
</Properties> </Properties>
<SyntheticProperties> <SyntheticProperties>
<SyntheticProperty name="menuBar" type="java.lang.String" value="menuBar"/> <SyntheticProperty name="menuBar" type="java.lang.String" value="menuBar"/>
@ -236,62 +239,17 @@
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,-2,0,0,3,14"/>
</AuxValues> </AuxValues>
<Layout> <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="oderBookPanelNew1" min="-2" pref="220" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jChartScrollPane" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
<Component id="jPanel2" alignment="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jPanel2" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jChartScrollPane" max="32767" attributes="0"/>
<Group type="102" attributes="0">
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
<Component id="oderBookPanelNew1" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents> <SubComponents>
<Container class="javax.swing.JScrollPane" name="jChartScrollPane">
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Container class="chart.Chart" name="chart">
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="300" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="300" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
</Container>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPanel2"> <Container class="javax.swing.JPanel" name="jPanel2">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
<BorderConstraints direction="First"/>
</Constraint>
</Constraints>
<Layout> <Layout>
<DimensionLayout dim="0"> <DimensionLayout dim="0">
@ -302,7 +260,7 @@
<Component id="jButton2" min="-2" pref="67" max="-2" attributes="0"/> <Component id="jButton2" min="-2" pref="67" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Component id="stopButton" min="-2" pref="63" max="-2" attributes="0"/> <Component id="stopButton" min="-2" pref="63" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/> <EmptySpace pref="374" max="32767" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Component id="clock" alignment="1" min="-2" max="-2" attributes="0"/> <Component id="clock" alignment="1" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="1" attributes="0"> <Group type="102" alignment="1" attributes="0">
@ -420,7 +378,77 @@
</Component> </Component>
</SubComponents> </SubComponents>
</Container> </Container>
<Component class="gui.OderBookPanelNew" name="oderBookPanelNew1"> <Container class="javax.swing.JSplitPane" name="jSplitPane1">
</Component> <Properties>
<Property name="orientation" type="int" value="0"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
<BorderConstraints direction="Center"/>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout"/>
<SubComponents>
<Container class="javax.swing.JSplitPane" name="jSplitPane2">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
<JSplitPaneConstraints position="top"/>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout"/>
<SubComponents>
<Container class="javax.swing.JScrollPane" name="jChartScrollPane">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
<JSplitPaneConstraints position="bottom"/>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Container class="chart.Chart" name="chart">
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="300" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="300" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
</Container>
</SubComponents>
</Container>
<Component class="gui.orderbook.OrderBookNew" name="orderBookNew1">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
<JSplitPaneConstraints position="left"/>
</Constraint>
</Constraints>
</Component>
</SubComponents>
</Container>
<Component class="gui.TraderListPanel" name="traderListPanel1">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
<JSplitPaneConstraints position="right"/>
</Constraint>
</Constraints>
</Component>
<Component class="gui.orderbook.OrderBooksHorizontal" name="orderBooksHorizontal1">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
<JSplitPaneConstraints position="bottom"/>
</Constraint>
</Constraints>
</Component>
</SubComponents>
</Container>
</SubComponents> </SubComponents>
</Form> </Form>

View File

@ -65,6 +65,8 @@ public class NewMDIApplication extends javax.swing.JFrame {
System.out.printf("!!!! creating new\n"); System.out.printf("!!!! creating new\n");
String base = cfg.getString("base"); String base = cfg.getString("base");
AutoTraderInterface ac = Globals.tloader.getStrategyBase(base); AutoTraderInterface ac = Globals.tloader.getStrategyBase(base);
if (ac==null)
return null;
ac.putConfig(cfg); ac.putConfig(cfg);
ac.init(se, id, name, money, shares, cfg); ac.init(se, id, name, money, shares, cfg);
@ -142,8 +144,6 @@ public class NewMDIApplication extends javax.swing.JFrame {
jScrollPane2 = new javax.swing.JScrollPane(); jScrollPane2 = new javax.swing.JScrollPane();
jTextArea1 = new javax.swing.JTextArea(); jTextArea1 = new javax.swing.JTextArea();
jChartScrollPane = new javax.swing.JScrollPane();
chart = new chart.Chart();
jPanel2 = new javax.swing.JPanel(); jPanel2 = new javax.swing.JPanel();
stopButton = new javax.swing.JButton(); stopButton = new javax.swing.JButton();
runButton = new javax.swing.JButton(); runButton = new javax.swing.JButton();
@ -151,7 +151,13 @@ public class NewMDIApplication extends javax.swing.JFrame {
accelSpinner = new javax.swing.JSpinner(); accelSpinner = new javax.swing.JSpinner();
clock = new gui.Clock(); clock = new gui.Clock();
jComboBox1 = new javax.swing.JComboBox<>(); jComboBox1 = new javax.swing.JComboBox<>();
oderBookPanelNew1 = new gui.OderBookPanelNew(); jSplitPane1 = new javax.swing.JSplitPane();
jSplitPane2 = new javax.swing.JSplitPane();
jChartScrollPane = new javax.swing.JScrollPane();
chart = new chart.Chart();
orderBookNew1 = new gui.orderbook.OrderBookNew();
traderListPanel1 = new gui.TraderListPanel();
orderBooksHorizontal1 = new gui.orderbook.OrderBooksHorizontal();
menuBar = new javax.swing.JMenuBar(); menuBar = new javax.swing.JMenuBar();
fileMenu = new javax.swing.JMenu(); fileMenu = new javax.swing.JMenu();
jMenuItem1 = new javax.swing.JMenuItem(); jMenuItem1 = new javax.swing.JMenuItem();
@ -172,8 +178,9 @@ public class NewMDIApplication extends javax.swing.JFrame {
simMenuStop = new javax.swing.JMenuItem(); simMenuStop = new javax.swing.JMenuItem();
viewMenu = new javax.swing.JMenu(); viewMenu = new javax.swing.JMenu();
jMenuItem2 = new javax.swing.JMenuItem(); jMenuItem2 = new javax.swing.JMenuItem();
jMenuItem3 = new javax.swing.JMenuItem();
viewClock = new javax.swing.JMenuItem(); viewClock = new javax.swing.JMenuItem();
jMenuItem3 = new javax.swing.JMenuItem();
jCheckBoxMenuItem1 = new javax.swing.JCheckBoxMenuItem();
helpMenu = new javax.swing.JMenu(); helpMenu = new javax.swing.JMenu();
contentMenuItem = new javax.swing.JMenuItem(); contentMenuItem = new javax.swing.JMenuItem();
aboutMenuItem = new javax.swing.JMenuItem(); aboutMenuItem = new javax.swing.JMenuItem();
@ -185,20 +192,6 @@ public class NewMDIApplication extends javax.swing.JFrame {
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setMinimumSize(new java.awt.Dimension(640, 480)); setMinimumSize(new java.awt.Dimension(640, 480));
setPreferredSize(new java.awt.Dimension(800, 561));
javax.swing.GroupLayout chartLayout = new javax.swing.GroupLayout(chart);
chart.setLayout(chartLayout);
chartLayout.setHorizontalGroup(
chartLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 300, Short.MAX_VALUE)
);
chartLayout.setVerticalGroup(
chartLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 300, Short.MAX_VALUE)
);
jChartScrollPane.setViewportView(chart);
stopButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/toolbarButtonGraphics/general/Stop24.gif"))); // NOI18N stopButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/toolbarButtonGraphics/general/Stop24.gif"))); // NOI18N
stopButton.setText("Stop"); stopButton.setText("Stop");
@ -254,7 +247,7 @@ public class NewMDIApplication extends javax.swing.JFrame {
.addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(stopButton, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(stopButton, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 374, Short.MAX_VALUE)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(clock, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(clock, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
@ -282,6 +275,32 @@ public class NewMDIApplication extends javax.swing.JFrame {
.addContainerGap()))) .addContainerGap())))
); );
getContentPane().add(jPanel2, java.awt.BorderLayout.PAGE_START);
jSplitPane1.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
javax.swing.GroupLayout chartLayout = new javax.swing.GroupLayout(chart);
chart.setLayout(chartLayout);
chartLayout.setHorizontalGroup(
chartLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 300, Short.MAX_VALUE)
);
chartLayout.setVerticalGroup(
chartLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 300, Short.MAX_VALUE)
);
jChartScrollPane.setViewportView(chart);
jSplitPane2.setBottomComponent(jChartScrollPane);
jSplitPane2.setLeftComponent(orderBookNew1);
jSplitPane1.setTopComponent(jSplitPane2);
jSplitPane1.setRightComponent(traderListPanel1);
jSplitPane1.setBottomComponent(orderBooksHorizontal1);
getContentPane().add(jSplitPane1, java.awt.BorderLayout.CENTER);
fileMenu.setMnemonic('f'); fileMenu.setMnemonic('f');
fileMenu.setText("File"); fileMenu.setText("File");
@ -414,6 +433,14 @@ public class NewMDIApplication extends javax.swing.JFrame {
}); });
viewMenu.add(jMenuItem2); viewMenu.add(jMenuItem2);
viewClock.setText("Clock");
viewClock.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
viewClockActionPerformed(evt);
}
});
viewMenu.add(viewClock);
jMenuItem3.setText("LogWindow"); jMenuItem3.setText("LogWindow");
jMenuItem3.addActionListener(new java.awt.event.ActionListener() { jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) { public void actionPerformed(java.awt.event.ActionEvent evt) {
@ -422,13 +449,9 @@ public class NewMDIApplication extends javax.swing.JFrame {
}); });
viewMenu.add(jMenuItem3); viewMenu.add(jMenuItem3);
viewClock.setText("Clock"); jCheckBoxMenuItem1.setSelected(true);
viewClock.addActionListener(new java.awt.event.ActionListener() { jCheckBoxMenuItem1.setText("jCheckBoxMenuItem1");
public void actionPerformed(java.awt.event.ActionEvent evt) { viewMenu.add(jCheckBoxMenuItem1);
viewClockActionPerformed(evt);
}
});
viewMenu.add(viewClock);
menuBar.add(viewMenu); menuBar.add(viewMenu);
@ -452,32 +475,6 @@ public class NewMDIApplication extends javax.swing.JFrame {
setJMenuBar(menuBar); setJMenuBar(menuBar);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(oderBookPanelNew1, javax.swing.GroupLayout.PREFERRED_SIZE, 220, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jChartScrollPane)
.addContainerGap())
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jChartScrollPane)
.addGroup(layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(oderBookPanelNew1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap())
);
pack(); pack();
}// </editor-fold>//GEN-END:initComponents }// </editor-fold>//GEN-END:initComponents
@ -697,6 +694,7 @@ public class NewMDIApplication extends javax.swing.JFrame {
private javax.swing.JMenu helpMenu; private javax.swing.JMenu helpMenu;
private javax.swing.JButton jButton2; private javax.swing.JButton jButton2;
private javax.swing.JScrollPane jChartScrollPane; private javax.swing.JScrollPane jChartScrollPane;
private javax.swing.JCheckBoxMenuItem jCheckBoxMenuItem1;
private javax.swing.JComboBox<String> jComboBox1; private javax.swing.JComboBox<String> jComboBox1;
private javax.swing.JMenuItem jMenuItem1; private javax.swing.JMenuItem jMenuItem1;
private javax.swing.JMenuItem jMenuItem2; private javax.swing.JMenuItem jMenuItem2;
@ -705,10 +703,13 @@ public class NewMDIApplication extends javax.swing.JFrame {
private javax.swing.JScrollPane jScrollPane2; private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JPopupMenu.Separator jSeparator1; private javax.swing.JPopupMenu.Separator jSeparator1;
private javax.swing.JPopupMenu.Separator jSeparator2; private javax.swing.JPopupMenu.Separator jSeparator2;
private javax.swing.JSplitPane jSplitPane1;
private javax.swing.JSplitPane jSplitPane2;
private javax.swing.JTextArea jTextArea1; private javax.swing.JTextArea jTextArea1;
private javax.swing.JMenuBar menuBar; private javax.swing.JMenuBar menuBar;
private gui.OderBookPanelNew oderBookPanelNew1;
private javax.swing.JMenuItem openMenuItem; private javax.swing.JMenuItem openMenuItem;
private gui.orderbook.OrderBookNew orderBookNew1;
private gui.orderbook.OrderBooksHorizontal orderBooksHorizontal1;
private javax.swing.JMenuItem pasteMenuItem; private javax.swing.JMenuItem pasteMenuItem;
private javax.swing.JButton runButton; private javax.swing.JButton runButton;
private javax.swing.JMenuItem saveAsMenuItem; private javax.swing.JMenuItem saveAsMenuItem;
@ -718,6 +719,7 @@ public class NewMDIApplication extends javax.swing.JFrame {
private javax.swing.JMenuItem simMenuStart; private javax.swing.JMenuItem simMenuStart;
private javax.swing.JMenuItem simMenuStop; private javax.swing.JMenuItem simMenuStop;
private javax.swing.JButton stopButton; private javax.swing.JButton stopButton;
private gui.TraderListPanel traderListPanel1;
private javax.swing.JMenuItem viewClock; private javax.swing.JMenuItem viewClock;
private javax.swing.JMenu viewMenu; private javax.swing.JMenu viewMenu;
// End of variables declaration//GEN-END:variables // End of variables declaration//GEN-END:variables

View File

@ -56,9 +56,9 @@
<SubComponents> <SubComponents>
<Component class="gui.QuotePanel" name="quotePanel1"> <Component class="gui.QuotePanel" name="quotePanel1">
</Component> </Component>
<Component class="gui.OrderBookNew" name="orderBookNew3"> <Component class="gui.orderbook.OrderBookNew" name="orderBookNew3">
</Component> </Component>
<Component class="gui.OrderBookNew" name="orderBookNew4"> <Component class="gui.orderbook.OrderBookNew" name="orderBookNew4">
</Component> </Component>
<Component class="javax.swing.Box$Filler" name="filler1"> <Component class="javax.swing.Box$Filler" name="filler1">
<Properties> <Properties>

View File

@ -48,8 +48,8 @@ public class OderBookPanelNew extends javax.swing.JPanel {
private void initComponents() { private void initComponents() {
quotePanel1 = new gui.QuotePanel(); quotePanel1 = new gui.QuotePanel();
orderBookNew3 = new gui.OrderBookNew(); orderBookNew3 = new gui.orderbook.OrderBookNew();
orderBookNew4 = new gui.OrderBookNew(); orderBookNew4 = new gui.orderbook.OrderBookNew();
filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 32767)); filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 32767));
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
@ -88,8 +88,8 @@ public class OderBookPanelNew extends javax.swing.JPanel {
// Variables declaration - do not modify//GEN-BEGIN:variables // Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.Box.Filler filler1; private javax.swing.Box.Filler filler1;
private gui.OrderBookNew orderBookNew3; private gui.orderbook.OrderBookNew orderBookNew3;
private gui.OrderBookNew orderBookNew4; private gui.orderbook.OrderBookNew orderBookNew4;
private gui.QuotePanel quotePanel1; private gui.QuotePanel quotePanel1;
// End of variables declaration//GEN-END:variables // End of variables declaration//GEN-END:variables
} }

View File

@ -23,11 +23,11 @@
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/> <Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
<SubComponents> <SubComponents>
<Component class="gui.OrderBookNew" name="orderBookNew1"> <Component class="gui.orderbook.OrderBookNew" name="orderBookNew1">
</Component> </Component>
<Component class="gui.QuotePanel" name="quotePanel1"> <Component class="gui.QuotePanel" name="quotePanel1">
</Component> </Component>
<Component class="gui.OrderBookNew" name="orderBookNew2"> <Component class="gui.orderbook.OrderBookNew" name="orderBookNew2">
</Component> </Component>
</SubComponents> </SubComponents>
</Form> </Form>

View File

@ -48,9 +48,9 @@ public class OrderBookDialog extends javax.swing.JDialog {
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() { private void initComponents() {
orderBookNew1 = new gui.OrderBookNew(); orderBookNew1 = new gui.orderbook.OrderBookNew();
quotePanel1 = new gui.QuotePanel(); quotePanel1 = new gui.QuotePanel();
orderBookNew2 = new gui.OrderBookNew(); orderBookNew2 = new gui.orderbook.OrderBookNew();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
getContentPane().setLayout(new java.awt.FlowLayout()); getContentPane().setLayout(new java.awt.FlowLayout());
@ -104,8 +104,8 @@ public class OrderBookDialog extends javax.swing.JDialog {
} }
// Variables declaration - do not modify//GEN-BEGIN:variables // Variables declaration - do not modify//GEN-BEGIN:variables
private gui.OrderBookNew orderBookNew1; private gui.orderbook.OrderBookNew orderBookNew1;
private gui.OrderBookNew orderBookNew2; private gui.orderbook.OrderBookNew orderBookNew2;
private gui.QuotePanel quotePanel1; private gui.QuotePanel quotePanel1;
// End of variables declaration//GEN-END:variables // End of variables declaration//GEN-END:variables
} }

View File

@ -16,12 +16,12 @@
<Layout> <Layout>
<DimensionLayout dim="0"> <DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Component id="jScrollPane1" alignment="1" pref="400" max="32767" attributes="0"/> <Component id="jScrollPane1" alignment="1" pref="389" max="32767" attributes="0"/>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
<DimensionLayout dim="1"> <DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Component id="jScrollPane1" alignment="1" pref="300" max="32767" attributes="0"/> <Component id="jScrollPane1" alignment="1" pref="284" max="32767" attributes="0"/>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
</Layout> </Layout>

View File

@ -23,8 +23,9 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
package gui; package gui.orderbook;
import gui.Globals;
import gui.Globals.CfgListener; import gui.Globals.CfgListener;
import java.util.ArrayList; import java.util.ArrayList;
import javax.swing.table.DefaultTableModel; import javax.swing.table.DefaultTableModel;
@ -32,6 +33,7 @@ import javax.swing.table.TableColumn;
import javax.swing.table.TableColumnModel; import javax.swing.table.TableColumnModel;
import sesim.Exchange; import sesim.Exchange;
import sesim.Exchange.Order; import sesim.Exchange.Order;
import sesim.Exchange.OrderType;
/** /**
* *
@ -42,6 +44,9 @@ public class OrderBookNew extends javax.swing.JPanel implements Exchange.BookRec
DefaultTableModel model; DefaultTableModel model;
TableColumn trader_column = null; TableColumn trader_column = null;
OrderType type = OrderType.BUYLIMIT;
int depth=40;
public void setGodMode(boolean on) { public void setGodMode(boolean on) {
TableColumnModel tcm = list.getColumnModel(); TableColumnModel tcm = list.getColumnModel();
if (on){ if (on){
@ -57,23 +62,25 @@ public class OrderBookNew extends javax.swing.JPanel implements Exchange.BookRec
return; return;
} }
tcm.removeColumn(tcm.getColumn(0)); tcm.removeColumn(tcm.getColumn(0));
} }
} }
/**
* Bla
*/
@Override @Override
public void cfgChanged() { public final void cfgChanged() {
boolean gm = Globals.prefs.get(Globals.GODMODE, "false").equals("true"); boolean gm = Globals.prefs.get(Globals.CfgStrings.GODMODE, "false").equals("true");
System.out.printf("GM %s\n",gm?"true":"false"); System.out.printf("GM %s\n",gm?"true":"false");
setGodMode(gm); setGodMode(gm);
list.invalidate(); list.invalidate();
list.repaint(); list.repaint();
} }
public void setType(OrderType type){
this.type=type;
Globals.se.addBookReceiver(type, this);
}
/** /**
* Creates new form OrderBookNew * Creates new form OrderBookNew
@ -85,13 +92,13 @@ public class OrderBookNew extends javax.swing.JPanel implements Exchange.BookRec
model = (DefaultTableModel) this.list.getModel(); model = (DefaultTableModel) this.list.getModel();
trader_column = list.getColumnModel().getColumn(0); trader_column = list.getColumnModel().getColumn(0);
cfgChanged(); cfgChanged();
Globals.se.addBookReceiver(Exchange.OrderType.BUYLIMIT, this); // Globals.se.addBookReceiver(Exchange.OrderType.BUYLIMIT, this);
Globals.addCfgListener(this); Globals.addCfgListener(this);
} }
@Override @Override
public void UpdateOrderBook() { public void UpdateOrderBook() {
ArrayList<Order> ob = Globals.se.getOrderBook(Exchange.OrderType.SELLLIMIT, 40); ArrayList<Order> ob = Globals.se.getOrderBook(type, depth);
model.setRowCount(ob.size()); model.setRowCount(ob.size());
int row = 0; int row = 0;
for (Order ob1 : ob) { for (Order ob1 : ob) {
@ -147,11 +154,11 @@ public class OrderBookNew extends javax.swing.JPanel implements Exchange.BookRec
this.setLayout(layout); this.setLayout(layout);
layout.setHorizontalGroup( layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE) .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 389, Short.MAX_VALUE)
); );
layout.setVerticalGroup( layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE) .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 284, Short.MAX_VALUE)
); );
}// </editor-fold>//GEN-END:initComponents }// </editor-fold>//GEN-END:initComponents

View File

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,40,0,0,3,43"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBoxLayout"/>
<SubComponents>
<Component class="gui.orderbook.OrderBookNew" name="askBook">
</Component>
<Container class="gui.orderbook.QutoesHorizontal" name="qutoesHorizontal1">
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="77" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="296" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
</Container>
<Component class="gui.orderbook.OrderBookNew" name="bidBook">
</Component>
</SubComponents>
</Form>

View File

@ -0,0 +1,84 @@
/*
* Copyright (c) 2017, tobias
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package gui.orderbook;
import sesim.Exchange;
/**
*
* @author tobias
*/
public class OrderBooksHorizontal extends javax.swing.JPanel {
/**
* Creates new form OrderBooksHorizontal
*/
public OrderBooksHorizontal() {
initComponents();
askBook.setType(Exchange.OrderType.BUYLIMIT);
bidBook.setType(Exchange.OrderType.SELLLIMIT);
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
askBook = new gui.orderbook.OrderBookNew();
qutoesHorizontal1 = new gui.orderbook.QutoesHorizontal();
bidBook = new gui.orderbook.OrderBookNew();
setLayout(new javax.swing.BoxLayout(this, javax.swing.BoxLayout.LINE_AXIS));
add(askBook);
javax.swing.GroupLayout qutoesHorizontal1Layout = new javax.swing.GroupLayout(qutoesHorizontal1);
qutoesHorizontal1.setLayout(qutoesHorizontal1Layout);
qutoesHorizontal1Layout.setHorizontalGroup(
qutoesHorizontal1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 77, Short.MAX_VALUE)
);
qutoesHorizontal1Layout.setVerticalGroup(
qutoesHorizontal1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 296, Short.MAX_VALUE)
);
add(qutoesHorizontal1);
add(bidBook);
}// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
private gui.orderbook.OrderBookNew askBook;
private gui.orderbook.OrderBookNew bidBook;
private gui.orderbook.QutoesHorizontal qutoesHorizontal1;
// End of variables declaration//GEN-END:variables
}

View File

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel1" pref="140" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="110" max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="175" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="horizontalAlignment" type="int" value="0"/>
<Property name="text" type="java.lang.String" value="Price: 200.123"/>
</Properties>
</Component>
</SubComponents>
</Form>

View File

@ -0,0 +1,77 @@
/*
* Copyright (c) 2017, tobias
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package gui.orderbook;
/**
*
* @author tobias
*/
public class QutoesHorizontal extends javax.swing.JPanel {
/**
* Creates new form QutoesHorizontal
*/
public QutoesHorizontal() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel1.setText("Price: 200.123");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 140, Short.MAX_VALUE)
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(110, 110, 110)
.addComponent(jLabel1)
.addContainerGap(175, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel jLabel1;
// End of variables declaration//GEN-END:variables
}

View File

@ -361,8 +361,13 @@ public class Exchange {
public final String CFG_SHARES_DECIMALS = "shares_decimals"; public final String CFG_SHARES_DECIMALS = "shares_decimals";
public void putConfig(JSONObject cfg) { public void putConfig(JSONObject cfg) {
this.setMoneyDecimals(cfg.getInt(CFG_MONEY_DECIMALS)); try{
this.setSharesDecimals(cfg.getInt(CFG_SHARES_DECIMALS)); this.setMoneyDecimals(cfg.getInt(CFG_MONEY_DECIMALS));
this.setSharesDecimals(cfg.getInt(CFG_SHARES_DECIMALS));
}
catch (Exception e){
}
} }
@ -434,8 +439,19 @@ public class Exchange {
} }
public void addBookReceiver(OrderType t, BookReceiver br) { public void addBookReceiver(OrderType t, BookReceiver br) {
if (br==null){
System.out.printf("Br is null\n");
}
else{
System.out.printf("Br is not Nukk\n");
}
ArrayList<BookReceiver> bookreceivers; ArrayList<BookReceiver> bookreceivers;
bookreceivers = selectBookReceiver(t); bookreceivers = selectBookReceiver(t);
if (bookreceivers == null){
System.out.printf("null in bookreceivers\n");
}
bookreceivers.add(br); bookreceivers.add(br);
} }

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,-104,0,0,1,67"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBoxLayout">
<Property name="axis" type="int" value="3"/>
</Layout>
</Form>

View File

@ -0,0 +1,56 @@
/*
* Copyright (c) 2017, tobias
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package sesim;
/**
*
* @author tobias
*/
public class NewJPanel extends javax.swing.JPanel {
/**
* Creates new form NewJPanel
*/
public NewJPanel() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
setLayout(new javax.swing.BoxLayout(this, javax.swing.BoxLayout.PAGE_AXIS));
}// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
// End of variables declaration//GEN-END:variables
}