|
@@ -19,6 +19,8 @@ import java.awt.Point;
|
|
|
|
|
|
import javax.swing.JPanel;
|
|
import javax.swing.JPanel;
|
|
|
|
|
|
|
|
+import com.sun.org.apache.xerces.internal.util.SynchronizedSymbolTable;
|
|
|
|
+
|
|
import classes.HolonElement;
|
|
import classes.HolonElement;
|
|
import ui.controller.Control;
|
|
import ui.controller.Control;
|
|
import ui.model.Model;
|
|
import ui.model.Model;
|
|
@@ -102,9 +104,6 @@ class UnitGraph extends JPanel implements MouseListener, MouseMotionListener, Co
|
|
|
|
|
|
if (isElement) {
|
|
if (isElement) {
|
|
if (arrayOfFloats != null) {
|
|
if (arrayOfFloats != null) {
|
|
- // array fillen
|
|
|
|
- fillArrayofValue();
|
|
|
|
-
|
|
|
|
// Draw the Lines
|
|
// Draw the Lines
|
|
g2.setStroke(new BasicStroke(2));
|
|
g2.setStroke(new BasicStroke(2));
|
|
g2.setColor(Color.BLACK);
|
|
g2.setColor(Color.BLACK);
|
|
@@ -315,7 +314,7 @@ class UnitGraph extends JPanel implements MouseListener, MouseMotionListener, Co
|
|
&& (tempP.getX() != this.getWidth() / scaleX || tempP != pointList.getLast())) {
|
|
&& (tempP.getX() != this.getWidth() / scaleX || tempP != pointList.getLast())) {
|
|
pointList.remove(tempP);
|
|
pointList.remove(tempP);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
repaint();
|
|
repaint();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -398,6 +397,8 @@ class UnitGraph extends JPanel implements MouseListener, MouseMotionListener, Co
|
|
pointDrag = false;
|
|
pointDrag = false;
|
|
tempP = null;
|
|
tempP = null;
|
|
}
|
|
}
|
|
|
|
+ // array fillen
|
|
|
|
+ fillArrayofValue();
|
|
}
|
|
}
|
|
|
|
|
|
public void componentResized(ComponentEvent e) {
|
|
public void componentResized(ComponentEvent e) {
|
|
@@ -569,14 +570,15 @@ class UnitGraph extends JPanel implements MouseListener, MouseMotionListener, Co
|
|
/**
|
|
/**
|
|
* Fills the Arrays of each HolonElement
|
|
* Fills the Arrays of each HolonElement
|
|
*/
|
|
*/
|
|
|
|
+ @SuppressWarnings("unchecked")
|
|
public void fillArrayofValue() {
|
|
public void fillArrayofValue() {
|
|
for (HolonElement he : tempElements) {
|
|
for (HolonElement he : tempElements) {
|
|
MAXIMUM = he.getEnergy();
|
|
MAXIMUM = he.getEnergy();
|
|
- arrayOfFloats = he.getEnergyAt();
|
|
|
|
- he.setGraphPoints(pointList);
|
|
|
|
|
|
+ he.setGraphPoints((LinkedList<Point>) pointList.clone());
|
|
for (int i = 0; i < arrayOfFloats.length; i++) {
|
|
for (int i = 0; i < arrayOfFloats.length; i++) {
|
|
- arrayOfFloats[i] = convertToValueY(getYValueAt_2((int) (i * width / (model.getIterations() - 1))));
|
|
|
|
|
|
+ he.getEnergyAt()[i] = convertToValueY(getYValueAt_2((int) (i * width / (model.getIterations() - 1))));
|
|
}
|
|
}
|
|
|
|
+ arrayOfFloats = he.getEnergyAt();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|