SMA Indicator, tests ...
This commit is contained in:
parent
db42dfd43c
commit
35a6bf4e45
@ -36,6 +36,7 @@
|
||||
<file>file:/home/tube/NetBeansProjects/SeSim/src/sesim/AutoTraderLoader.java</file>
|
||||
<file>file:/home/tube/NetBeansProjects/SeSim/src/traders/ManTrader/ManTrader.java</file>
|
||||
<file>file:/home/tube/NetBeansProjects/SeSim/src/chart/painter/ChartPainter.java</file>
|
||||
<file>file:/home/tube/NetBeansProjects/SeSim/src/sesim/OHLCDataProvider.java</file>
|
||||
<file>file:/home/tube/NetBeansProjects/SeSim/src/traders/RandomTraderB.java</file>
|
||||
<file>file:/home/tube/NetBeansProjects/SeSim/src/sesim/Logger.java</file>
|
||||
<file>file:/home/tube/NetBeansProjects/SeSim/src/gui/EditPreferencesDialog.java</file>
|
||||
|
@ -1,7 +1,6 @@
|
||||
package chart;
|
||||
|
||||
import chart.painter.ChartPainter;
|
||||
import chart.painter.XLegendPainter;
|
||||
import gui.Globals;
|
||||
|
||||
import java.awt.Cursor;
|
||||
@ -16,19 +15,15 @@ import java.awt.event.AdjustmentListener;
|
||||
import java.util.ArrayList;
|
||||
import javax.swing.JScrollBar;
|
||||
|
||||
import sesim.OHLCData;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author 7u83 <7u83@mail.ru>
|
||||
*/
|
||||
public class ChartPanel extends javax.swing.JPanel implements AdjustmentListener {
|
||||
|
||||
public JScrollBar x_scrollbar=null;
|
||||
public JScrollBar x_scrollbar = null;
|
||||
ChartDef chartDef;
|
||||
public boolean mouseEntered=false;
|
||||
|
||||
public boolean mouseEntered = false;
|
||||
|
||||
/**
|
||||
* Creates new form Chart1
|
||||
@ -42,17 +37,20 @@ public class ChartPanel extends javax.swing.JPanel implements AdjustmentListener
|
||||
|
||||
/**
|
||||
* Add a horizontal scrollbar
|
||||
* @param x_scrollbar
|
||||
*
|
||||
* @param x_scrollbar
|
||||
*/
|
||||
public void setXSCrollBar(JScrollBar x_scrollbar){
|
||||
if (this.x_scrollbar!=null)
|
||||
public void setXSCrollBar(JScrollBar x_scrollbar) {
|
||||
if (this.x_scrollbar != null) {
|
||||
this.x_scrollbar.removeAdjustmentListener(this);
|
||||
this.x_scrollbar=x_scrollbar;
|
||||
if (this.x_scrollbar!=null)
|
||||
}
|
||||
this.x_scrollbar = x_scrollbar;
|
||||
if (this.x_scrollbar != null) {
|
||||
this.x_scrollbar.addAdjustmentListener(this);
|
||||
}
|
||||
}
|
||||
|
||||
public void setChartDef(ChartDef def){
|
||||
|
||||
public void setChartDef(ChartDef def) {
|
||||
chartDef = def;
|
||||
}
|
||||
|
||||
@ -65,17 +63,15 @@ public class ChartPanel extends javax.swing.JPanel implements AdjustmentListener
|
||||
public void addChartPainter(ChartPainter p) {
|
||||
chartPainters.add(p);
|
||||
}
|
||||
|
||||
public void deleteAllChartPinters(){
|
||||
|
||||
public void deleteAllChartPinters() {
|
||||
chartPainters = new ArrayList<>();
|
||||
}
|
||||
|
||||
public boolean delChartPainter(ChartPainter p){
|
||||
|
||||
public boolean delChartPainter(ChartPainter p) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// OHLCData data;
|
||||
|
||||
@Override
|
||||
protected void paintComponent(Graphics g) {
|
||||
super.paintComponent(g);
|
||||
@ -84,14 +80,6 @@ public class ChartPanel extends javax.swing.JPanel implements AdjustmentListener
|
||||
return;
|
||||
}
|
||||
|
||||
//this.x_scrollbar.setMaximum(994000);
|
||||
// XLegendPainter p = new XLegendPainter();
|
||||
//data = Globals.se.getOHLCdata(60000 * 60);
|
||||
|
||||
// ChartDef def = new ChartDef();
|
||||
// def.x_unit_width = 1.0;
|
||||
// def.x_scrollbar = x_scrollbar;
|
||||
|
||||
for (ChartPainter painter : chartPainters) {
|
||||
painter.drawChart((Graphics2D) g, this, chartDef);
|
||||
}
|
||||
@ -144,12 +132,12 @@ public class ChartPanel extends javax.swing.JPanel implements AdjustmentListener
|
||||
}//GEN-LAST:event_formMouseMoved
|
||||
|
||||
private void formMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_formMouseEntered
|
||||
this.mouseEntered=true;
|
||||
|
||||
this.mouseEntered = true;
|
||||
|
||||
}//GEN-LAST:event_formMouseEntered
|
||||
|
||||
private void formMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_formMouseExited
|
||||
this.mouseEntered=false;
|
||||
this.mouseEntered = false;
|
||||
}//GEN-LAST:event_formMouseExited
|
||||
|
||||
@Override
|
||||
@ -158,7 +146,6 @@ public class ChartPanel extends javax.swing.JPanel implements AdjustmentListener
|
||||
this.repaint();
|
||||
}
|
||||
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
// End of variables declaration//GEN-END:variables
|
||||
}
|
||||
|
@ -249,26 +249,10 @@ public class MasterChart extends javax.swing.JPanel implements QuoteReceiver {
|
||||
|
||||
@Override
|
||||
public void UpdateQuote(Quote q) {
|
||||
// OHLCData data = this.get();
|
||||
int s = data.size();
|
||||
this.xScrollBar.setMaximum(s);
|
||||
repaint();
|
||||
}
|
||||
|
||||
OHLCData mydata = null;
|
||||
|
||||
/*
|
||||
public OHLCData get() {
|
||||
OHLCData re = Globals.se.getOHLCdata(60000 * 10);
|
||||
if (re != mydata) {
|
||||
System.out.printf("re != a\n");
|
||||
}
|
||||
|
||||
if (mydata == null) {
|
||||
mydata = Globals.se.getOHLCdata(60000 * 10);
|
||||
}
|
||||
return mydata;
|
||||
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user