|
@@ -57,6 +57,8 @@ public class MyCanvas extends JPanel implements MouseListener, MouseMotionListen
|
|
|
private int cx, cy;
|
|
|
private int sx, sy; // Mark Coords
|
|
|
private float scalediv20;
|
|
|
+ private Position unPos;
|
|
|
+ private ArrayList<Position> savePos;
|
|
|
|
|
|
ArrayList<HolonElement> dataSelected = new ArrayList<HolonElement>();
|
|
|
ArrayList<AbstractCpsObject> tempSelected = new ArrayList<AbstractCpsObject>();
|
|
@@ -137,7 +139,7 @@ public class MyCanvas extends JPanel implements MouseListener, MouseMotionListen
|
|
|
@Override
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
// calculate uppernode pos (taken from the controller)
|
|
|
- Position unPos = new Position(0, 0);
|
|
|
+ unPos = new Position(0, 0);
|
|
|
|
|
|
for (AbstractCpsObject abs : model.getSelectedCpsObjects()) {
|
|
|
unPos.x += abs.getPosition().x;
|
|
@@ -147,7 +149,7 @@ public class MyCanvas extends JPanel implements MouseListener, MouseMotionListen
|
|
|
unPos.y /= model.getSelectedCpsObjects().size();
|
|
|
|
|
|
// save old Position
|
|
|
- ArrayList<Position> savePos = new ArrayList<>();
|
|
|
+ savePos = new ArrayList<>();
|
|
|
for (int i = 0; i < model.getSelectedCpsObjects().size(); i++) {
|
|
|
savePos.add(new Position(0, 0));
|
|
|
savePos.get(i).x = model.getSelectedCpsObjects().get(i).getPosition().x;
|