Supermaniac101 10 жил өмнө
parent
commit
254f95f572

+ 15 - 2
src/gui/frames/MainFrame.java

@@ -39,8 +39,9 @@ public class MainFrame extends JFrame{
 		this.setJMenuBar(new MenuBar(this));
 		this.setVisible(true);
 		
-		this.length = 1000;
-		this.width = 1000;
+		this.length = 100000;
+		this.width = 100000;
+		this.terrain = 100000;
 		
 		this.getContentPane().setBackground( Color.WHITE );
 
@@ -90,6 +91,18 @@ public class MainFrame extends JFrame{
     	this.width = width;
     }
     
+    public int getWidth(){
+    	return width;
+    }
+    
+    public int getLength(){
+    	return length;
+    }
+    
+    public int getTerrain(){
+    	return terrain;
+    }
+    
     private void updateView(JPanel panel){
         this.currentPanel = panel;
         this.setContentPane(this.currentPanel);

+ 7 - 1
src/gui/menubar/MenuBar.java

@@ -148,7 +148,13 @@ public class MenuBar extends JMenuBar{
 			@Override
 			public void actionPerformed(ActionEvent e) {
 				System.out.println("Simulator View");
-				new SimulatorDialogPane(mainFrame);
+				if(mainFrame.getLength() == 100000 ||
+						mainFrame.getWidth() == 100000 ||
+						mainFrame.getTerrain() == 100000){
+					new SimulatorDialogPane(mainFrame);
+				} else {
+					mainFrame.changeView(MainFrame.Views.SIMULATOR);
+				}
 			}
 		});
 

+ 0 - 1
src/gui/panels/edit/EditPane.java

@@ -44,7 +44,6 @@ public class EditPane extends JPanel {
         detailsPanel.add(randomPane, BorderLayout.WEST);
         detailsPanel.add(randomPane, BorderLayout.SOUTH);
         detailsPanel.add(new Label("Details"), BorderLayout.NORTH);
-
         detailsPanel.add(new JTextArea("Test"), BorderLayout.CENTER);
         return detailsPanel;
     }

+ 2 - 2
src/gui/simulator/SimulatorDialogPane.java

@@ -47,8 +47,8 @@ public class SimulatorDialogPane extends JDialog{
 	        
 	        Toolkit toolkit = Toolkit.getDefaultToolkit();
 	        Dimension screenSize = toolkit.getScreenSize();
-	        int x = (screenSize.width - this.getWidth()) / 2;
-	        int y = (screenSize.height - this.getHeight()) / 2;
+	        int x = ((screenSize.width - this.getWidth()) / 2)-100;
+	        int y = ((screenSize.height - this.getHeight()) / 2)-100;
 	        this.setLocation(x, y);
 	        
 	        super.add(main);