Kaynağa Gözat

Fixed width problem

jancoow 10 yıl önce
ebeveyn
işleme
7776251f72

+ 10 - 9
src/gui/frames/MainFrame.java

@@ -4,7 +4,9 @@ import gui.menubar.MenuBar;
 import gui.panels.agenda.AgendaPane;
 import gui.panels.edit.EditPane;
 import gui.panels.table.Table;
+import gui.simulator.SimulatorPane;
 
+import java.awt.BorderLayout;
 import java.awt.Color;
 import java.awt.Window;
 import java.lang.reflect.InvocationTargetException;
@@ -14,7 +16,6 @@ import javax.swing.JFrame;
 import javax.swing.JPanel;
 
 import agenda.Agenda;
-import gui.simulator.SimulatorPane;
 
 @SuppressWarnings("serial")
 public class MainFrame extends JFrame{
@@ -25,13 +26,13 @@ public class MainFrame extends JFrame{
     private JPanel currentPanel;
     
     private int length;
-    private int width;
+    private int terainwidth;
     private SimulatorPane.Terrains terrain;
     
     public MainFrame(){
         this.agenda = new Agenda();
         this.currentPanel = new EditPane(this.agenda);
-        this.add(this.currentPanel);
+        this.add(currentPanel);
 		this.setResizable(true);
 		this.setBounds(100,100,1440,900);
 		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
@@ -40,7 +41,7 @@ public class MainFrame extends JFrame{
 		this.setVisible(true);
 		
 		this.length = 100000;
-		this.width = 100000;
+		this.terainwidth = 10000;
 		this.terrain = SimulatorPane.Terrains.UNDEFINED;
 		
 		this.getContentPane().setBackground( Color.WHITE );
@@ -71,7 +72,7 @@ public class MainFrame extends JFrame{
                 this.updateView(new AgendaPane(this.agenda));
                 break;
             case SIMULATOR:
-                this.updateView(new SimulatorPane(this.agenda, this.length, this.width, this.terrain));
+                this.updateView(new SimulatorPane(this.agenda, this.length, this.terainwidth, this.terrain));
                 break;
             case TABLE:
                 this.updateView(new Table(this.agenda));
@@ -87,12 +88,12 @@ public class MainFrame extends JFrame{
     	this.length = length;
     }
     
-    public void setWidth(int width){
-    	this.width = width;
+    public void setTerainWidth(int width){
+    	this.terainwidth = width;
     }
     
-    public int getWidth(){
-    	return width;
+    public int getTerainWidth(){
+    	return terainwidth;
     }
     
     public int getLength(){

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

@@ -147,7 +147,7 @@ public class SimulatorDialogPane extends JDialog{
 	            	int length = Integer.parseInt(this.length.getText());
 	            	int width = Integer.parseInt(this.width.getText());
 	            	this.mainFrame.setLength(length);
-	            	this.mainFrame.setWidth(width);
+	            	this.mainFrame.setTerainWidth(width);
 	            	this.mainFrame.setTerrain(terrainEnum);
 	            	this.mainFrame.changeView(MainFrame.Views.SIMULATOR);
 	                dispose();