From 2a5f9070e3ed01c738abeacd32370f46f5bc4148 Mon Sep 17 00:00:00 2001 From: 7u83 <7u83@maiol.ru> Date: Mon, 27 Mar 2017 01:31:55 +0200 Subject: [PATCH] Added some javadoc --- src/chart/Chart.java | 172 +++++++++++++++------------------------- src/sesim/OHLCData.java | 15 ++++ 2 files changed, 81 insertions(+), 106 deletions(-) diff --git a/src/chart/Chart.java b/src/chart/Chart.java index e4e9ff8..3be1b88 100644 --- a/src/chart/Chart.java +++ b/src/chart/Chart.java @@ -30,11 +30,11 @@ import sesim.Scheduler; */ public class Chart extends javax.swing.JPanel implements QuoteReceiver, Scrollable { - private int em_height; private int em_width; - + protected double x_legend_height = 3; + protected double x_unit_width = 1.0; /** @@ -106,12 +106,11 @@ public class Chart extends javax.swing.JPanel implements QuoteReceiver, Scrollab String cmd = evt.getActionCommand(); for (int i = 0; i < this.ctxMenuCompressionText.length; i++) { if (this.ctxMenuCompressionText[i].equals(cmd)) { - + this.setCompression(this.ctxMenuCompressionValues[i]); } } - } OHLCData data; @@ -168,12 +167,10 @@ public class Chart extends javax.swing.JPanel implements QuoteReceiver, Scrollab */ void drawXLegend(Graphics2D g, XLegendDef xld) { - //g = (Graphics2D) g.create(); - int yw = (int) (this.y_legend_width * this.em_width); - g.setClip(clip_bounds.x, clip_bounds.y, clip_bounds.width - yw, clip_bounds.height); + g.setClip(clip_bounds.x, clip_bounds.y, clip_bounds.width - yw, clip_bounds.height); Dimension dim = getSize(); int y = dim.height - em_height * 3; @@ -182,19 +179,17 @@ public class Chart extends javax.swing.JPanel implements QuoteReceiver, Scrollab int n; double x; - + long big_tick = 1; - double btl,xxx; + double btl, xxx; do { big_tick++; - btl=em_width*big_tick*x_unit_width; - xxx = 7*em_width; + btl = em_width * big_tick * x_unit_width; + xxx = 7 * em_width; + + } while (btl < xxx); - }while (btl= data.size()) {