2017-01-15 18:15:22 +01:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2017, 7u83 <7u83@mail.ru>
|
|
|
|
* 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;
|
|
|
|
|
2017-01-22 21:41:45 +01:00
|
|
|
import java.awt.Dialog;
|
2017-01-24 02:28:00 +01:00
|
|
|
import java.io.File;
|
2017-01-25 00:24:53 +01:00
|
|
|
import java.util.ArrayList;
|
2017-01-28 15:34:24 +01:00
|
|
|
import java.util.logging.Handler;
|
|
|
|
import java.util.logging.LogRecord;
|
|
|
|
import java.util.logging.Logger;
|
2017-01-25 02:52:49 +01:00
|
|
|
import java.util.prefs.Preferences;
|
2017-01-24 02:28:00 +01:00
|
|
|
import javax.swing.JFileChooser;
|
2017-01-25 02:52:49 +01:00
|
|
|
import javax.swing.UIManager;
|
2017-01-22 21:41:45 +01:00
|
|
|
import sesim.AutoTrader;
|
|
|
|
import sesim.AutoTraderConfig;
|
|
|
|
import sesim.Exchange;
|
|
|
|
import traders.RandomTraderConfig;
|
|
|
|
|
2017-01-15 18:15:22 +01:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @author 7u83 <7u83@mail.ru>
|
|
|
|
*/
|
|
|
|
public class NewMDIApplication extends javax.swing.JFrame {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates new form NewMDIApplication
|
|
|
|
*/
|
|
|
|
public NewMDIApplication() {
|
|
|
|
initComponents();
|
2017-01-22 21:41:45 +01:00
|
|
|
this.setLocationRelativeTo(this);
|
|
|
|
this.setTitle("SeSim - Stock Exchange Simmulator");
|
|
|
|
}
|
|
|
|
|
|
|
|
public void startTraders() {
|
|
|
|
|
|
|
|
AutoTraderConfig cfg1 = new RandomTraderConfig();
|
2017-01-28 15:34:24 +01:00
|
|
|
AutoTrader rt1 = cfg1.createTrader(Globals.se, null, 100000, 100000);
|
2017-01-22 21:41:45 +01:00
|
|
|
Globals.se.traders.add(rt1);
|
2017-01-25 02:52:49 +01:00
|
|
|
|
2017-01-22 21:41:45 +01:00
|
|
|
rt1.setName("Alice");
|
|
|
|
rt1.start();
|
|
|
|
|
|
|
|
AutoTraderConfig cfg2 = new RandomTraderConfig();
|
|
|
|
|
2017-01-25 00:24:53 +01:00
|
|
|
for (int i = 0; i < 700; i++) {
|
2017-01-28 15:34:24 +01:00
|
|
|
AutoTrader randt = cfg2.createTrader(Globals.se, null, 100, 100);
|
2017-01-22 21:41:45 +01:00
|
|
|
|
|
|
|
Globals.se.traders.add(randt);
|
|
|
|
randt.setName("Bob");
|
|
|
|
randt.start();
|
|
|
|
}
|
|
|
|
|
2017-01-15 18:15:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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() {
|
|
|
|
|
2017-01-28 15:34:24 +01:00
|
|
|
jScrollPane2 = new javax.swing.JScrollPane();
|
|
|
|
jTextArea1 = new javax.swing.JTextArea();
|
2017-01-22 21:41:45 +01:00
|
|
|
jToolBar1 = new javax.swing.JToolBar();
|
|
|
|
jButton1 = new javax.swing.JButton();
|
|
|
|
jButton2 = new javax.swing.JButton();
|
|
|
|
orderBookPanel1 = new gui.OrderBookPanel();
|
2017-01-23 18:56:09 +01:00
|
|
|
jScrollPane1 = new javax.swing.JScrollPane();
|
|
|
|
chart1 = new chart.Chart();
|
2017-01-15 18:15:22 +01:00
|
|
|
menuBar = new javax.swing.JMenuBar();
|
|
|
|
fileMenu = new javax.swing.JMenu();
|
|
|
|
openMenuItem = new javax.swing.JMenuItem();
|
|
|
|
saveMenuItem = new javax.swing.JMenuItem();
|
|
|
|
saveAsMenuItem = new javax.swing.JMenuItem();
|
|
|
|
exitMenuItem = new javax.swing.JMenuItem();
|
2017-01-22 21:41:45 +01:00
|
|
|
jMenuItem1 = new javax.swing.JMenuItem();
|
2017-01-15 18:15:22 +01:00
|
|
|
editMenu = new javax.swing.JMenu();
|
|
|
|
cutMenuItem = new javax.swing.JMenuItem();
|
|
|
|
copyMenuItem = new javax.swing.JMenuItem();
|
2017-01-28 15:34:24 +01:00
|
|
|
jSeparator1 = new javax.swing.JPopupMenu.Separator();
|
2017-01-15 18:15:22 +01:00
|
|
|
pasteMenuItem = new javax.swing.JMenuItem();
|
|
|
|
deleteMenuItem = new javax.swing.JMenuItem();
|
2017-01-28 15:34:24 +01:00
|
|
|
jSeparator2 = new javax.swing.JPopupMenu.Separator();
|
2017-01-22 21:41:45 +01:00
|
|
|
editPreferences = new javax.swing.JMenuItem();
|
|
|
|
jMenu1 = new javax.swing.JMenu();
|
|
|
|
jMenuItem2 = new javax.swing.JMenuItem();
|
2017-01-28 15:34:24 +01:00
|
|
|
jMenuItem3 = new javax.swing.JMenuItem();
|
2017-01-15 18:15:22 +01:00
|
|
|
helpMenu = new javax.swing.JMenu();
|
|
|
|
contentMenuItem = new javax.swing.JMenuItem();
|
|
|
|
aboutMenuItem = new javax.swing.JMenuItem();
|
|
|
|
|
2017-01-28 15:34:24 +01:00
|
|
|
jTextArea1.setColumns(20);
|
|
|
|
jTextArea1.setRows(5);
|
|
|
|
jTextArea1.setText("Hakke");
|
|
|
|
jScrollPane2.setViewportView(jTextArea1);
|
|
|
|
|
2017-01-15 18:15:22 +01:00
|
|
|
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
|
2017-01-22 21:41:45 +01:00
|
|
|
setMinimumSize(new java.awt.Dimension(640, 480));
|
|
|
|
setPreferredSize(new java.awt.Dimension(800, 561));
|
|
|
|
|
|
|
|
jToolBar1.setFloatable(false);
|
|
|
|
jToolBar1.setRollover(true);
|
|
|
|
|
|
|
|
jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/run.gif"))); // NOI18N
|
|
|
|
jButton1.setText("Run sim!");
|
|
|
|
jButton1.setToolTipText("Run the simmulation");
|
|
|
|
jButton1.setFocusable(false);
|
|
|
|
jButton1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
|
|
|
|
jButton1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
|
|
|
|
jButton1.addActionListener(new java.awt.event.ActionListener() {
|
|
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
|
|
jButton1ActionPerformed(evt);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
jToolBar1.add(jButton1);
|
|
|
|
|
|
|
|
jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/pause.gif"))); // NOI18N
|
|
|
|
jButton2.setText("Pause");
|
|
|
|
jButton2.setFocusable(false);
|
|
|
|
jButton2.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
|
|
|
|
jButton2.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
|
|
|
|
jButton2.addActionListener(new java.awt.event.ActionListener() {
|
|
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
|
|
jButton2ActionPerformed(evt);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
jToolBar1.add(jButton2);
|
|
|
|
|
2017-01-23 18:56:09 +01:00
|
|
|
javax.swing.GroupLayout chart1Layout = new javax.swing.GroupLayout(chart1);
|
|
|
|
chart1.setLayout(chart1Layout);
|
|
|
|
chart1Layout.setHorizontalGroup(
|
|
|
|
chart1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
2017-01-28 15:34:24 +01:00
|
|
|
.addGap(0, 300, Short.MAX_VALUE)
|
2017-01-22 21:41:45 +01:00
|
|
|
);
|
2017-01-23 18:56:09 +01:00
|
|
|
chart1Layout.setVerticalGroup(
|
|
|
|
chart1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
2017-01-28 15:34:24 +01:00
|
|
|
.addGap(0, 300, Short.MAX_VALUE)
|
2017-01-22 21:41:45 +01:00
|
|
|
);
|
|
|
|
|
2017-01-23 18:56:09 +01:00
|
|
|
jScrollPane1.setViewportView(chart1);
|
2017-01-15 18:15:22 +01:00
|
|
|
|
|
|
|
fileMenu.setMnemonic('f');
|
|
|
|
fileMenu.setText("File");
|
|
|
|
|
|
|
|
openMenuItem.setMnemonic('o');
|
|
|
|
openMenuItem.setText("Open");
|
|
|
|
fileMenu.add(openMenuItem);
|
|
|
|
|
|
|
|
saveMenuItem.setMnemonic('s');
|
|
|
|
saveMenuItem.setText("Save");
|
|
|
|
fileMenu.add(saveMenuItem);
|
|
|
|
|
|
|
|
saveAsMenuItem.setMnemonic('a');
|
|
|
|
saveAsMenuItem.setText("Save As ...");
|
|
|
|
saveAsMenuItem.setDisplayedMnemonicIndex(5);
|
|
|
|
fileMenu.add(saveAsMenuItem);
|
|
|
|
|
|
|
|
exitMenuItem.setMnemonic('x');
|
|
|
|
exitMenuItem.setText("Exit");
|
|
|
|
exitMenuItem.addActionListener(new java.awt.event.ActionListener() {
|
|
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
|
|
exitMenuItemActionPerformed(evt);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
fileMenu.add(exitMenuItem);
|
|
|
|
|
2017-01-22 21:41:45 +01:00
|
|
|
jMenuItem1.setText("Run");
|
|
|
|
jMenuItem1.setHideActionText(true);
|
|
|
|
jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
|
|
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
|
|
jMenuItem1ActionPerformed(evt);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
fileMenu.add(jMenuItem1);
|
|
|
|
|
2017-01-15 18:15:22 +01:00
|
|
|
menuBar.add(fileMenu);
|
|
|
|
|
|
|
|
editMenu.setMnemonic('e');
|
|
|
|
editMenu.setText("Edit");
|
|
|
|
|
|
|
|
cutMenuItem.setMnemonic('t');
|
|
|
|
cutMenuItem.setText("Cut");
|
|
|
|
editMenu.add(cutMenuItem);
|
|
|
|
|
|
|
|
copyMenuItem.setMnemonic('y');
|
|
|
|
copyMenuItem.setText("Copy");
|
|
|
|
editMenu.add(copyMenuItem);
|
2017-01-28 15:34:24 +01:00
|
|
|
editMenu.add(jSeparator1);
|
2017-01-15 18:15:22 +01:00
|
|
|
|
2017-01-26 01:52:03 +01:00
|
|
|
pasteMenuItem.setMnemonic('s');
|
|
|
|
pasteMenuItem.setText("Strategies ...");
|
|
|
|
pasteMenuItem.addActionListener(new java.awt.event.ActionListener() {
|
|
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
|
|
pasteMenuItemActionPerformed(evt);
|
|
|
|
}
|
|
|
|
});
|
2017-01-15 18:15:22 +01:00
|
|
|
editMenu.add(pasteMenuItem);
|
|
|
|
|
|
|
|
deleteMenuItem.setMnemonic('d');
|
2017-01-24 02:28:00 +01:00
|
|
|
deleteMenuItem.setText("Traders ...");
|
|
|
|
deleteMenuItem.addActionListener(new java.awt.event.ActionListener() {
|
|
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
|
|
deleteMenuItemActionPerformed(evt);
|
|
|
|
}
|
|
|
|
});
|
2017-01-15 18:15:22 +01:00
|
|
|
editMenu.add(deleteMenuItem);
|
2017-01-28 15:34:24 +01:00
|
|
|
editMenu.add(jSeparator2);
|
2017-01-15 18:15:22 +01:00
|
|
|
|
2017-01-22 21:41:45 +01:00
|
|
|
editPreferences.setMnemonic('p');
|
|
|
|
editPreferences.setText("Preferences ...");
|
|
|
|
editPreferences.addActionListener(new java.awt.event.ActionListener() {
|
|
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
|
|
editPreferencesActionPerformed(evt);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
editMenu.add(editPreferences);
|
|
|
|
|
2017-01-15 18:15:22 +01:00
|
|
|
menuBar.add(editMenu);
|
|
|
|
|
2017-01-22 21:41:45 +01:00
|
|
|
jMenu1.setText("View");
|
|
|
|
|
|
|
|
jMenuItem2.setText("Traders");
|
|
|
|
jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
|
|
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
|
|
jMenuItem2ActionPerformed(evt);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
jMenu1.add(jMenuItem2);
|
|
|
|
|
2017-01-28 15:34:24 +01:00
|
|
|
jMenuItem3.setText("LogWindow");
|
|
|
|
jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
|
|
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
|
|
jMenuItem3ActionPerformed(evt);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
jMenu1.add(jMenuItem3);
|
|
|
|
|
2017-01-22 21:41:45 +01:00
|
|
|
menuBar.add(jMenu1);
|
|
|
|
|
2017-01-15 18:15:22 +01:00
|
|
|
helpMenu.setMnemonic('h');
|
|
|
|
helpMenu.setText("Help");
|
|
|
|
|
|
|
|
contentMenuItem.setMnemonic('c');
|
|
|
|
contentMenuItem.setText("Contents");
|
|
|
|
helpMenu.add(contentMenuItem);
|
|
|
|
|
|
|
|
aboutMenuItem.setMnemonic('a');
|
|
|
|
aboutMenuItem.setText("About");
|
2017-01-22 21:41:45 +01:00
|
|
|
aboutMenuItem.addActionListener(new java.awt.event.ActionListener() {
|
|
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
|
|
aboutMenuItemActionPerformed(evt);
|
|
|
|
}
|
|
|
|
});
|
2017-01-15 18:15:22 +01:00
|
|
|
helpMenu.add(aboutMenuItem);
|
|
|
|
|
|
|
|
menuBar.add(helpMenu);
|
|
|
|
|
|
|
|
setJMenuBar(menuBar);
|
|
|
|
|
|
|
|
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
|
|
|
getContentPane().setLayout(layout);
|
|
|
|
layout.setHorizontalGroup(
|
|
|
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
2017-01-28 15:34:24 +01:00
|
|
|
.addComponent(jToolBar1, javax.swing.GroupLayout.DEFAULT_SIZE, 797, Short.MAX_VALUE)
|
2017-01-22 21:41:45 +01:00
|
|
|
.addGroup(layout.createSequentialGroup()
|
|
|
|
.addContainerGap()
|
|
|
|
.addComponent(orderBookPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
2017-01-29 22:21:12 +01:00
|
|
|
.addComponent(jScrollPane1)
|
|
|
|
.addContainerGap())
|
2017-01-15 18:15:22 +01:00
|
|
|
);
|
|
|
|
layout.setVerticalGroup(
|
|
|
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
2017-01-22 21:41:45 +01:00
|
|
|
.addGroup(layout.createSequentialGroup()
|
|
|
|
.addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
|
|
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
2017-01-28 15:34:24 +01:00
|
|
|
.addComponent(orderBookPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 466, Short.MAX_VALUE)
|
|
|
|
.addComponent(jScrollPane1))
|
2017-01-22 21:41:45 +01:00
|
|
|
.addContainerGap())
|
2017-01-15 18:15:22 +01:00
|
|
|
);
|
|
|
|
|
|
|
|
pack();
|
|
|
|
}// </editor-fold>//GEN-END:initComponents
|
|
|
|
|
|
|
|
private void exitMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitMenuItemActionPerformed
|
|
|
|
System.exit(0);
|
|
|
|
}//GEN-LAST:event_exitMenuItemActionPerformed
|
|
|
|
|
2017-01-22 21:41:45 +01:00
|
|
|
private void aboutMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_aboutMenuItemActionPerformed
|
|
|
|
Dialog d = new gui.AboutDialog(this, rootPaneCheckingEnabled);
|
|
|
|
d.setVisible(rootPaneCheckingEnabled);
|
|
|
|
|
|
|
|
}//GEN-LAST:event_aboutMenuItemActionPerformed
|
|
|
|
|
|
|
|
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
|
|
|
|
this.startTraders();
|
|
|
|
Globals.se.timer.start();
|
|
|
|
}//GEN-LAST:event_jButton1ActionPerformed
|
|
|
|
|
|
|
|
private void editPreferencesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editPreferencesActionPerformed
|
2017-01-28 15:34:24 +01:00
|
|
|
Globals.LOGGER.info("Edit prefs...");
|
|
|
|
|
2017-01-22 21:41:45 +01:00
|
|
|
Dialog d = new gui.EditPreferencesDialog(this, rootPaneCheckingEnabled);
|
|
|
|
d.setVisible(rootPaneCheckingEnabled);
|
|
|
|
}//GEN-LAST:event_editPreferencesActionPerformed
|
|
|
|
|
|
|
|
private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
|
|
|
|
// TODO add your handling code here:
|
|
|
|
}//GEN-LAST:event_jMenuItem1ActionPerformed
|
|
|
|
|
|
|
|
private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed
|
2017-01-23 18:56:09 +01:00
|
|
|
TraderListDialog d = new TraderListDialog(this, false);
|
2017-01-22 21:41:45 +01:00
|
|
|
d.setVisible(rootPaneCheckingEnabled);
|
|
|
|
}//GEN-LAST:event_jMenuItem2ActionPerformed
|
|
|
|
|
|
|
|
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
|
|
|
|
Globals.se.timer.pause();
|
|
|
|
}//GEN-LAST:event_jButton2ActionPerformed
|
|
|
|
|
2017-01-24 02:28:00 +01:00
|
|
|
private void deleteMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteMenuItemActionPerformed
|
2017-01-28 15:34:24 +01:00
|
|
|
EditAutoTraderListDialog ed = new EditAutoTraderListDialog(this, true);
|
2017-01-25 00:24:53 +01:00
|
|
|
ed.setVisible(rootPaneCheckingEnabled);
|
|
|
|
|
|
|
|
|
2017-01-24 02:28:00 +01:00
|
|
|
}//GEN-LAST:event_deleteMenuItemActionPerformed
|
|
|
|
|
2017-01-26 01:52:03 +01:00
|
|
|
private void pasteMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pasteMenuItemActionPerformed
|
2017-01-28 15:34:24 +01:00
|
|
|
EditStrategies s = new EditStrategies(this, true);
|
2017-01-26 01:52:03 +01:00
|
|
|
s.setVisible(rootPaneCheckingEnabled);
|
|
|
|
|
2017-01-28 15:34:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-26 01:52:03 +01:00
|
|
|
}//GEN-LAST:event_pasteMenuItemActionPerformed
|
|
|
|
|
2017-01-28 15:34:24 +01:00
|
|
|
|
|
|
|
private final LoggerDialog log_d = new LoggerDialog(this,false);
|
|
|
|
|
|
|
|
private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed
|
|
|
|
log_d.setVisible(!log_d.isShowing());
|
|
|
|
|
|
|
|
|
|
|
|
}//GEN-LAST:event_jMenuItem3ActionPerformed
|
|
|
|
|
2017-01-15 18:15:22 +01:00
|
|
|
/**
|
|
|
|
* @param args the command line arguments
|
2017-01-25 00:24:53 +01:00
|
|
|
* @throws java.lang.IllegalAccessException
|
|
|
|
* @throws java.lang.InstantiationException
|
2017-01-15 18:15:22 +01:00
|
|
|
*/
|
2017-01-25 00:24:53 +01:00
|
|
|
public static void main(String args[]) throws IllegalAccessException, InstantiationException {
|
2017-01-22 21:41:45 +01:00
|
|
|
Globals.se = new Exchange();
|
2017-01-28 15:34:24 +01:00
|
|
|
|
2017-01-25 02:52:49 +01:00
|
|
|
class Tube {
|
2017-01-28 15:34:24 +01:00
|
|
|
|
2017-01-25 02:52:49 +01:00
|
|
|
}
|
2017-01-28 15:34:24 +01:00
|
|
|
|
2017-01-25 02:52:49 +01:00
|
|
|
Class<?> c = sesim.Exchange.class;
|
2017-01-28 15:34:24 +01:00
|
|
|
Globals.prefs = Preferences.userNodeForPackage(c);
|
|
|
|
|
2017-01-25 02:52:49 +01:00
|
|
|
Globals.setLookAndFeel(Globals.prefs.get("laf", "Nimbus"));
|
2017-01-28 15:34:24 +01:00
|
|
|
|
|
|
|
/* try {
|
2017-01-25 02:52:49 +01:00
|
|
|
// Set cross-platform Java L&F (also called "Metal")
|
|
|
|
UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
|
|
|
|
} catch (UnsupportedLookAndFeelException | ClassNotFoundException |
|
|
|
|
InstantiationException | IllegalAccessException e) {
|
|
|
|
}
|
2017-01-28 15:34:24 +01:00
|
|
|
*/
|
2017-01-25 00:24:53 +01:00
|
|
|
ArrayList<Class<AutoTraderConfig>> traders;
|
|
|
|
traders = null;
|
|
|
|
|
2017-01-26 01:52:03 +01:00
|
|
|
sesim.AutoTraderLoader tl = new sesim.AutoTraderLoader();
|
2017-01-25 00:24:53 +01:00
|
|
|
try {
|
2017-01-26 01:52:03 +01:00
|
|
|
traders = tl.getTraders();
|
2017-01-25 00:24:53 +01:00
|
|
|
} catch (Exception e) {
|
|
|
|
System.out.print("Execption\n");
|
2017-01-24 02:28:00 +01:00
|
|
|
}
|
2017-01-25 00:24:53 +01:00
|
|
|
|
|
|
|
for (Class<AutoTraderConfig> at_class : traders) {
|
|
|
|
AutoTraderConfig cfg = at_class.newInstance();
|
|
|
|
System.out.printf("Have a Trader with name: %s\n", cfg.getName());
|
|
|
|
}
|
|
|
|
|
|
|
|
//System.exit(0);
|
2017-01-15 18:15:22 +01:00
|
|
|
/* Create and display the form */
|
|
|
|
java.awt.EventQueue.invokeLater(new Runnable() {
|
|
|
|
public void run() {
|
2017-01-25 02:52:49 +01:00
|
|
|
// Globals.prefs = Preferences.userNodeForPackage(this)
|
2017-01-15 18:15:22 +01:00
|
|
|
new NewMDIApplication().setVisible(true);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
|
|
|
private javax.swing.JMenuItem aboutMenuItem;
|
2017-01-23 18:56:09 +01:00
|
|
|
private chart.Chart chart1;
|
2017-01-15 18:15:22 +01:00
|
|
|
private javax.swing.JMenuItem contentMenuItem;
|
|
|
|
private javax.swing.JMenuItem copyMenuItem;
|
|
|
|
private javax.swing.JMenuItem cutMenuItem;
|
|
|
|
private javax.swing.JMenuItem deleteMenuItem;
|
|
|
|
private javax.swing.JMenu editMenu;
|
2017-01-22 21:41:45 +01:00
|
|
|
private javax.swing.JMenuItem editPreferences;
|
2017-01-15 18:15:22 +01:00
|
|
|
private javax.swing.JMenuItem exitMenuItem;
|
|
|
|
private javax.swing.JMenu fileMenu;
|
|
|
|
private javax.swing.JMenu helpMenu;
|
2017-01-22 21:41:45 +01:00
|
|
|
private javax.swing.JButton jButton1;
|
|
|
|
private javax.swing.JButton jButton2;
|
|
|
|
private javax.swing.JMenu jMenu1;
|
|
|
|
private javax.swing.JMenuItem jMenuItem1;
|
|
|
|
private javax.swing.JMenuItem jMenuItem2;
|
2017-01-28 15:34:24 +01:00
|
|
|
private javax.swing.JMenuItem jMenuItem3;
|
2017-01-22 21:41:45 +01:00
|
|
|
private javax.swing.JScrollPane jScrollPane1;
|
2017-01-28 15:34:24 +01:00
|
|
|
private javax.swing.JScrollPane jScrollPane2;
|
|
|
|
private javax.swing.JPopupMenu.Separator jSeparator1;
|
|
|
|
private javax.swing.JPopupMenu.Separator jSeparator2;
|
|
|
|
private javax.swing.JTextArea jTextArea1;
|
2017-01-22 21:41:45 +01:00
|
|
|
private javax.swing.JToolBar jToolBar1;
|
2017-01-15 18:15:22 +01:00
|
|
|
private javax.swing.JMenuBar menuBar;
|
|
|
|
private javax.swing.JMenuItem openMenuItem;
|
2017-01-22 21:41:45 +01:00
|
|
|
private gui.OrderBookPanel orderBookPanel1;
|
2017-01-15 18:15:22 +01:00
|
|
|
private javax.swing.JMenuItem pasteMenuItem;
|
|
|
|
private javax.swing.JMenuItem saveAsMenuItem;
|
|
|
|
private javax.swing.JMenuItem saveMenuItem;
|
|
|
|
// End of variables declaration//GEN-END:variables
|
|
|
|
|
|
|
|
}
|