2017-02-13 18:26:32 +01:00
|
|
|
/*
|
|
|
|
* 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;
|
|
|
|
|
2017-02-13 23:23:53 +01:00
|
|
|
import gui.Globals;
|
2017-02-13 18:26:32 +01:00
|
|
|
import sesim.Exchange;
|
2017-10-09 14:15:39 +02:00
|
|
|
import sesim.Order.OrderType;
|
2017-02-13 18:26:32 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @author tobias
|
|
|
|
*/
|
|
|
|
public class OrderBooksHorizontal extends javax.swing.JPanel {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates new form OrderBooksHorizontal
|
|
|
|
*/
|
|
|
|
public OrderBooksHorizontal() {
|
|
|
|
initComponents();
|
2017-02-13 23:23:53 +01:00
|
|
|
if (Globals.se==null)
|
|
|
|
return;
|
2017-02-13 18:26:32 +01:00
|
|
|
|
2017-10-09 14:15:39 +02:00
|
|
|
bidBook.setType(OrderType.BUYLIMIT);
|
|
|
|
askBook.setType(OrderType.SELLLIMIT);
|
2017-02-13 23:23:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public void setDepth(int depth){
|
|
|
|
bidBook.depth=depth;
|
|
|
|
askBook.depth=depth;
|
2017-02-13 18:26:32 +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-02-13 23:23:53 +01:00
|
|
|
bidBookPanel = new javax.swing.JPanel();
|
|
|
|
bidBook = new gui.orderbook.OrderBook();
|
|
|
|
jLabel2 = new javax.swing.JLabel();
|
|
|
|
quoteVertical2 = new gui.orderbook.QuoteVertical();
|
|
|
|
askBookPanel = new javax.swing.JPanel();
|
|
|
|
askBook = new gui.orderbook.OrderBook();
|
|
|
|
jLabel1 = new javax.swing.JLabel();
|
2017-02-13 18:26:32 +01:00
|
|
|
|
|
|
|
setLayout(new javax.swing.BoxLayout(this, javax.swing.BoxLayout.LINE_AXIS));
|
|
|
|
|
2017-02-13 23:23:53 +01:00
|
|
|
bidBookPanel.setPreferredSize(new java.awt.Dimension(320, 296));
|
|
|
|
|
|
|
|
jLabel2.setFont(new java.awt.Font("DejaVu Sans", 1, 12)); // NOI18N
|
|
|
|
jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
|
|
|
jLabel2.setText("Bid");
|
|
|
|
|
|
|
|
javax.swing.GroupLayout bidBookPanelLayout = new javax.swing.GroupLayout(bidBookPanel);
|
|
|
|
bidBookPanel.setLayout(bidBookPanelLayout);
|
|
|
|
bidBookPanelLayout.setHorizontalGroup(
|
|
|
|
bidBookPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
|
|
.addGroup(bidBookPanelLayout.createSequentialGroup()
|
|
|
|
.addContainerGap()
|
|
|
|
.addGroup(bidBookPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
|
|
.addComponent(bidBook, javax.swing.GroupLayout.DEFAULT_SIZE, 244, Short.MAX_VALUE)
|
|
|
|
.addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
|
|
|
.addContainerGap())
|
|
|
|
);
|
|
|
|
bidBookPanelLayout.setVerticalGroup(
|
|
|
|
bidBookPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
|
|
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, bidBookPanelLayout.createSequentialGroup()
|
|
|
|
.addContainerGap()
|
|
|
|
.addComponent(jLabel2)
|
|
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
|
|
|
.addComponent(bidBook, javax.swing.GroupLayout.DEFAULT_SIZE, 269, Short.MAX_VALUE))
|
|
|
|
);
|
|
|
|
|
|
|
|
add(bidBookPanel);
|
|
|
|
add(quoteVertical2);
|
|
|
|
|
|
|
|
askBookPanel.setPreferredSize(new java.awt.Dimension(320, 296));
|
|
|
|
|
|
|
|
jLabel1.setFont(new java.awt.Font("DejaVu Sans", 1, 12)); // NOI18N
|
|
|
|
jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
|
|
|
jLabel1.setText("Ask");
|
|
|
|
|
|
|
|
javax.swing.GroupLayout askBookPanelLayout = new javax.swing.GroupLayout(askBookPanel);
|
|
|
|
askBookPanel.setLayout(askBookPanelLayout);
|
|
|
|
askBookPanelLayout.setHorizontalGroup(
|
|
|
|
askBookPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
|
|
.addGroup(askBookPanelLayout.createSequentialGroup()
|
|
|
|
.addContainerGap()
|
|
|
|
.addGroup(askBookPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
|
|
.addComponent(askBook, javax.swing.GroupLayout.DEFAULT_SIZE, 244, Short.MAX_VALUE)
|
|
|
|
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
|
|
|
.addContainerGap())
|
2017-02-13 18:26:32 +01:00
|
|
|
);
|
2017-02-13 23:23:53 +01:00
|
|
|
askBookPanelLayout.setVerticalGroup(
|
|
|
|
askBookPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
|
|
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, askBookPanelLayout.createSequentialGroup()
|
|
|
|
.addContainerGap()
|
|
|
|
.addComponent(jLabel1)
|
|
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
|
|
|
.addComponent(askBook, javax.swing.GroupLayout.DEFAULT_SIZE, 269, Short.MAX_VALUE))
|
2017-02-13 18:26:32 +01:00
|
|
|
);
|
|
|
|
|
2017-02-13 23:23:53 +01:00
|
|
|
add(askBookPanel);
|
2017-02-13 18:26:32 +01:00
|
|
|
}// </editor-fold>//GEN-END:initComponents
|
|
|
|
|
|
|
|
|
|
|
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
2017-02-13 23:23:53 +01:00
|
|
|
private gui.orderbook.OrderBook askBook;
|
|
|
|
private javax.swing.JPanel askBookPanel;
|
|
|
|
private gui.orderbook.OrderBook bidBook;
|
|
|
|
private javax.swing.JPanel bidBookPanel;
|
|
|
|
private javax.swing.JLabel jLabel1;
|
|
|
|
private javax.swing.JLabel jLabel2;
|
|
|
|
private gui.orderbook.QuoteVertical quoteVertical2;
|
2017-02-13 18:26:32 +01:00
|
|
|
// End of variables declaration//GEN-END:variables
|
|
|
|
}
|