From 9f2215eaf482667262c44b2fb6ffada03e7c7859 Mon Sep 17 00:00:00 2001 From: Harald Wolff Date: Sat, 30 Apr 2016 17:59:44 +0200 Subject: [PATCH] JDiagram Update --- src/org/hwo/ui/JDiagram.java | 1 - src/org/hwo/ui/diagram/Plot.java | 74 -------------------------------- 2 files changed, 75 deletions(-) delete mode 100644 src/org/hwo/ui/diagram/Plot.java diff --git a/src/org/hwo/ui/JDiagram.java b/src/org/hwo/ui/JDiagram.java index 1fdbd45..440b4f1 100644 --- a/src/org/hwo/ui/JDiagram.java +++ b/src/org/hwo/ui/JDiagram.java @@ -10,7 +10,6 @@ import java.awt.Toolkit; import javax.swing.JComponent; import javax.swing.JPanel; -import org.hwo.ui.diagram.Diagram; import org.hwo.ui.diagram.LinePlotPainter; import org.hwo.ui.diagram.LinearScaler; import org.hwo.ui.diagram.PlotLabeler; diff --git a/src/org/hwo/ui/diagram/Plot.java b/src/org/hwo/ui/diagram/Plot.java deleted file mode 100644 index 546ec9b..0000000 --- a/src/org/hwo/ui/diagram/Plot.java +++ /dev/null @@ -1,74 +0,0 @@ -package org.hwo.ui.diagram; - -import java.util.Arrays; - -public class Plot { - - private Diagram diagram; - - private String label; - - private Float[] values; - - protected Plot(Diagram diagram){ - this.diagram = diagram; - this.values = new Float[0]; - } - - public Diagram getDiagram() { - return diagram; - } - - public String getLabel() { - return label; - } - public void setLabel(String label) { - this.label = label; - } - - public Float[] getValues() { - return this.values; - }; - public void setValues(Float[] values) { - this.values = values; - } - - public Float getValue(int index){ - return this.values[index]; - } - public void setValue(int index,Float value){ - this.values[index] = value; - } - - public Float getMin(){ - Float min = Float.MAX_VALUE; - - for (Float f: values) - if (f < min) - min = f; - - return min; - }; - public Float getMax(){ - Float max = Float.MIN_VALUE; - - for (Float f: values) - if (f > max) - max = f; - - return max; - }; - - - - - void resize(int points){ - int l = Math.min(this.values.length,points); - Float[] nv = new Float[points]; - System.arraycopy(this.values, 0, nv, 0, l); - this.values = nv; - } - - - -}