Work on Control panel ...
This commit is contained in:
parent
ee5bddfd82
commit
cff5f34cd0
@ -63,6 +63,7 @@ manifest.file=manifest.mf
|
||||
meta.inf.dir=${src.dir}/META-INF
|
||||
mkdist.disabled=false
|
||||
platform.active=default_platform
|
||||
project.license=bsd
|
||||
run.classpath=\
|
||||
${javac.classpath}:\
|
||||
${build.classes.dir}
|
||||
|
@ -22,9 +22,6 @@
|
||||
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||
<Color blue="1" green="cb" red="fe" type="rgb"/>
|
||||
</Property>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="null"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="File"/>
|
||||
</Properties>
|
||||
<SubComponents>
|
||||
@ -60,7 +57,7 @@
|
||||
<Properties>
|
||||
<Property name="defaultCloseOperation" type="int" value="3"/>
|
||||
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[400, 200]"/>
|
||||
<Dimension value="[640, 480]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<SyntheticProperties>
|
||||
@ -103,16 +100,6 @@
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="jButton2">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="jButton2"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
|
||||
<BorderConstraints direction="After"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="Gui.OrderBook" name="orderBook1">
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
|
||||
@ -120,5 +107,12 @@
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="Gui.ControlPanel" name="controlPanel2">
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
|
||||
<BorderConstraints direction="After"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Form>
|
||||
|
@ -6,6 +6,9 @@
|
||||
package Gui;
|
||||
|
||||
import SeSim.Exchange;
|
||||
import SeSim.BuyOrder;
|
||||
import javax.swing.UIManager;
|
||||
import javax.swing.*;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -14,13 +17,12 @@ import SeSim.Exchange;
|
||||
public class MainWin extends javax.swing.JFrame {
|
||||
|
||||
static SeSim.Exchange se;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Creates new form MainWin
|
||||
*/
|
||||
public MainWin() {
|
||||
|
||||
|
||||
initComponents();
|
||||
}
|
||||
|
||||
@ -37,8 +39,8 @@ public class MainWin extends javax.swing.JFrame {
|
||||
jMenuItem1 = new javax.swing.JMenuItem();
|
||||
jLabel1 = new javax.swing.JLabel();
|
||||
jLabel2 = new javax.swing.JLabel();
|
||||
jButton2 = new javax.swing.JButton();
|
||||
orderBook1 = new Gui.OrderBook();
|
||||
controlPanel2 = new Gui.ControlPanel();
|
||||
MainMenu = new javax.swing.JMenuBar();
|
||||
FileMenu = new javax.swing.JMenu();
|
||||
FileNew = new javax.swing.JMenuItem();
|
||||
@ -55,20 +57,17 @@ public class MainWin extends javax.swing.JFrame {
|
||||
jMenuItem1.setText("jMenuItem1");
|
||||
|
||||
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
|
||||
setMinimumSize(new java.awt.Dimension(400, 200));
|
||||
setMinimumSize(new java.awt.Dimension(640, 480));
|
||||
|
||||
jLabel1.setText("jLabel1");
|
||||
getContentPane().add(jLabel1, java.awt.BorderLayout.LINE_START);
|
||||
|
||||
jLabel2.setText("jLabel2");
|
||||
getContentPane().add(jLabel2, java.awt.BorderLayout.CENTER);
|
||||
|
||||
jButton2.setText("jButton2");
|
||||
getContentPane().add(jButton2, java.awt.BorderLayout.LINE_END);
|
||||
getContentPane().add(orderBook1, java.awt.BorderLayout.PAGE_END);
|
||||
getContentPane().add(controlPanel2, java.awt.BorderLayout.LINE_END);
|
||||
|
||||
FileMenu.setBackground(new java.awt.Color(254, 203, 1));
|
||||
FileMenu.setBorder(null);
|
||||
FileMenu.setText("File");
|
||||
|
||||
FileNew.setText("New");
|
||||
@ -119,26 +118,47 @@ public class MainWin extends javax.swing.JFrame {
|
||||
se = new Exchange();
|
||||
|
||||
SeSim.BuyOrder bo = new SeSim.BuyOrder();
|
||||
bo.limit=20.0;
|
||||
bo.size=12;
|
||||
bo.timestamp=12;
|
||||
bo.limit = 20.0;
|
||||
bo.size = 12;
|
||||
bo.timestamp = 12;
|
||||
se.SendOrder(bo);
|
||||
|
||||
SeSim.BuyOrder bo1 = new SeSim.BuyOrder();
|
||||
bo1.limit=27.0;
|
||||
bo1.size=123;
|
||||
bo1.timestamp=922;
|
||||
bo1.limit = 27.0;
|
||||
bo1.size = 123;
|
||||
bo1.timestamp = 922;
|
||||
se.SendOrder(bo1);
|
||||
|
||||
for (int i = 0; i < 130; i++) {
|
||||
BuyOrder o = new BuyOrder();
|
||||
o.size = 90 + i;
|
||||
o.limit = 80 + i;
|
||||
se.SendOrder(o);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
try {
|
||||
// Set cross-platform Java L&F (also called "Metal")
|
||||
UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
|
||||
}
|
||||
catch (UnsupportedLookAndFeelException | ClassNotFoundException | InstantiationException | IllegalAccessException e) {
|
||||
System.out.print("Alles muell\n");
|
||||
}
|
||||
// handle exception
|
||||
// handle exception
|
||||
// handle exception
|
||||
|
||||
|
||||
/* Set the Nimbus look and feel */
|
||||
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
|
||||
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
|
||||
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
|
||||
*/
|
||||
try {
|
||||
/* try {
|
||||
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
|
||||
if ("Nimbus".equals(info.getName())) {
|
||||
if ("Motif".equals(info.getName())) {
|
||||
javax.swing.UIManager.setLookAndFeel(info.getClassName());
|
||||
break;
|
||||
}
|
||||
@ -152,9 +172,9 @@ public class MainWin extends javax.swing.JFrame {
|
||||
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
|
||||
java.util.logging.Logger.getLogger(MainWin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||
}
|
||||
*/
|
||||
//</editor-fold>
|
||||
|
||||
|
||||
/* Create and display the form */
|
||||
java.awt.EventQueue.invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
@ -168,8 +188,8 @@ public class MainWin extends javax.swing.JFrame {
|
||||
private javax.swing.JMenuItem FileNew;
|
||||
private javax.swing.JMenuItem FileRun;
|
||||
private javax.swing.JMenuBar MainMenu;
|
||||
private Gui.ControlPanel controlPanel2;
|
||||
private javax.swing.JButton jButton1;
|
||||
private javax.swing.JButton jButton2;
|
||||
private javax.swing.JLabel jLabel1;
|
||||
private javax.swing.JLabel jLabel2;
|
||||
private javax.swing.JMenu jMenu2;
|
||||
|
@ -50,8 +50,23 @@
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JList" name="BidList">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.ListModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
||||
<Connection code="bid" type="code"/>
|
||||
<Property name="model" type="javax.swing.ListModel" editor="org.netbeans.modules.form.editors2.ListModelEditor">
|
||||
<StringArray count="14">
|
||||
<StringItem index="0" value="a"/>
|
||||
<StringItem index="1" value="b"/>
|
||||
<StringItem index="2" value="c"/>
|
||||
<StringItem index="3" value="d"/>
|
||||
<StringItem index="4" value="e"/>
|
||||
<StringItem index="5" value="f"/>
|
||||
<StringItem index="6" value="g"/>
|
||||
<StringItem index="7" value="h"/>
|
||||
<StringItem index="8" value="i"/>
|
||||
<StringItem index="9" value="j"/>
|
||||
<StringItem index="10" value="k"/>
|
||||
<StringItem index="11" value="l"/>
|
||||
<StringItem index="12" value="m"/>
|
||||
<StringItem index="13" value=" "/>
|
||||
</StringArray>
|
||||
</Property>
|
||||
<Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor">
|
||||
<Color id="Default Cursor"/>
|
||||
@ -114,13 +129,6 @@
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSeparator" name="jSeparator1">
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="10" gridY="0" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
<LayoutCode>
|
||||
<CodeStatement>
|
||||
@ -604,61 +612,5 @@
|
||||
<CodeExpression id="31_gridBagConstraints"/>
|
||||
</Parameters>
|
||||
</CodeStatement>
|
||||
<CodeStatement>
|
||||
<CodeExpression id="36_gridBagConstraints">
|
||||
<CodeVariable name="gridBagConstraints"/>
|
||||
<ExpressionOrigin>
|
||||
<ExpressionProvider type="CodeConstructor">
|
||||
<CodeConstructor class="java.awt.GridBagConstraints" parameterTypes=""/>
|
||||
</ExpressionProvider>
|
||||
</ExpressionOrigin>
|
||||
</CodeExpression>
|
||||
<StatementProvider type="CodeExpression">
|
||||
<CodeExpression id="36_gridBagConstraints"/>
|
||||
</StatementProvider>
|
||||
</CodeStatement>
|
||||
<CodeStatement>
|
||||
<CodeExpression id="36_gridBagConstraints"/>
|
||||
<StatementProvider type="CodeField">
|
||||
<CodeField name="gridx" class="java.awt.GridBagConstraints"/>
|
||||
</StatementProvider>
|
||||
<Parameters>
|
||||
<CodeExpression id="37">
|
||||
<ExpressionOrigin>
|
||||
<Value type="int" value="10"/>
|
||||
</ExpressionOrigin>
|
||||
</CodeExpression>
|
||||
</Parameters>
|
||||
</CodeStatement>
|
||||
<CodeStatement>
|
||||
<CodeExpression id="36_gridBagConstraints"/>
|
||||
<StatementProvider type="CodeField">
|
||||
<CodeField name="gridy" class="java.awt.GridBagConstraints"/>
|
||||
</StatementProvider>
|
||||
<Parameters>
|
||||
<CodeExpression id="38">
|
||||
<ExpressionOrigin>
|
||||
<Value type="int" value="0"/>
|
||||
</ExpressionOrigin>
|
||||
</CodeExpression>
|
||||
</Parameters>
|
||||
</CodeStatement>
|
||||
<CodeStatement>
|
||||
<CodeExpression id="4"/>
|
||||
<StatementProvider type="CodeMethod">
|
||||
<CodeMethod name="add" class="java.awt.Container" parameterTypes="java.awt.Component, java.lang.Object"/>
|
||||
</StatementProvider>
|
||||
<Parameters>
|
||||
<CodeExpression id="39_jSeparator1">
|
||||
<CodeVariable name="jSeparator1" type="8194" declaredType="javax.swing.JSeparator"/>
|
||||
<ExpressionOrigin>
|
||||
<ExpressionProvider type="ComponentRef">
|
||||
<ComponentRef name="jSeparator1"/>
|
||||
</ExpressionProvider>
|
||||
</ExpressionOrigin>
|
||||
</CodeExpression>
|
||||
<CodeExpression id="36_gridBagConstraints"/>
|
||||
</Parameters>
|
||||
</CodeStatement>
|
||||
</LayoutCode>
|
||||
</Form>
|
||||
|
@ -48,9 +48,17 @@ public class OrderBook extends javax.swing.JPanel {
|
||||
|
||||
public OrderBook() {
|
||||
this.se = MainWin.se;
|
||||
bid = new SListModel(se.bid);
|
||||
|
||||
|
||||
|
||||
initComponents();
|
||||
|
||||
if (this.se == null){
|
||||
return;
|
||||
}
|
||||
|
||||
bid = new SListModel(se.bid);
|
||||
BidList.setModel(bid);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -70,7 +78,6 @@ public class OrderBook extends javax.swing.JPanel {
|
||||
jScrollPane2 = new javax.swing.JScrollPane();
|
||||
AskList = new javax.swing.JList<>();
|
||||
jLabel2 = new javax.swing.JLabel();
|
||||
jSeparator1 = new javax.swing.JSeparator();
|
||||
|
||||
java.awt.GridBagLayout layout = new java.awt.GridBagLayout();
|
||||
layout.columnWidths = new int[] {0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0};
|
||||
@ -95,7 +102,11 @@ public class OrderBook extends javax.swing.JPanel {
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
|
||||
add(jLabel3, gridBagConstraints);
|
||||
|
||||
BidList.setModel(bid);
|
||||
BidList.setModel(new javax.swing.AbstractListModel<String>() {
|
||||
String[] strings = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", " " };
|
||||
public int getSize() { return strings.length; }
|
||||
public String getElementAt(int i) { return strings[i]; }
|
||||
});
|
||||
BidList.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
|
||||
BidList.setMinimumSize(new java.awt.Dimension(52, 200));
|
||||
BidList.setName(""); // NOI18N
|
||||
@ -133,10 +144,6 @@ public class OrderBook extends javax.swing.JPanel {
|
||||
gridBagConstraints.gridy = 0;
|
||||
gridBagConstraints.gridwidth = 5;
|
||||
add(jLabel2, gridBagConstraints);
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 10;
|
||||
gridBagConstraints.gridy = 0;
|
||||
add(jSeparator1, gridBagConstraints);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
|
||||
@ -148,6 +155,5 @@ public class OrderBook extends javax.swing.JPanel {
|
||||
private javax.swing.JLabel jLabel3;
|
||||
private javax.swing.JScrollPane jScrollPane1;
|
||||
private javax.swing.JScrollPane jScrollPane2;
|
||||
private javax.swing.JSeparator jSeparator1;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ package SeSim;
|
||||
|
||||
public interface Trader {
|
||||
|
||||
String name = null;
|
||||
// String name = null;
|
||||
|
||||
public void trade();
|
||||
public Account account = new Account();
|
||||
|
Loading…
Reference in New Issue
Block a user