diff --git a/nbproject/project.properties b/nbproject/project.properties index b83b6ef..6bd2513 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -1,4 +1,4 @@ -#Fri, 24 Mar 2017 19:24:17 +0100 +#Sat, 25 Mar 2017 17:41:45 +0100 annotation.processing.enabled=true annotation.processing.enabled.in.editor=false annotation.processing.processors.list= diff --git a/src/chart/Chart.java b/src/chart/Chart.java index 9fd7e8d..a479802 100644 --- a/src/chart/Chart.java +++ b/src/chart/Chart.java @@ -190,9 +190,6 @@ public class Chart extends javax.swing.JPanel implements QuoteReceiver, Scrollab int n; double x; - - - System.out.printf("ClipBounds w: %d\n",clip_bounds.width); long big_tick = 1; @@ -201,17 +198,14 @@ public class Chart extends javax.swing.JPanel implements QuoteReceiver, Scrollab big_tick++; btl=em_size*big_tick*x_unit_width; xxx = 7*em_size; - System.out.printf("NT: %f %f\n", btl,xxx); + }while (btl//GEN-END:initComponents private void formMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_formMousePressed - System.out.printf("Mouse ohlc was pressed\n"); if (!evt.isPopupTrigger()) { return; }; @@ -634,11 +681,9 @@ public class Chart extends javax.swing.JPanel implements QuoteReceiver, Scrollab }//GEN-LAST:event_formMousePressed private void formMouseWheelMoved(java.awt.event.MouseWheelEvent evt) {//GEN-FIRST:event_formMouseWheelMoved - //System.out.printf("Wheel %f\n", evt.getPreciseWheelRotation()); double n = evt.getPreciseWheelRotation() * (-1.0); - //System.out.printf("My n %f\n", n); if (n < 0) { if (this.x_unit_width > 0.3) { this.x_unit_width += 0.1 * n; diff --git a/src/sesim/MinMax.java b/src/sesim/MinMax.java index 07cde62..9519307 100644 --- a/src/sesim/MinMax.java +++ b/src/sesim/MinMax.java @@ -31,23 +31,57 @@ package sesim; */ public class MinMax { - public float min; - public float max; + protected float min; + protected float max; + protected float min_log; + protected float max_log; + + private boolean log; MinMax(float min, float max) { this.min = min; this.max = max; + this.log = false; } public float getDiff() { - return max - min; + return !log ? max - min : max_log - min_log; } public float getMin() { - return min; + return !log ? min : min_log; } + + public float getMin(boolean plog) { + return !plog ? min : min_log; + } + public float getMax() { - return max; + return !log ? max : max_log; } + + public float getMax(boolean plog) { + return !plog ? max : max_log; + } + + + public void setLog(boolean log){ + min_log = (float) Math.log(min); + max_log = (float) Math.log(max); + this.log=log; + } + + public void setMin(float min){ + this.min=min; + } + + public void setMax(float max){ + this.max=max; + } + + public boolean isLog(){ + return log; + } + } diff --git a/test/sesim/Test.java b/test/sesim/Test.java index 6fb7c57..1e5cea9 100644 --- a/test/sesim/Test.java +++ b/test/sesim/Test.java @@ -150,13 +150,14 @@ public class Test { */ public static void main(String[] args) throws InterruptedException, MalformedURLException, InstantiationException, IllegalAccessException, IOException { - Random r; - r = new Random(10); - - for (int i = 0; i < 100; i++) { - int e = r.nextInt(50); - System.out.printf("Zufallszahl: %d\n", e); - } + double val = Math.log(12); + double rval = Math.exp(val); + + + System.out.printf("Result: %f, %f\n", val,rval); + + + } }