|
@@ -90,10 +90,10 @@ public class StatisticGraph extends JPanel {
|
|
g2.setStroke(new BasicStroke(3));
|
|
g2.setStroke(new BasicStroke(3));
|
|
|
|
|
|
// Calculate the Maximum
|
|
// Calculate the Maximum
|
|
- calcMaximum();
|
|
|
|
|
|
+ // calcMaximum();
|
|
|
|
|
|
// Calculate values for each set and add them
|
|
// Calculate values for each set and add them
|
|
- addValues();
|
|
|
|
|
|
+ // addValues();
|
|
|
|
|
|
// Create Paths and draw them
|
|
// Create Paths and draw them
|
|
for (TrackedDataSet set : dataSets) {
|
|
for (TrackedDataSet set : dataSets) {
|
|
@@ -329,7 +329,7 @@ public class StatisticGraph extends JPanel {
|
|
/**
|
|
/**
|
|
* Add the Current Values to each set
|
|
* Add the Current Values to each set
|
|
*/
|
|
*/
|
|
- private void addValues() {
|
|
|
|
|
|
+ public void addValues() {
|
|
for (TrackedDataSet set : dataSets) {
|
|
for (TrackedDataSet set : dataSets) {
|
|
float val = 0;
|
|
float val = 0;
|
|
switch (set.getProperty()) {
|
|
switch (set.getProperty()) {
|
|
@@ -547,8 +547,10 @@ public class StatisticGraph extends JPanel {
|
|
path.lineTo((i + 1) * this.getWidth() / model.getIterations(),
|
|
path.lineTo((i + 1) * this.getWidth() / model.getIterations(),
|
|
convertToCanvasY(set.getValues()[i + 1]));
|
|
convertToCanvasY(set.getValues()[i + 1]));
|
|
} else {
|
|
} else {
|
|
- path.moveTo((i + 2) * this.getWidth() / model.getIterations(),
|
|
|
|
- convertToCanvasY(set.getValues()[i + 2]));
|
|
|
|
|
|
+ if (i + 2 < model.getCurIteration()) {
|
|
|
|
+ path.moveTo((i + 2) * this.getWidth() / model.getIterations(),
|
|
|
|
+ convertToCanvasY(set.getValues()[i + 2]));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -571,8 +573,10 @@ public class StatisticGraph extends JPanel {
|
|
path.lineTo((i + 1) * this.getWidth() / model.getIterations(),
|
|
path.lineTo((i + 1) * this.getWidth() / model.getIterations(),
|
|
convertToCanvasY((float) (set.getValues()[i + 1] * (maximum / 3 * 2)) + (maximum / 6)));
|
|
convertToCanvasY((float) (set.getValues()[i + 1] * (maximum / 3 * 2)) + (maximum / 6)));
|
|
} else {
|
|
} else {
|
|
- path.moveTo((i + 2) * this.getWidth() / model.getIterations(),
|
|
|
|
- convertToCanvasY((float) (set.getValues()[i + 2] * (maximum / 3 * 2)) + (maximum / 6)));
|
|
|
|
|
|
+ if (i + 2 < model.getCurIteration()) {
|
|
|
|
+ path.moveTo((i + 2) * this.getWidth() / model.getIterations(),
|
|
|
|
+ convertToCanvasY((float) (set.getValues()[i + 2] * (maximum / 3 * 2)) + (maximum / 6)));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -593,8 +597,10 @@ public class StatisticGraph extends JPanel {
|
|
path.lineTo((i + 1) * this.getWidth() / model.getIterations(),
|
|
path.lineTo((i + 1) * this.getWidth() / model.getIterations(),
|
|
convertToCanvasY(set.getValues()[i + 1] * maximum));
|
|
convertToCanvasY(set.getValues()[i + 1] * maximum));
|
|
} else {
|
|
} else {
|
|
- path.moveTo((i + 2) * this.getWidth() / model.getIterations(),
|
|
|
|
- convertToCanvasY(set.getValues()[i + 2] * maximum));
|
|
|
|
|
|
+ if (i + 2 < model.getCurIteration()) {
|
|
|
|
+ path.moveTo((i + 2) * this.getWidth() / model.getIterations(),
|
|
|
|
+ convertToCanvasY(set.getValues()[i + 2] * maximum));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|