Переглянути джерело

Merge branch 'developer' of https://bitbucket.org/gjoosen/festivalplanner into developer

Gilian Joosen 10 роки тому
батько
коміт
d592ab5ce8

+ 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;
     }

+ 7 - 2
src/gui/panels/edit/dialogs/ActDialogPanel.java

@@ -216,15 +216,20 @@ public class ActDialogPanel extends JDialog{
         JPanel panel = new JPanel();
         panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
         panel.add(new JLabel("popularity"));
-
+        panel.setOpaque(false);
         JPanel buttons = new JPanel();
         buttons.setLayout(new BoxLayout(buttons, BoxLayout.X_AXIS));
 
         this.radio1 = new JRadioButton("1");
+        radio1.setBackground(Color.WHITE);
         this.radio2 = new JRadioButton("2");
+        radio2.setBackground(Color.WHITE);
         this.radio3 = new JRadioButton("3");
+        radio3.setBackground(Color.WHITE);
         this.radio4 = new JRadioButton("4");
+        radio4.setBackground(Color.WHITE);
         this.radio5 = new JRadioButton("5");
+        radio5.setBackground(Color.WHITE);
         
         switch(number){
             case 1:
@@ -278,7 +283,7 @@ public class ActDialogPanel extends JDialog{
         JPanel buttonPanel = new JPanel();
         buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.Y_AXIS));
         buttonPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0));
-        
+        buttonPanel.setOpaque(false);
         JLabel addArtists = new JLabel();
         addArtists.setIcon(new ImageIcon(getClass().getResource("/add.png")));
         addArtists.setForeground(new Color(51,51,51));

+ 3 - 3
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);
@@ -93,7 +93,7 @@ public class SimulatorDialogPane extends JDialog{
 	        name.add(label);
 	        String[] terrainStrings = { "Beach", "Grass", "Urban"};
 	        this.terrain = new JComboBox<String>(terrainStrings);
-	        this.terrain.setSelectedIndex(1);
+	        this.terrain.setSelectedIndex(0);
 	        this.terrain.addActionListener(new ActionListener(){
 	            public void actionPerformed(ActionEvent e) {
 	                JComboBox<String> cb = (JComboBox<String>)e.getSource();