Browse Source

erster graph panel normale größe ;)

dominik.rieder 8 years ago
parent
commit
9dee493450
2 changed files with 7 additions and 5 deletions
  1. 4 2
      src/ui/view/MyCanvas.java
  2. 3 3
      src/ui/view/splitPane.java

+ 4 - 2
src/ui/view/MyCanvas.java

@@ -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;

+ 3 - 3
src/ui/view/splitPane.java

@@ -365,9 +365,9 @@ public class splitPane extends JSplitPane implements GraphListener {
 							 if(!graphHashtable.containsKey(graphNrTxtField.getText()) && graphNrTxtField.getText().length() > 0){
 								 tmp = new StatisticGraphPanel(controller.getModel(), controller, graphNrTxtField.getText(), 
 										 graphHashtable);
-								 //tmp.setPreferredSize(new Dimension(280,150));
-								 //tmp.setMaximumSize(new Dimension(1000,150));
-								 //tmp.setMinimumSize(new Dimension(100,45));
+								 tmp.setPreferredSize(new Dimension(280,150));
+								 tmp.setMaximumSize(new Dimension(1000,150));
+								 tmp.setMinimumSize(new Dimension(100,45));
 								 tmp.setBorder(new LineBorder(new Color(0, 0, 0), 1));
 								 graphPanel.add(tmp);
 								 graphPanel.add(Box.createRigidArea(new Dimension(50,50)));