Some refactoring
This commit is contained in:
parent
5324d61d4c
commit
844bb6e3b4
@ -1,4 +1,4 @@
|
||||
#Tue, 26 Dec 2017 09:36:37 +0100
|
||||
#Tue, 26 Dec 2017 10:12:17 +0100
|
||||
annotation.processing.enabled=true
|
||||
annotation.processing.enabled.in.editor=false
|
||||
annotation.processing.processors.list=
|
||||
|
@ -64,7 +64,7 @@ public class MMChart extends javax.swing.JPanel {
|
||||
JPanel yLegend;
|
||||
JPanel mainChart;
|
||||
|
||||
private final void setupYLegend() {
|
||||
private void setupYLegend() {
|
||||
yLegend = new ChartPanel();
|
||||
Border redborder = javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 0));
|
||||
yLegend.setBorder(redborder);
|
||||
@ -82,7 +82,7 @@ public class MMChart extends javax.swing.JPanel {
|
||||
add(yLegend, gbConstraints);
|
||||
}
|
||||
|
||||
final void setupXLegend() {
|
||||
private void setupXLegend() {
|
||||
xLegend = new ChartPanel();
|
||||
// xLegend.setBackground(Color.blue);
|
||||
|
||||
@ -102,7 +102,9 @@ public class MMChart extends javax.swing.JPanel {
|
||||
add(xLegend, gbConstraints);
|
||||
|
||||
OHLCChartPainter p;
|
||||
OHLCData mydata = Globals.se.getOHLCdata(Globals.se.getDefaultStock(), 60000 * 20);
|
||||
OHLCData mydata = stock.getOHLCdata(60*20);
|
||||
|
||||
|
||||
|
||||
// this.xScrollBar.setMaximum(0);
|
||||
p = new XLegendPainter();
|
||||
@ -111,7 +113,7 @@ public class MMChart extends javax.swing.JPanel {
|
||||
|
||||
}
|
||||
|
||||
final void setupMainChart() {
|
||||
private void setupMainChart() {
|
||||
mainChart = new ChartPanel();
|
||||
mainChart.setBackground(Color.green);
|
||||
|
||||
@ -124,11 +126,14 @@ public class MMChart extends javax.swing.JPanel {
|
||||
gbConstraints.weighty = 1.0;
|
||||
|
||||
add(mainChart, gbConstraints);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
ChartDef chartDef;
|
||||
|
||||
final void setupLayout() {
|
||||
private void setupLayout() {
|
||||
removeAll();
|
||||
|
||||
Border redborder = javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 0));
|
||||
@ -149,36 +154,6 @@ public class MMChart extends javax.swing.JPanel {
|
||||
mainChart = new JPanel();
|
||||
mainChart.setPreferredSize(new Dimension(100, 40));
|
||||
mainChart.setBackground(Color.blue);
|
||||
|
||||
/* p = new JPanel();
|
||||
p.setPreferredSize(new Dimension(100,40));
|
||||
p.setBorder(redborder);
|
||||
p.setBackground(Color.yellow);
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 1;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
|
||||
gridBagConstraints.weightx = 1.0;
|
||||
gridBagConstraints.weighty = 1.0;
|
||||
add(p, gridBagConstraints);
|
||||
|
||||
xLegend = new JPanel();
|
||||
xLegend.setBorder(redborder);
|
||||
xLegend.setBackground(Color.white);
|
||||
xLegend.setPreferredSize(new Dimension(100,0));
|
||||
xLegend.setMinimumSize(new Dimension(100,0));
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 0;
|
||||
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
|
||||
gridBagConstraints.weightx = 0.0;
|
||||
gridBagConstraints.weighty = 0.0;
|
||||
add(xLegend, gridBagConstraints);
|
||||
|
||||
|
||||
*/
|
||||
// p.setLayout(layout);
|
||||
}
|
||||
|
||||
int em_width;
|
||||
|
@ -27,16 +27,13 @@ package chart.painter;
|
||||
|
||||
import sesim.ChartDef;
|
||||
import sesim.ChartPanel;
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Graphics2D;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JScrollBar;
|
||||
import sesim.OHLCData;
|
||||
import sesim.OHLCDataItem;
|
||||
|
||||
/**
|
||||
*
|
||||
* Paints an x-legend for OHLC charts
|
||||
* @author 7u83 <7u83@mail.ru>
|
||||
*/
|
||||
public class XLegendPainter extends OHLCChartPainter {
|
||||
@ -59,13 +56,8 @@ public class XLegendPainter extends OHLCChartPainter {
|
||||
|
||||
init(g);
|
||||
|
||||
// g.setColor(Color.black);
|
||||
Dimension size = p.getSize();
|
||||
|
||||
//int bars = (int) (size.width / (def.x_unit_width * em_size));
|
||||
|
||||
int bars = this.getBars(p, def);
|
||||
|
||||
int first_bar = getFirstBar(p);
|
||||
|
||||
int n;
|
||||
@ -94,7 +86,6 @@ public class XLegendPainter extends OHLCChartPainter {
|
||||
|
||||
@Override
|
||||
void drawItem(Graphics2D g, int prevx, int x, OHLCDataItem prev, OHLCDataItem i) {
|
||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user