Wrok on statistics
This commit is contained in:
parent
f8d6942ab7
commit
9089e8f8b1
@ -1,4 +1,4 @@
|
|||||||
#Sun, 09 Apr 2017 08:50:11 +0200
|
#Sun, 09 Apr 2017 23:54:11 +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=
|
||||||
|
@ -23,42 +23,82 @@
|
|||||||
<Layout>
|
<Layout>
|
||||||
<DimensionLayout dim="0">
|
<DimensionLayout dim="0">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="labelHigh" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
<Group type="102" alignment="0" attributes="0">
|
<Group type="102" alignment="0" attributes="0">
|
||||||
<Component id="jScrollPane1" min="-2" pref="270" max="-2" attributes="0"/>
|
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace min="0" pref="128" max="32767" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="labelLow" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="tradesLabel" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace pref="302" max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
<DimensionLayout dim="1">
|
<DimensionLayout dim="1">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" alignment="0" attributes="0">
|
<Group type="102" alignment="0" attributes="0">
|
||||||
<Component id="jScrollPane1" min="-2" pref="275" max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<EmptySpace min="0" pref="23" max="32767" attributes="0"/>
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="labelHigh" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="labelLow" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="tradesLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace pref="235" max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
</Layout>
|
</Layout>
|
||||||
<SubComponents>
|
<SubComponents>
|
||||||
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
|
<Component class="javax.swing.JLabel" name="jLabel1">
|
||||||
<AuxValues>
|
|
||||||
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
|
||||||
</AuxValues>
|
|
||||||
|
|
||||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
|
||||||
<SubComponents>
|
|
||||||
<Component class="javax.swing.JTable" name="jTable1">
|
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
|
<Property name="text" type="java.lang.String" value="Trades:"/>
|
||||||
<Table columnCount="4" rowCount="4">
|
</Properties>
|
||||||
<Column editable="true" title="Title 1" type="java.lang.Object"/>
|
</Component>
|
||||||
<Column editable="true" title="Title 2" type="java.lang.Object"/>
|
<Component class="javax.swing.JLabel" name="jLabel2">
|
||||||
<Column editable="true" title="Title 3" type="java.lang.Object"/>
|
<Properties>
|
||||||
<Column editable="true" title="Title 4" type="java.lang.Object"/>
|
<Property name="text" type="java.lang.String" value="Heigh:"/>
|
||||||
</Table>
|
</Properties>
|
||||||
</Property>
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel3">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Low:"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="labelHigh">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="100.00"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="labelLow">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="50.00"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="tradesLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="0"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
</SubComponents>
|
</SubComponents>
|
||||||
</Container>
|
|
||||||
</SubComponents>
|
|
||||||
</Form>
|
</Form>
|
||||||
|
@ -25,6 +25,10 @@
|
|||||||
*/
|
*/
|
||||||
package gui;
|
package gui;
|
||||||
|
|
||||||
|
import java.util.Timer;
|
||||||
|
import java.util.TimerTask;
|
||||||
|
import sesim.Exchange;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author 7u83 <7u83@mail.ru>
|
* @author 7u83 <7u83@mail.ru>
|
||||||
@ -36,6 +40,18 @@ public class Statistics extends javax.swing.JPanel {
|
|||||||
*/
|
*/
|
||||||
public Statistics() {
|
public Statistics() {
|
||||||
initComponents();
|
initComponents();
|
||||||
|
|
||||||
|
new Timer().schedule(new TimerTask() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
System.out.printf("Statistics comming\n");
|
||||||
|
Exchange.Statistics s = Globals.se.getStatistics();
|
||||||
|
|
||||||
|
tradesLabel.setText(String.format("%d", s.trades));
|
||||||
|
|
||||||
|
}
|
||||||
|
}, 1000, 1000);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -47,43 +63,74 @@ public class Statistics extends javax.swing.JPanel {
|
|||||||
// <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() {
|
||||||
|
|
||||||
jScrollPane1 = new javax.swing.JScrollPane();
|
jLabel1 = new javax.swing.JLabel();
|
||||||
jTable1 = new javax.swing.JTable();
|
jLabel2 = new javax.swing.JLabel();
|
||||||
|
jLabel3 = new javax.swing.JLabel();
|
||||||
|
labelHigh = new javax.swing.JLabel();
|
||||||
|
labelLow = new javax.swing.JLabel();
|
||||||
|
tradesLabel = new javax.swing.JLabel();
|
||||||
|
|
||||||
setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
|
setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
|
||||||
|
|
||||||
jTable1.setModel(new javax.swing.table.DefaultTableModel(
|
jLabel1.setText("Trades:");
|
||||||
new Object [][] {
|
|
||||||
{null, null, null, null},
|
jLabel2.setText("Heigh:");
|
||||||
{null, null, null, null},
|
|
||||||
{null, null, null, null},
|
jLabel3.setText("Low:");
|
||||||
{null, null, null, null}
|
|
||||||
},
|
labelHigh.setText("100.00");
|
||||||
new String [] {
|
|
||||||
"Title 1", "Title 2", "Title 3", "Title 4"
|
labelLow.setText("50.00");
|
||||||
}
|
|
||||||
));
|
tradesLabel.setText("0");
|
||||||
jScrollPane1.setViewportView(jTable1);
|
|
||||||
|
|
||||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
||||||
this.setLayout(layout);
|
this.setLayout(layout);
|
||||||
layout.setHorizontalGroup(
|
layout.setHorizontalGroup(
|
||||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addGroup(layout.createSequentialGroup()
|
.addGroup(layout.createSequentialGroup()
|
||||||
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 270, javax.swing.GroupLayout.PREFERRED_SIZE)
|
.addContainerGap()
|
||||||
.addGap(0, 128, Short.MAX_VALUE))
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addComponent(jLabel2)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(labelHigh))
|
||||||
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addComponent(jLabel3)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(labelLow))
|
||||||
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addComponent(jLabel1)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(tradesLabel)))
|
||||||
|
.addContainerGap(302, Short.MAX_VALUE))
|
||||||
);
|
);
|
||||||
layout.setVerticalGroup(
|
layout.setVerticalGroup(
|
||||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addGroup(layout.createSequentialGroup()
|
.addGroup(layout.createSequentialGroup()
|
||||||
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 275, javax.swing.GroupLayout.PREFERRED_SIZE)
|
.addContainerGap()
|
||||||
.addGap(0, 23, Short.MAX_VALUE))
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
|
.addComponent(jLabel2)
|
||||||
|
.addComponent(labelHigh))
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
|
.addComponent(jLabel3)
|
||||||
|
.addComponent(labelLow))
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
|
.addComponent(jLabel1)
|
||||||
|
.addComponent(tradesLabel))
|
||||||
|
.addContainerGap(235, Short.MAX_VALUE))
|
||||||
);
|
);
|
||||||
}// </editor-fold>//GEN-END:initComponents
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
|
|
||||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
private javax.swing.JScrollPane jScrollPane1;
|
private javax.swing.JLabel jLabel1;
|
||||||
private javax.swing.JTable jTable1;
|
private javax.swing.JLabel jLabel2;
|
||||||
|
private javax.swing.JLabel jLabel3;
|
||||||
|
private javax.swing.JLabel labelHigh;
|
||||||
|
private javax.swing.JLabel labelLow;
|
||||||
|
private javax.swing.JLabel tradesLabel;
|
||||||
// End of variables declaration//GEN-END:variables
|
// End of variables declaration//GEN-END:variables
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user