Gilian Joosen 10 éve
szülő
commit
30d1eadcf8
100 módosított fájl, 1157 hozzáadás és 269 törlés
  1. 2 0
      .classpath
  2. 1 0
      .gitignore
  3. BIN
      bin/agenda/Act.class
  4. BIN
      bin/agenda/ActTime.class
  5. BIN
      bin/agenda/Agenda.class
  6. BIN
      bin/agenda/Artist.class
  7. BIN
      bin/agenda/Io.class
  8. BIN
      bin/agenda/Stage.class
  9. BIN
      bin/agenda/Time.class
  10. BIN
      bin/gui/frames/MainFrame$Views.class
  11. BIN
      bin/gui/frames/MainFrame.class
  12. BIN
      bin/gui/main/Main.class
  13. BIN
      bin/gui/menubar/MenuBar$1.class
  14. BIN
      bin/gui/menubar/MenuBar$10.class
  15. BIN
      bin/gui/menubar/MenuBar$11.class
  16. BIN
      bin/gui/menubar/MenuBar$2.class
  17. BIN
      bin/gui/menubar/MenuBar$3.class
  18. BIN
      bin/gui/menubar/MenuBar$4.class
  19. BIN
      bin/gui/menubar/MenuBar$5.class
  20. BIN
      bin/gui/menubar/MenuBar$6.class
  21. BIN
      bin/gui/menubar/MenuBar$7.class
  22. BIN
      bin/gui/menubar/MenuBar$8.class
  23. BIN
      bin/gui/menubar/MenuBar$9.class
  24. BIN
      bin/gui/menubar/MenuBar.class
  25. BIN
      bin/gui/panels/agenda/AgendaItemShape.class
  26. BIN
      bin/gui/panels/agenda/AgendaPane$1.class
  27. BIN
      bin/gui/panels/agenda/AgendaPane$2.class
  28. BIN
      bin/gui/panels/agenda/AgendaPane.class
  29. BIN
      bin/gui/panels/agenda/AgendaScrollPane$1.class
  30. BIN
      bin/gui/panels/agenda/AgendaScrollPane$2.class
  31. BIN
      bin/gui/panels/agenda/AgendaScrollPane.class
  32. BIN
      bin/gui/panels/agenda/DaySelectorPane.class
  33. BIN
      bin/gui/panels/agenda/InfoField.class
  34. BIN
      bin/gui/panels/agenda/InfoPane.class
  35. BIN
      bin/gui/panels/edit/ActCellRenderer.class
  36. BIN
      bin/gui/panels/edit/ActsPane$1.class
  37. BIN
      bin/gui/panels/edit/ActsPane$2.class
  38. BIN
      bin/gui/panels/edit/ActsPane.class
  39. BIN
      bin/gui/panels/edit/ArtistCellRenderer.class
  40. BIN
      bin/gui/panels/edit/ArtistPane$1.class
  41. BIN
      bin/gui/panels/edit/ArtistPane$2.class
  42. BIN
      bin/gui/panels/edit/ArtistPane.class
  43. BIN
      bin/gui/panels/edit/DoubleClickAct.class
  44. BIN
      bin/gui/panels/edit/DoubleClickArtist.class
  45. BIN
      bin/gui/panels/edit/DoubleClickStage.class
  46. BIN
      bin/gui/panels/edit/EditPane.class
  47. BIN
      bin/gui/panels/edit/StageCellRenderer.class
  48. BIN
      bin/gui/panels/edit/StagesPane$1.class
  49. BIN
      bin/gui/panels/edit/StagesPane$2.class
  50. BIN
      bin/gui/panels/edit/StagesPane.class
  51. BIN
      bin/gui/panels/edit/dialogs/ActDialogPanel.class
  52. BIN
      bin/gui/panels/edit/dialogs/ArtistCellRenderer.class
  53. BIN
      bin/gui/panels/edit/dialogs/ArtistDialogPanel$1.class
  54. BIN
      bin/gui/panels/edit/dialogs/ArtistDialogPanel$2.class
  55. BIN
      bin/gui/panels/edit/dialogs/ArtistDialogPanel.class
  56. BIN
      bin/gui/panels/edit/dialogs/StageDialogPanel$1.class
  57. BIN
      bin/gui/panels/edit/dialogs/StageDialogPanel$2.class
  58. BIN
      bin/gui/panels/edit/dialogs/StageDialogPanel$3.class
  59. BIN
      bin/gui/panels/edit/dialogs/StageDialogPanel.class
  60. BIN
      bin/gui/panels/table/Table.class
  61. BIN
      bin/gui/panels/table/TableModel.class
  62. BIN
      mysql-connector-java-5.1.32-bin.jar
  63. BIN
      res/grass.jpg
  64. BIN
      res/ground_stone.jpg
  65. BIN
      res/sand.jpg
  66. BIN
      res/simulator/ingang.png
  67. BIN
      res/simulator/tent.png
  68. BIN
      res/simulator/toilet.png
  69. BIN
      res/simulator/uitgang.png
  70. BIN
      res/street.jpg
  71. BIN
      res/street2.jpg
  72. BIN
      res/visitor.png
  73. 22 5
      src/agenda/Act.java
  74. 50 3
      src/agenda/ActTime.java
  75. 5 4
      src/agenda/Agenda.java
  76. 3 1
      src/agenda/Artist.java
  77. 65 0
      src/agenda/Database.java
  78. 22 34
      src/agenda/Io.java
  79. 12 1
      src/agenda/Stage.java
  80. 3 1
      src/agenda/Time.java
  81. 55 5
      src/gui/frames/MainFrame.java
  82. 173 115
      src/gui/menubar/MenuBar.java
  83. 1 2
      src/gui/panels/agenda/AgendaPane.java
  84. 2 0
      src/gui/panels/agenda/AgendaScrollPane.java
  85. 86 0
      src/gui/panels/agenda/CalendarPane.java
  86. 2 0
      src/gui/panels/agenda/DaySelectorPane.java
  87. 2 0
      src/gui/panels/agenda/InfoField.java
  88. 2 0
      src/gui/panels/agenda/InfoPane.java
  89. 14 7
      src/gui/panels/edit/ActsPane.java
  90. 14 7
      src/gui/panels/edit/ArtistPane.java
  91. 13 6
      src/gui/panels/edit/EditPane.java
  92. 14 6
      src/gui/panels/edit/StagesPane.java
  93. 228 52
      src/gui/panels/edit/dialogs/ActDialogPanel.java
  94. 30 11
      src/gui/panels/edit/dialogs/ArtistDialogPanel.java
  95. 23 9
      src/gui/panels/edit/dialogs/StageDialogPanel.java
  96. 56 0
      src/gui/simulator/AccessPoint.java
  97. 110 0
      src/gui/simulator/DrawEngine.java
  98. 52 0
      src/gui/simulator/ExitPoint.java
  99. 5 0
      src/gui/simulator/MarkedArea.java
  100. 90 0
      src/gui/simulator/Sidebar.java

+ 2 - 0
.classpath

@@ -1,6 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
 	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="src" path="res"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+	<classpathentry kind="lib" path="mysql-connector-java-5.1.32-bin.jar"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>

+ 1 - 0
.gitignore

@@ -0,0 +1 @@
+/bin/

BIN
bin/agenda/Act.class


BIN
bin/agenda/ActTime.class


BIN
bin/agenda/Agenda.class


BIN
bin/agenda/Artist.class


BIN
bin/agenda/Io.class


BIN
bin/agenda/Stage.class


BIN
bin/agenda/Time.class


BIN
bin/gui/frames/MainFrame$Views.class


BIN
bin/gui/frames/MainFrame.class


BIN
bin/gui/main/Main.class


BIN
bin/gui/menubar/MenuBar$1.class


BIN
bin/gui/menubar/MenuBar$10.class


BIN
bin/gui/menubar/MenuBar$11.class


BIN
bin/gui/menubar/MenuBar$2.class


BIN
bin/gui/menubar/MenuBar$3.class


BIN
bin/gui/menubar/MenuBar$4.class


BIN
bin/gui/menubar/MenuBar$5.class


BIN
bin/gui/menubar/MenuBar$6.class


BIN
bin/gui/menubar/MenuBar$7.class


BIN
bin/gui/menubar/MenuBar$8.class


BIN
bin/gui/menubar/MenuBar$9.class


BIN
bin/gui/menubar/MenuBar.class


BIN
bin/gui/panels/agenda/AgendaItemShape.class


BIN
bin/gui/panels/agenda/AgendaPane$1.class


BIN
bin/gui/panels/agenda/AgendaPane$2.class


BIN
bin/gui/panels/agenda/AgendaPane.class


BIN
bin/gui/panels/agenda/AgendaScrollPane$1.class


BIN
bin/gui/panels/agenda/AgendaScrollPane$2.class


BIN
bin/gui/panels/agenda/AgendaScrollPane.class


BIN
bin/gui/panels/agenda/DaySelectorPane.class


BIN
bin/gui/panels/agenda/InfoField.class


BIN
bin/gui/panels/agenda/InfoPane.class


BIN
bin/gui/panels/edit/ActCellRenderer.class


BIN
bin/gui/panels/edit/ActsPane$1.class


BIN
bin/gui/panels/edit/ActsPane$2.class


BIN
bin/gui/panels/edit/ActsPane.class


BIN
bin/gui/panels/edit/ArtistCellRenderer.class


BIN
bin/gui/panels/edit/ArtistPane$1.class


BIN
bin/gui/panels/edit/ArtistPane$2.class


BIN
bin/gui/panels/edit/ArtistPane.class


BIN
bin/gui/panels/edit/DoubleClickAct.class


BIN
bin/gui/panels/edit/DoubleClickArtist.class


BIN
bin/gui/panels/edit/DoubleClickStage.class


BIN
bin/gui/panels/edit/EditPane.class


BIN
bin/gui/panels/edit/StageCellRenderer.class


BIN
bin/gui/panels/edit/StagesPane$1.class


BIN
bin/gui/panels/edit/StagesPane$2.class


BIN
bin/gui/panels/edit/StagesPane.class


BIN
bin/gui/panels/edit/dialogs/ActDialogPanel.class


BIN
bin/gui/panels/edit/dialogs/ArtistCellRenderer.class


BIN
bin/gui/panels/edit/dialogs/ArtistDialogPanel$1.class


BIN
bin/gui/panels/edit/dialogs/ArtistDialogPanel$2.class


BIN
bin/gui/panels/edit/dialogs/ArtistDialogPanel.class


BIN
bin/gui/panels/edit/dialogs/StageDialogPanel$1.class


BIN
bin/gui/panels/edit/dialogs/StageDialogPanel$2.class


BIN
bin/gui/panels/edit/dialogs/StageDialogPanel$3.class


BIN
bin/gui/panels/edit/dialogs/StageDialogPanel.class


BIN
bin/gui/panels/table/Table.class


BIN
bin/gui/panels/table/TableModel.class


BIN
mysql-connector-java-5.1.32-bin.jar


BIN
res/grass.jpg


BIN
res/ground_stone.jpg


BIN
res/sand.jpg


BIN
res/simulator/ingang.png


BIN
res/simulator/tent.png


BIN
res/simulator/toilet.png


BIN
res/simulator/uitgang.png


BIN
res/street.jpg


BIN
res/street2.jpg


BIN
res/visitor.png


+ 22 - 5
src/agenda/Act.java

@@ -1,23 +1,26 @@
 package agenda;
 
+import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.List;
 
 /**
  * Created by gjoosen on 06/02/15.
  */
-public class Act {
+public class Act implements Serializable  {
     
     private List<Artist> artists;
     private Stage stage;
     private String genre, name;
     private ActTime actTime;
-
-    public Act(String name, Stage stage, String genre, ActTime actTime, Artist... artists){
+    private int popularity;
+    
+    public Act(String name, Stage stage, String genre, ActTime actTime, int popularity, Artist... artists){
         this.name = name;
         this.stage = stage; 
         this.genre = genre;
         this.actTime = actTime;
+        this.popularity = popularity;
 
         this.artists = new ArrayList<Artist>();
         for(Artist artist: artists) {
@@ -44,7 +47,10 @@ public class Act {
     public void setStage(Stage stage) {
 		this.stage = stage;
 	}
-
+    public void setTime(ActTime actTime){
+        this.actTime = actTime;
+    }
+    
     /**
      * * returns the genre of the act.
      * @return the genre of the act.
@@ -80,7 +86,6 @@ public class Act {
         string+= "Stage: \n" + this.stage.getName() + "<br/>";
         string+= this.actTime;
         string+= "</html>";
-        System.out.println("test");
         return string;
     }
 
@@ -98,4 +103,16 @@ public class Act {
             this.artists.add(artist);
         }
     }
+
+    public int getPopularity() {
+        return popularity;
+    }
+
+    public void setPopularity(int popularity) {
+        this.popularity = popularity;
+    }
+
+    public void setActTime(ActTime actTime) {
+        this.actTime = actTime;
+    }
 }

+ 50 - 3
src/agenda/ActTime.java

@@ -1,15 +1,16 @@
 package agenda;
 
+import java.io.Serializable;
 import java.util.Calendar;
 import java.util.GregorianCalendar;
 
 /**
  * Created by gjoosen on 06/02/15.
  */
-public class ActTime {
+public class ActTime implements Serializable {
     
 	private GregorianCalendar beginTime, endTime;
-    
+
     public ActTime(int y1, int m1, int d1, int hh1, int mm1, int y2, int m2, int d2, int hh2, int mm2){
     	beginTime = new GregorianCalendar();
     	endTime = new GregorianCalendar();
@@ -18,9 +19,26 @@ public class ActTime {
     }
     
     public ActTime(String beginTime, String endTime){
+        this.beginTime = new GregorianCalendar();
+        String[] timeParts = beginTime.split("-");
+        int y1 = Integer.valueOf(timeParts[0]);
+        int m1 = Integer.valueOf(timeParts[1]);
+        int d1 = Integer.valueOf(timeParts[2]);
+        int hh1 = Integer.valueOf(timeParts[3]);
+        int mm1 = Integer.valueOf(timeParts[4]);
+        
+        this.endTime = new GregorianCalendar();
+        String[] timeParts2 = endTime.split("-");
+        int y2 = Integer.valueOf(timeParts2[0]);
+        int m2 = Integer.valueOf(timeParts2[1]);
+        int d2 = Integer.valueOf(timeParts2[2]);
+        int hh2 = Integer.valueOf(timeParts2[3]);
+        int mm2 = Integer.valueOf(timeParts2[4]);
 
+        this.setBeginTime(y1, m1, d1, hh1, mm1);
+        this.setEndTime(y2, m2, d2, hh2, mm2);
     }
-
+    
     public void setBeginTime(int y, int m, int d, int hh, int mm){
     	beginTime.set(y,m-1,d,hh,mm);
     }
@@ -43,6 +61,21 @@ public class ActTime {
     			beginTime.get(Calendar.HOUR_OF_DAY) + ":" +
     			minutes;
     }
+
+    public String getBeginTimeStringField(){
+        String minutes = "";
+        if(beginTime.get(Calendar.MINUTE)>=0 && beginTime.get(Calendar.MINUTE)<10){
+            minutes = "0"+beginTime.get(Calendar.MINUTE);
+        } else {
+            minutes = ""+beginTime.get(Calendar.MINUTE);
+        }
+
+        return 	beginTime.get(Calendar.YEAR) + "-" +
+                (beginTime.get(Calendar.MONTH)+1) + "-" +
+                beginTime.get(Calendar.DATE) + "-" +
+                beginTime.get(Calendar.HOUR_OF_DAY) + "-" +
+                minutes;
+    }
     
     public String getEndTimeString(){
     	String minutes = "";
@@ -57,6 +90,20 @@ public class ActTime {
     			endTime.get(Calendar.HOUR_OF_DAY) + ":" +
     			minutes;
     }
+
+    public String getEndTimeStringField(){
+        String minutes = "";
+        if(endTime.get(Calendar.MINUTE)>=0 && endTime.get(Calendar.MINUTE)<10){
+            minutes = "0"+endTime.get(Calendar.MINUTE);
+        } else {
+            minutes = ""+endTime.get(Calendar.MINUTE);
+        }
+        return 	endTime.get(Calendar.YEAR) + "-" +
+                (endTime.get(Calendar.MONTH)+1) + "-" +
+                endTime.get(Calendar.DATE) + "-" +
+                endTime.get(Calendar.HOUR_OF_DAY) + "-" +
+                minutes;
+    }
     
     public GregorianCalendar getBeginTime() {
 		return beginTime;

+ 5 - 4
src/agenda/Agenda.java

@@ -1,12 +1,13 @@
 package agenda;
 
+import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.List;
 
 /**
  * Created by gjoosen on 06/02/15.
  */
-public class Agenda {
+public class Agenda implements Serializable {
     
     private List<Stage> stages;
     private List<Artist> artists;
@@ -31,9 +32,9 @@ public class Agenda {
         this.artists.add(new Artist("Sabaton", "Power metal"));
 
         //acts
-        this.acts.add(new Act(this.artists.get(0).getName(), this.stages.get(0), "Heavy metal", new ActTime(2015,02,11,21,00  ,2015,02,11,23,00), this.artists.get(0)));
-        this.acts.add(new Act(this.artists.get(1).getName(), this.stages.get(1), "Test metal" , new ActTime(2015,02,11,23,00  ,2015,02,12,04,30), this.artists.get(1)));
-        this.acts.add(new Act(this.artists.get(2).getName(), this.stages.get(0), "Power metal" ,new ActTime(2015,02,11,20,00  ,2015,02,11,23,00), this.artists.get(2)));
+//        this.acts.add(new Act(this.artists.get(0).getName(), this.stages.get(0), "Heavy metal", new ActTime(2015,02,11,21,00  ,2015,02,11,23,00), this.artists.get(0)));
+//        this.acts.add(new Act(this.artists.get(1).getName(), this.stages.get(1), "Test metal" , new ActTime(2015,02,11,23,00  ,2015,02,12,04,30), this.artists.get(1)));
+//        this.acts.add(new Act(this.artists.get(2).getName(), this.stages.get(0), "Power metal" ,new ActTime(2015,02,11,20,00  ,2015,02,11,23,00), this.artists.get(2)));
         
         System.out.println(this);
     }

+ 3 - 1
src/agenda/Artist.java

@@ -1,9 +1,11 @@
 package agenda;
 
+import java.io.Serializable;
+
 /**
  * Created by gjoosen on 06/02/15.
  */
-public class Artist {
+public class Artist implements Serializable {
     
     private String name, genre;
     

+ 65 - 0
src/agenda/Database.java

@@ -0,0 +1,65 @@
+package agenda;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.util.ArrayList;
+
+public class Database {
+  private Connection connect = null;
+  private PreparedStatement preparedStatement = null;
+  
+  //database values
+  private String host = "jdbc:mysql://jancokock.me:3306/festivalagenda";
+  private String user = "projectgroepa6";
+  private String pass = "tzHnYRbpt7r3z4jt";
+  
+  //get agenda values
+  private Agenda agenda = new Agenda();
+  private ArrayList<Act> acts = (ArrayList<Act>) agenda.getActs();
+  
+
+  public void writeDatabase() throws Exception {
+    try {
+      Class.forName("com.mysql.jdbc.Driver");
+      connect = DriverManager.getConnection(host,user,pass);
+
+      //first check if agenda already exists in DB, otherwise delete everything
+       
+	//insert stage names
+      for(Act act : acts){
+    	  String name = act.getName();
+    	  String genre = act.getGenre();
+    	  String beginTime = act.getActTime().getBeginTimeString();
+    	  String endTime = act.getActTime().getEndTimeString();
+    	  int popularity = act.getPopularity();
+    	    
+    	  System.out.println(name);
+    	  System.out.println(genre);
+    	  System.out.println(beginTime);
+    	  System.out.println(endTime);
+    	  System.out.println(popularity);
+    	  //insert data into database
+    	  preparedStatement = connect.prepareStatement("insert into  festivalagenda.Act (agenda_view_id, begintijd, eindtijd, naam, genre, populariteit) values (0, ?, ?, ?, ?, ?)");
+    	  preparedStatement.setString(1, beginTime);
+    	  preparedStatement.setString(2, endTime);
+          preparedStatement.setString(3, name);
+          preparedStatement.setString(4, genre);
+          preparedStatement.setInt(5, popularity);
+          preparedStatement.executeUpdate();
+      }
+            
+    } catch (Exception e) {
+      throw e;
+    } finally {
+    	if (preparedStatement != null) {
+            preparedStatement.close();
+          }
+
+          if (connect != null) {
+            connect.close();
+          }
+    }
+
+  }
+} 

+ 22 - 34
src/agenda/Io.java

@@ -10,69 +10,57 @@ import javax.swing.JFileChooser;
 
 
 public class Io {
-	
-	public static void main(String [] args) throws IOException{
-		Io io = new Io();
-	}
-	
-	public Io() throws IOException
-	{
-		writeIo();
-	}
-	
-	public void writeIo() throws IOException
+
+	public static void writeIo(Agenda agenda) throws IOException
 	{
 		JFileChooser fileChooser = new JFileChooser();
 		if(fileChooser.showSaveDialog(null)
 				== fileChooser.APPROVE_OPTION) {
 			java.io.File file = fileChooser.getSelectedFile();
-		
-		ObjectOutputStream output = null;
-		try{
-			output = new ObjectOutputStream(new FileOutputStream(file));
-		}catch(IOException e){ 
-			System.out.println("Could not open file." + e);
-			System.exit(0);
-		}
-		try{
-			output.writeObject(new Agenda());
 
-			output.close();
-		}catch(IOException e){
-			System.out.println("Writing error.  " + e);
-			System.exit(0); 
-		}
+			ObjectOutputStream output = null;
+			try{
+				output = new ObjectOutputStream(new FileOutputStream(file));
+			}catch(IOException e){ 
+				System.out.println("Could not open file." + e);
+			}
+			try{
+				output.writeObject(agenda);
+				output.close();
+			}catch(IOException e){
+				System.out.println("Writing error.  " + e);
+			}
 		}
 
 	}
 
-	public void readIo() throws IOException
+	public static Agenda readIo() throws IOException
 	{
 		JFileChooser fileChooser = new JFileChooser();
 		if(fileChooser.showOpenDialog(null)
 				== fileChooser.APPROVE_OPTION) {
 			java.io.File file = fileChooser.getSelectedFile();
-			
+
 			ObjectInputStream input = null;
-			
+
 			try{
 				input = new ObjectInputStream(new FileInputStream(file));
 			}catch(IOException e){
 				System.out.println("There was a problem opening the file. " + e);
-				System.exit(0);
 
 			}
 			Agenda agenda = null;
 			try{
 				agenda = (Agenda)input.readObject();
 				input.close();
+				return agenda;
 			}catch(Exception e){
 				System.out.println("There was a issue reading this file: " + e);
-				System.exit(0);
 			}
-			System.out.println("agenda's stuff is : " + agenda.getActs());
-	}
-			
+		}
+		return null;
+
+
 	}
 }
 

+ 12 - 1
src/agenda/Stage.java

@@ -1,11 +1,14 @@
 package agenda;
 
+import java.io.Serializable;
+
 /**
  * Created by gjoosen on 06/02/15.
  */
-public class Stage {
+public class Stage implements Serializable {
     
     private String name;
+    private boolean inUse = false;
     
     public Stage(String name){
         this.name = name;
@@ -23,4 +26,12 @@ public class Stage {
     public void setName(String name) {
         this.name = name;
     }
+
+    public boolean inUse() {
+        return inUse;
+    }
+
+    public void setInUse(boolean inUse) {
+        this.inUse = inUse;
+    }
 }

+ 3 - 1
src/agenda/Time.java

@@ -1,9 +1,11 @@
 package agenda;
 
+import java.io.Serializable;
+
 /**
  * Created by gjoosen on 07/02/15.
  */
-public class Time {
+public class Time implements Serializable {
     
     private int hours, minutes;
     

+ 55 - 5
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;
@@ -21,19 +23,28 @@ public class MainFrame extends JFrame{
     public enum Views{EDITOR, SIMULATOR, AGENDA, TABLE};
     
     private Agenda agenda;
-    private JPanel currentPanel;
+    private JPanel currentPanel, simulatorpanel;
+    
+    private int length;
+    private int terainwidth;
+    private SimulatorPane.Terrains terrain;
     
     public MainFrame(){
         this.agenda = new Agenda();
-        this.currentPanel = new Table(this.agenda);
-        this.add(this.currentPanel);
+        this.currentPanel = new EditPane(this.agenda);
+        this.add(currentPanel);
 		this.setResizable(true);
 		this.setBounds(100,100,1440,900);
 		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
 		this.setUndecorated(false);
 		this.setJMenuBar(new MenuBar(this));
 		this.setVisible(true);
-		this.setBackground(new Color(242,241,237));
+		
+		this.length = 100000;
+		this.terainwidth = 10000;
+		this.terrain = SimulatorPane.Terrains.UNDEFINED;
+		
+		this.getContentPane().setBackground( Color.WHITE );
 
         if(System.getProperties().getProperty("os.name").equals("Mac OS X")) {
             try {
@@ -61,7 +72,12 @@ public class MainFrame extends JFrame{
                 this.updateView(new AgendaPane(this.agenda));
                 break;
             case SIMULATOR:
-                //komt later nog.
+            	if(simulatorpanel == null){
+            		simulatorpanel = new SimulatorPane(this.agenda, this.length, this.terainwidth, this.terrain);
+            		this.updateView(simulatorpanel);
+            	}else{
+            		this.updateView(simulatorpanel);
+            	}
                 break;
             case TABLE:
                 this.updateView(new Table(this.agenda));
@@ -69,9 +85,43 @@ public class MainFrame extends JFrame{
         }
     }
     
+    public void setTerrain(SimulatorPane.Terrains terrain){
+    	this.terrain = terrain;
+    }
+
+    public void setLength(int length){
+    	this.length = length;
+    }
+    
+    public void setTerainWidth(int width){
+    	this.terainwidth = width;
+    }
+    
+    public int getTerainWidth(){
+    	return terainwidth;
+    }
+    
+    public int getLength(){
+    	return length;
+    }
+    
+    public SimulatorPane.Terrains getTerrain(){
+    	return terrain;
+    }
+    
     private void updateView(JPanel panel){
         this.currentPanel = panel;
         this.setContentPane(this.currentPanel);
         this.revalidate();
     }
+
+	public Agenda getAgenda() {
+		return agenda;
+	}
+
+	public void setAgenda(Agenda agenda) {
+		this.agenda = agenda;
+		updateView(currentPanel);
+	}
+
 }

+ 173 - 115
src/gui/menubar/MenuBar.java

@@ -1,135 +1,193 @@
 package gui.menubar;
 
 import gui.frames.MainFrame;
-import gui.main.Main;
-import javafx.stage.*;
+import gui.simulator.SimulatorDialogPane;
+import gui.simulator.SimulatorPane;
 
-import java.awt.*;
-import java.awt.Window;
+import java.awt.FlowLayout;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.awt.event.KeyEvent;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
+import java.io.IOException;
 
-import javax.swing.*;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+import javax.swing.KeyStroke;
+
+import agenda.Agenda;
+import agenda.Database;
+import agenda.Io;
 
 @SuppressWarnings("serial")
 public class MenuBar extends JMenuBar{
 
-    private MainFrame mainFrame;
-    
+	private MainFrame mainFrame;
+
 	public MenuBar(MainFrame frame){
-        this.mainFrame = frame;
+		this.mainFrame = frame;
 		initialize();
 	}
-	
+
 	private void initialize(){
 		setLayout(new FlowLayout(80));
 		JMenu fileMenu = new JMenu("File");
-        JMenu editMenu = new JMenu("Edit");
-        JMenu viewMenu = new JMenu("View");
-        JMenu helpMenu = new JMenu("Help");
-        this.add(fileMenu);
-        this.add(editMenu);
-        this.add(viewMenu);
-        this.add(helpMenu);
-        
-        JMenuItem newAction = new JMenuItem("New");
-        JMenuItem openAction = new JMenuItem("Open");
-        JMenuItem exitAction = new JMenuItem("Exit");
-        JMenuItem cutAction = new JMenuItem("Cut");
-        JMenuItem copyAction = new JMenuItem("Copy");
-        JMenuItem pasteAction = new JMenuItem("Paste");
-        
-        //view 
-        JMenuItem editorView = new JMenuItem("Editor");
-        JMenuItem agendaView = new JMenuItem("Agenda");
-        JMenuItem simulatorView = new JMenuItem("Simulator");
-        JMenuItem tableView = new JMenuItem("Table");
-
-        newAction.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, ActionEvent.CTRL_MASK));
-        openAction.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, ActionEvent.CTRL_MASK));
-        exitAction.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q, ActionEvent.CTRL_MASK));
-        cutAction.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.CTRL_MASK));
-        copyAction.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, ActionEvent.CTRL_MASK));
-        pasteAction.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, ActionEvent.CTRL_MASK));
-        
-        fileMenu.add(newAction);
-        newAction.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent arg0) {
-                System.out.println("You have clicked on the new action");
-            }
-        });
-        fileMenu.add(openAction);
-        openAction.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent arg0) {
-                System.out.println("You have clicked on the open action");
-            }
-        });
-        fileMenu.addSeparator();
-        fileMenu.add(exitAction);
-        exitAction.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent arg0) {
-                System.exit(0);
-            }
-        });
-        editMenu.add(cutAction);
-        cutAction.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent arg0) {
-                System.out.println("You have clicked on the cut action");
-            }
-        });
-        editMenu.add(copyAction);
-        copyAction.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent arg0) {
-                System.out.println("You have clicked on the copy action");
-            }
-        });
-        editMenu.add(pasteAction);
-        pasteAction.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent arg0) {
-                System.out.println("You have clicked on the paste action");
-            }
-        });
-        
-        //view
-        viewMenu.add(editorView);
-        editorView.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                System.out.println("Editor View");
-                mainFrame.changeView(MainFrame.Views.EDITOR);
-            }
-        });
-
-        viewMenu.add(simulatorView);
-        simulatorView.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                System.out.println("Simulator View");
-                mainFrame.changeView(MainFrame.Views.SIMULATOR);
-
-            }
-        });
-        
-        viewMenu.add(agendaView);
-        agendaView.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                System.out.println("Agenda View");
-                mainFrame.changeView(MainFrame.Views.AGENDA);
-
-            }
-        });
-
-        viewMenu.add(tableView);
-        tableView.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                mainFrame.changeView(MainFrame.Views.TABLE);
-            }
-        });
+		JMenu editMenu = new JMenu("Edit");
+		JMenu viewMenu = new JMenu("View");
+		JMenu helpMenu = new JMenu("Help");
+		this.add(fileMenu);
+		this.add(editMenu);
+		this.add(viewMenu);
+		this.add(helpMenu);
+
+		JMenuItem newAction = new JMenuItem("New");
+		JMenuItem openAction = new JMenuItem("Open");
+		JMenuItem exitAction = new JMenuItem("Exit");
+		JMenuItem cutAction = new JMenuItem("Cut");
+		JMenuItem copyAction = new JMenuItem("Copy");
+		JMenuItem pasteAction = new JMenuItem("Paste");
+		JMenuItem saveAction = new JMenuItem("Save");
+		JMenuItem helpAction = new JMenuItem("Help");
+		JMenuItem uploadAction = new JMenuItem("Upload agenda to DB");
+		//view 
+		JMenuItem editorView = new JMenuItem("Editor");
+		JMenuItem agendaView = new JMenuItem("Agenda");
+		JMenuItem simulatorView = new JMenuItem("Simulator");
+		JMenuItem tableView = new JMenuItem("Table");
+
+		newAction.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, ActionEvent.CTRL_MASK));
+		openAction.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, ActionEvent.CTRL_MASK));
+		exitAction.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q, ActionEvent.CTRL_MASK));
+		cutAction.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.CTRL_MASK));
+		copyAction.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, ActionEvent.CTRL_MASK));
+		pasteAction.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, ActionEvent.CTRL_MASK));
+		saveAction.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S,ActionEvent.CTRL_MASK));
+		uploadAction.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_U,ActionEvent.CTRL_MASK));
+
+		fileMenu.add(newAction);
+		newAction.addActionListener(new ActionListener() {
+			public void actionPerformed(ActionEvent arg0) {
+				System.out.println("You have clicked on the new action");
+			}
+		});
+		fileMenu.add(openAction);
+		openAction.addActionListener(new ActionListener() {
+			public void actionPerformed(ActionEvent arg0) {
+				try {
+					Agenda agenda= Io.readIo();
+					if(agenda != null){
+						mainFrame.setAgenda(agenda);
+						System.out.println("read");
+					}
+				} catch (IOException e) {
+					e.printStackTrace();
+				}
+			}
+		});
+		fileMenu.add(saveAction);
+		saveAction.addActionListener(new ActionListener() {
+			public void actionPerformed(ActionEvent e) {
+				try {
+					Io.writeIo(mainFrame.getAgenda());
+				} catch (IOException e1) {
+					e1.printStackTrace();
+				}
+			}
+		});
+		fileMenu.add(uploadAction);
+		uploadAction.addActionListener(new ActionListener() {
+			public void actionPerformed(ActionEvent arg0) {
+				Database database = new Database();
+				try {
+					database.writeDatabase();
+				} catch (Exception e) {
+					e.printStackTrace();
+					System.out.println("Database error");
+				}
+				System.out.println("You have clicked on the database action");
+			}
+		});
+		fileMenu.addSeparator();
+		fileMenu.add(exitAction);
+		exitAction.addActionListener(new ActionListener() {
+			public void actionPerformed(ActionEvent arg0) {
+				System.exit(0);
+			}
+		});
+		editMenu.add(cutAction);
+		cutAction.addActionListener(new ActionListener() {
+			public void actionPerformed(ActionEvent arg0) {
+				System.out.println("You have clicked on the cut action");
+			}
+		});
+		editMenu.add(copyAction);
+		copyAction.addActionListener(new ActionListener() {
+			public void actionPerformed(ActionEvent arg0) {
+				System.out.println("You have clicked on the copy action");
+			}
+		});
+		editMenu.add(pasteAction);
+		pasteAction.addActionListener(new ActionListener() {
+			public void actionPerformed(ActionEvent arg0) {
+				System.out.println("You have clicked on the paste action");
+			}
+		});
+
+		//view
+		viewMenu.add(editorView);
+		editorView.addActionListener(new ActionListener() {
+			@Override
+			public void actionPerformed(ActionEvent e) {
+				System.out.println("Editor View");
+				mainFrame.changeView(MainFrame.Views.EDITOR);
+			}
+		});
+
+		viewMenu.add(simulatorView);
+		simulatorView.addActionListener(new ActionListener() {
+			@Override
+			public void actionPerformed(ActionEvent e) {
+				System.out.println("Simulator View");
+				if(mainFrame.getLength() == 100000 ||
+						mainFrame.getWidth() == 100000 ||
+						mainFrame.getTerrain() == SimulatorPane.Terrains.UNDEFINED){
+					new SimulatorDialogPane(mainFrame);
+				} else {
+					mainFrame.changeView(MainFrame.Views.SIMULATOR);
+				}
+			}
+		});
+
+		viewMenu.add(agendaView);
+		agendaView.addActionListener(new ActionListener() {
+			@Override
+			public void actionPerformed(ActionEvent e) {
+				System.out.println("Agenda View");
+				mainFrame.changeView(MainFrame.Views.AGENDA);
+
+			}
+		});
+
+		viewMenu.add(tableView);
+		tableView.addActionListener(new ActionListener() {
+			@Override
+			public void actionPerformed(ActionEvent e) {
+				mainFrame.changeView(MainFrame.Views.TABLE);
+			}
+		});
+		helpMenu.add(helpAction);
+		helpAction.addActionListener(new ActionListener() {
+			@Override
+			public void actionPerformed(ActionEvent e) {
+				JOptionPane.showMessageDialog(mainFrame,"Deze applicatie is gemaakt door: "
+						+ "\nJanco, Gillian, Tim, Davey en Jeroen"
+						+ "\n\nIn opdracht voor: "
+						+ "\n Ti Avans Breda"
+						);
+			}
+		});
+
 	}
-	
+
 }

+ 1 - 2
src/gui/panels/agenda/AgendaPane.java

@@ -10,7 +10,6 @@ import java.util.GregorianCalendar;
 
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
-
 import agenda.Agenda;
 
 @SuppressWarnings("serial")
@@ -25,7 +24,7 @@ public class AgendaPane extends JPanel {
 	public AgendaPane(Agenda agenda){
 		this.actName = "Act";
 		this.actInfo = "Act info";
-		
+		this.setOpaque(true);
 		setLayout(new BorderLayout());
 		
 		infopanel = new InfoPane(actName, actInfo);

+ 2 - 0
src/gui/panels/agenda/AgendaScrollPane.java

@@ -32,6 +32,8 @@ public class AgendaScrollPane extends JPanel {
 	
 	
 	public AgendaScrollPane(final Agenda agenda, InfoPane pane){
+		this.setOpaque(true);
+		this.setBackground(Color.WHITE);
 		this.infoPane = pane;
 		this.agenda = agenda;
 		this.setPreferredSize(new Dimension(600, yspacing*48+heightoffset));

+ 86 - 0
src/gui/panels/agenda/CalendarPane.java

@@ -0,0 +1,86 @@
+package gui.panels.agenda;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.GridLayout;
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+
+import javax.swing.JButton;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+
+public class CalendarPane extends JPanel {
+
+	GregorianCalendar cal = new GregorianCalendar();
+	private static String[] MONTHS_NL = new String[] { "Januari", "Febuari",
+			"Maart", "April", "Mei", "Juni", "Juli", "September",
+			"October", "November", "December" };
+
+	public static void main(String[] args) {
+
+		JPanel calendar = new CalendarPane();
+	}
+
+	public CalendarPane() {
+
+		JFrame frame = new JFrame("Test calender");
+		JPanel main = new JPanel();
+		main.setLayout(new BorderLayout());
+		frame.add(main);
+		// buttons & buttons panel
+		JPanel buttons = new JPanel();
+		System.out.println("Maand: " + (cal.get(Calendar.MONTH)+1));
+		JLabel month = new JLabel(MONTHS_NL[cal.get(Calendar.MONTH)]);
+		JButton left = new JButton("Back");
+		JButton right = new JButton("Next");
+		buttons.add(left);
+		buttons.add(month);
+		buttons.add(right);
+		main.add(buttons, BorderLayout.NORTH);
+		this.setOpaque(true);
+		this.setBackground(Color.WHITE);
+		JLabel mon = new JLabel("Ma");
+		JLabel di = new JLabel("Di");
+		JLabel wo = new JLabel("Wo");
+		JLabel don = new JLabel("Do");
+		JLabel vri = new JLabel("Vr");
+		JLabel za = new JLabel("Za");
+		JLabel zo = new JLabel("Zo");
+		JPanel day = new JPanel();
+		day.setLayout(new GridLayout(0, 7));
+		day.add(mon);
+		day.add(di);
+		day.add(wo);
+		day.add(don);
+		day.add(vri);
+		day.add(za);
+		day.add(zo);
+
+		// Calendar pane
+		JPanel days = new JPanel();
+		days.setLayout(new BorderLayout());
+		main.add(days, BorderLayout.CENTER);
+		JPanel calendar = new JPanel();
+		days.add(day, BorderLayout.NORTH);
+
+		calendar.setLayout(new GridLayout(6, 7));
+		days.add(calendar, BorderLayout.CENTER);
+
+		int axi = cal.getFirstDayOfWeek();
+		for (int a = 0; a < 42; a++) {
+			if (axi == 32) {
+				axi = 1;
+			}
+			String strI = String.valueOf(axi);
+			JLabel label = new JLabel(strI);
+			calendar.add(label);
+			axi++;
+
+		}
+		frame.pack();
+		frame.setVisible(true);
+	}
+
+}

+ 2 - 0
src/gui/panels/agenda/DaySelectorPane.java

@@ -19,6 +19,8 @@ public class DaySelectorPane extends JPanel{
 	public DaySelectorPane(){
 		this.setLayout(new FlowLayout());
 		addContent();
+		this.setOpaque(true);
+		this.setBackground(Color.WHITE);
 	}
 	
 	private void addContent(){

+ 2 - 0
src/gui/panels/agenda/InfoField.java

@@ -22,6 +22,8 @@ public class InfoField extends JPanel {
 		label.setForeground(new Color(51,51,51));
 		border.setTitleFont(new Font("Arial", Font.PLAIN, 14));
 		border.setTitleColor(new Color(51,51,51));
+		this.setOpaque(false);
+		this.setBackground(Color.WHITE);
 	}
 	
 	public void setLabel(String text){

+ 2 - 0
src/gui/panels/agenda/InfoPane.java

@@ -27,6 +27,8 @@ public class InfoPane extends JPanel{
 		this.setBackground(new Color(242,241,237));
 		this.setBorder(new LineBorder(new Color(0, 0, 0), 1, true));
 		this.setLayout(new GridBagLayout());
+		this.setOpaque(false);
+		this.setBackground(Color.WHITE);
 		
 		upperPanel = new InfoField(festivalName, festivalInfo);
 		GridBagConstraints c = new GridBagConstraints();

+ 14 - 7
src/gui/panels/edit/ActsPane.java

@@ -28,17 +28,20 @@ public class ActsPane extends JPanel {
 
     public ActsPane(Agenda agenda, JPanel panel){
     	title = new JLabel("Acts");
-    	title.setFont(new Font("Arial", Font.PLAIN, 14));
+    	title.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 20));
+    	title.setFont(new Font("Arial", Font.PLAIN, 16));
     	title.setForeground(new Color(51,51,51));
-    	
+    	this.setOpaque(false);
         this.agenda = agenda;
         this.model = new DefaultListModel();
         this.detailsPanel = panel;
         super.setLayout(new BorderLayout());
         super.setBackground(new Color(242,241,237));
         super.add(title, BorderLayout.NORTH);
-        super.add(new JPanel(), BorderLayout.EAST);
-        super.add(new JPanel(), BorderLayout.WEST);
+        JPanel randomPane = new JPanel();
+        randomPane.setOpaque(false);
+        super.add(randomPane, BorderLayout.EAST);
+        super.add(randomPane, BorderLayout.WEST);
         super.add(this.buttonRow(), BorderLayout.SOUTH);
 
         for(Act act: this.agenda.getActs()){
@@ -62,11 +65,14 @@ public class ActsPane extends JPanel {
 
     private JPanel buttonRow(){
         JPanel buttonPane = new JPanel();
+        buttonPane.setBorder(BorderFactory.createEmptyBorder(20, 10, 0, 20));
         buttonPane.setLayout(new BoxLayout(buttonPane, BoxLayout.X_AXIS));
-        
+        buttonPane.setOpaque(false);
+        this.setBackground(Color.WHITE);
         //add button
         JLabel addButton = new JLabel();
-        addButton.setIcon(new ImageIcon("E:\\Bibliotheek\\Documenten\\Workspaces\\FestivalPlanner\\res\\add.png"));
+        addButton.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 20));
+        addButton.setIcon(new ImageIcon(getClass().getResource("/add.png")));
         addButton.setForeground(new Color(51,51,51));
         addButton.addMouseListener(new MouseListener() {
 			@Override
@@ -98,7 +104,7 @@ public class ActsPane extends JPanel {
         
         //remove button
         JLabel removeButton = new JLabel();
-        removeButton.setIcon(new ImageIcon("E:\\Bibliotheek\\Documenten\\Workspaces\\FestivalPlanner\\res\\remove.png"));
+        removeButton.setIcon(new ImageIcon(getClass().getResource("/remove.png")));
         removeButton.addMouseListener(new MouseListener() {
 			@Override
 			public void mouseClicked(MouseEvent e) {
@@ -133,6 +139,7 @@ public class ActsPane extends JPanel {
     
     public void editDialog(){
         JDialog dialog = new ActDialogPanel(ActsPane.this.agenda, model, (Act) actsList.getSelectedValue());
+        dialog.setBackground(Color.WHITE);
         dialog.setLocation(getCenterOfScreen(dialog));
         dialog.setLocationRelativeTo(null);
         dialog.pack();

+ 14 - 7
src/gui/panels/edit/ArtistPane.java

@@ -30,17 +30,21 @@ public class ArtistPane extends JPanel {
     
     public ArtistPane(Agenda agenda, JPanel detailsPanel){
     	title = new JLabel("Artists");
-    	title.setFont(new Font("Arial", Font.PLAIN, 14));
+    	title.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 20));
+    	title.setFont(new Font("Arial", Font.PLAIN, 16));
     	title.setForeground(new Color(51,51,51));
-    	
+    	this.setOpaque(false);
+        this.setBackground(Color.WHITE);
         this.agenda = agenda;
         this.model = new DefaultListModel();
         this.detailsPanel = detailsPanel;
         super.setBackground(new Color(242,241,237));
         super.setLayout(new BorderLayout());
         super.add(title, BorderLayout.NORTH);
-        super.add(new JPanel(), BorderLayout.EAST);
-        super.add(new JPanel(), BorderLayout.WEST);
+        JPanel randomPane = new JPanel();
+        randomPane.setOpaque(false);
+        super.add(randomPane, BorderLayout.EAST);
+        super.add(randomPane, BorderLayout.WEST);
         super.add(this.buttonRow(), BorderLayout.SOUTH);
 
         //the JList needs an array, so you have to go from the List to an array.
@@ -67,10 +71,12 @@ public class ArtistPane extends JPanel {
     
     private JPanel buttonRow(){
         JPanel buttonPane = new JPanel();
+        buttonPane.setBorder(BorderFactory.createEmptyBorder(20, 10, 0, 20));
         buttonPane.setLayout(new BoxLayout(buttonPane, BoxLayout.X_AXIS));
-        
+        buttonPane.setOpaque(false);
         JLabel addArtist = new JLabel();
-        addArtist.setIcon(new ImageIcon("E:\\Bibliotheek\\Documenten\\Workspaces\\FestivalPlanner\\res\\add.png"));
+        addArtist.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 20));
+        addArtist.setIcon(new ImageIcon(this.getClass().getResource("/add.png")));
         addArtist.setForeground(new Color(51,51,51));
         addArtist.addMouseListener(new MouseListener() {
 			@Override
@@ -101,7 +107,7 @@ public class ArtistPane extends JPanel {
         buttonPane.add(addArtist);
         
         JLabel removeButton = new JLabel();
-        removeButton.setIcon(new ImageIcon("E:\\Bibliotheek\\Documenten\\Workspaces\\FestivalPlanner\\res\\remove.png"));
+        removeButton.setIcon(new ImageIcon(getClass().getResource("/remove.png")));
         removeButton.setForeground(new Color(51,51,51));
         removeButton.addMouseListener(new MouseListener() {
 			@Override
@@ -149,6 +155,7 @@ public class ArtistPane extends JPanel {
     
     public void editDialog(){
         JDialog dialog = new ArtistDialogPanel(ArtistPane.this.agenda, model, (Artist) artistList.getSelectedValue());
+        dialog.setBackground(Color.WHITE);
         dialog.setLocation(getCenterOfScreen(dialog));
         dialog.pack();
         dialog.setVisible(true);

+ 13 - 6
src/gui/panels/edit/EditPane.java

@@ -5,6 +5,7 @@ import java.awt.Color;
 import java.awt.GridLayout;
 import java.awt.Label;
 
+import javax.swing.BorderFactory;
 import javax.swing.JPanel;
 import javax.swing.JTextArea;
 
@@ -20,23 +21,29 @@ public class EditPane extends JPanel {
     
     public EditPane(Agenda agenda) {
         this.agenda = agenda;
-        super.setBackground(new Color(242,241,237));
+        super.setBackground(Color.WHITE);
         super.setLayout(new GridLayout(1, 4));
-
+        this.setOpaque(true);
+        this.setBackground(Color.WHITE);
         this.detailsPanel = this.detailsPanel();
         super.add(new ArtistPane(this.agenda, this.detailsPanel));
         super.add(new StagesPane(this.agenda, this.detailsPanel));
         super.add(new ActsPane(this.agenda, this.detailsPanel));
+        this.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));
     }
 
     private JPanel detailsPanel() {
         JPanel detailsPanel = new JPanel();
+        detailsPanel.setBackground(Color.WHITE);
+        detailsPanel.setOpaque(false);
         detailsPanel.setLayout(new BorderLayout());
-        detailsPanel.add(new JPanel(), BorderLayout.EAST);
-        detailsPanel.add(new JPanel(), BorderLayout.WEST);
-        detailsPanel.add(new JPanel(), BorderLayout.SOUTH);
+        JPanel randomPane = new JPanel();
+        randomPane.setBackground(Color.WHITE);
+        randomPane.setOpaque(false);
+        detailsPanel.add(randomPane, BorderLayout.EAST);
+        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;
     }

+ 14 - 6
src/gui/panels/edit/StagesPane.java

@@ -30,16 +30,20 @@ public class StagesPane extends JPanel {
     
     public StagesPane(Agenda agenda, JPanel detailsPanel){
     	title = new JLabel("Stages");
-    	title.setFont(new Font("Arial", Font.PLAIN, 14));
+    	title.setFont(new Font("Arial", Font.PLAIN, 16));
+    	title.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 20));
     	title.setForeground(new Color(51,51,51));
-    	
+    	this.setOpaque(false);
+        this.setBackground(Color.WHITE);
         this.agenda = agenda;
         this.detailsPanel = detailsPanel;
         super.setBackground(new Color(242,241,237));
         super.setLayout(new BorderLayout());
         super.add(title, BorderLayout.NORTH);
-        super.add(new JPanel(), BorderLayout.EAST);
-        super.add(new JPanel(), BorderLayout.WEST);
+        JPanel randomPane = new JPanel();
+        randomPane.setOpaque(false);
+        super.add(randomPane, BorderLayout.EAST);
+        super.add(randomPane, BorderLayout.WEST);
         super.add(this.buttonRow(), BorderLayout.SOUTH);
 
         //the JList needs an array, so you have to go from the List to an array.
@@ -67,10 +71,13 @@ public class StagesPane extends JPanel {
 
     private JPanel buttonRow(){
         JPanel buttonPane = new JPanel();
+        buttonPane.setBorder(BorderFactory.createEmptyBorder(20, 10, 0, 20));
+        buttonPane.setOpaque(false);
         buttonPane.setLayout(new BoxLayout(buttonPane, BoxLayout.X_AXIS));
         
         JLabel addButton = new JLabel();
-        addButton.setIcon(new ImageIcon("E:\\Bibliotheek\\Documenten\\Workspaces\\FestivalPlanner\\res\\add.png"));
+        addButton.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 20));
+        addButton.setIcon(new ImageIcon(getClass().getResource("/add.png")));
         addButton.setForeground(new Color(51,51,51));
         addButton.addMouseListener(new MouseListener() {
 			@Override
@@ -102,7 +109,7 @@ public class StagesPane extends JPanel {
         buttonPane.add(addButton);
         
         JLabel remove = new JLabel();
-        remove.setIcon(new ImageIcon("E:\\Bibliotheek\\Documenten\\Workspaces\\FestivalPlanner\\res\\remove.png"));
+        remove.setIcon(new ImageIcon(getClass().getResource("/remove.png")));
         remove.setForeground(new Color(51,51,51));
         remove.addMouseListener(new MouseListener() {
 			@Override
@@ -137,6 +144,7 @@ public class StagesPane extends JPanel {
     
     public void editDialog(){
         JDialog dialog = new StageDialogPanel(StagesPane.this.agenda, model, (Stage) stagesList.getSelectedValue());
+        dialog.getContentPane().setBackground(Color.WHITE);
         dialog.setLocation(getCenterOfScreen(dialog));
         dialog.setLocationRelativeTo(null);
         dialog.pack();

+ 228 - 52
src/gui/panels/edit/dialogs/ActDialogPanel.java

@@ -2,23 +2,17 @@ package gui.panels.edit.dialogs;
 
 import java.awt.Color;
 import java.awt.Component;
+import java.awt.Font;
 import java.awt.Label;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
 import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.Iterator;
 
-import javax.swing.BoxLayout;
-import javax.swing.DefaultListModel;
-import javax.swing.JButton;
-import javax.swing.JComboBox;
-import javax.swing.JDialog;
-import javax.swing.JLabel;
-import javax.swing.JList;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextField;
-import javax.swing.ListCellRenderer;
+import javax.swing.*;
 
 import agenda.Act;
 import agenda.ActTime;
@@ -32,9 +26,11 @@ import agenda.Stage;
 public class ActDialogPanel extends JDialog{
 
     private Agenda agenda;
-    private JTextField name, genre;
+    private JTextField name, genre, beginTime, endTime;
     private JComboBox stageComboBox;
-
+    private JRadioButton radio1, radio2, radio3, radio4, radio5;
+    private ButtonGroup radioButtons;
+    
     private DefaultListModel model;
     private final DefaultListModel  artistModel = new DefaultListModel();
     private Act act;
@@ -42,16 +38,23 @@ public class ActDialogPanel extends JDialog{
     public ActDialogPanel(Agenda agenda, DefaultListModel model){
         this.agenda = agenda;
         this.model = model;
-
+        this.getContentPane().setBackground( Color.WHITE );
+        
         JPanel main = new JPanel();
+        main.setOpaque(false);
         main.setLayout(new BoxLayout(main, BoxLayout.Y_AXIS));
-        main.add(new Label("new act"));
+        Label label = new Label("New Act");
+        label.setBackground(Color.WHITE);
+        label.setFont(new Font("Arial", Font.PLAIN, 14));
+        main.add(label);
         main.add(this.namePanel());
         //add
+        main.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 20));
         main.add(this.stageChooser());
         main.add(this.genreChooser());
         //todo dates
         main.add(this.dates());
+        main.add(this.popularity());
         main.add(this.artistsChooser());
         
         main.add(this.buttons());
@@ -64,10 +67,14 @@ public class ActDialogPanel extends JDialog{
         this.agenda = agenda;
         this.model = model;
         this.act = act;
+        this.getContentPane().setBackground( Color.WHITE );
         
         JPanel main = new JPanel();
+        main.setOpaque(false);
         main.setLayout(new BoxLayout(main, BoxLayout.Y_AXIS));
-        main.add(new Label("edit act"));
+        Label label = new Label("Edit Act");
+        label.setFont(new Font("Arial", Font.PLAIN, 11));
+        main.add(label);
         main.add(this.namePanel());
         this.name.setText(act.getName());
         //add
@@ -80,17 +87,25 @@ public class ActDialogPanel extends JDialog{
         for(Artist artist: this.act.getArtists()){
             this.artistModel.addElement(artist);
         }
-        
+        main.add(this.popularity(act.getPopularity()));
         main.add(this.artistsChooser());
         main.add(this.buttons());
+        
+        //set time
+        this.beginTime.setText(this.act.getActTime().getBeginTimeStringField());
+        this.endTime.setText(this.act.getActTime().getEndTimeStringField());
         super.add(main);
     }
     
     private JPanel namePanel(){
         JPanel name = new JPanel();
+        name.setOpaque(false);
         name.setLayout(new BoxLayout(name, BoxLayout.X_AXIS));
-        name.add(new JLabel("Name"));
-
+        name.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
+        Label label = new Label("Name");
+        label.setBackground(Color.WHITE);
+        label.setFont(new Font("Arial", Font.PLAIN, 11));
+        name.add(label);
         this.name = new JTextField();
 
         name.add(this.name);
@@ -99,13 +114,18 @@ public class ActDialogPanel extends JDialog{
 
     private JPanel stageChooser(){
         JPanel panel = new JPanel();
+        panel.setOpaque(false);
         this.stageComboBox = new JComboBox();
         for(Stage stage: this.agenda.getStages()){
             this.stageComboBox.addItem(stage);
         }
         
         panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));
-        panel.add(new JLabel("stage:"));
+        Label label = new Label("Stage:");
+        label.setBackground(Color.WHITE);
+        panel.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
+        label.setFont(new Font("Arial", Font.PLAIN, 11));
+        panel.add(label);
         panel.add(this.stageComboBox);        
         
         return panel;
@@ -113,6 +133,7 @@ public class ActDialogPanel extends JDialog{
 
     private JPanel stageChooser(Act act){
         JPanel panel = new JPanel();
+        panel.setOpaque(false);
         this.stageComboBox = new JComboBox();
         this.stageComboBox.addItem(act.getStage());
         for(Stage stage: this.agenda.getStages()){
@@ -120,9 +141,12 @@ public class ActDialogPanel extends JDialog{
                 this.stageComboBox.addItem(stage);
             }
         }
-
+        panel.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
         panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));
-        panel.add(new JLabel("stage:"));
+        Label label = new Label("Stage:");
+        label.setBackground(Color.WHITE);
+        label.setFont(new Font("Arial", Font.PLAIN, 11));
+        panel.add(label);
         panel.add(this.stageComboBox);
 
         return panel;
@@ -130,9 +154,13 @@ public class ActDialogPanel extends JDialog{
     
     private JPanel genreChooser(){
         JPanel genrePanel = new JPanel();
+        genrePanel.setOpaque(false);
         genrePanel.setLayout(new BoxLayout(genrePanel, BoxLayout.X_AXIS));
-        genrePanel.add(new JLabel("Genre"));
-
+        genrePanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
+        Label label = new Label("Genre");
+        label.setBackground(Color.WHITE);
+        label.setFont(new Font("Arial", Font.PLAIN, 11));
+        genrePanel.add(label);
         this.genre = new JTextField();
 
         genrePanel.add(this.genre);
@@ -140,14 +168,108 @@ public class ActDialogPanel extends JDialog{
     }
     
     private JPanel dates(){
-        JPanel dates = new JPanel();   
+        JPanel dates = new JPanel();
+        dates.setOpaque(false);
+        dates.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
+        dates.setLayout(new BoxLayout(dates, BoxLayout.Y_AXIS));
+        dates.add(this.beginTime());
+        dates.add(this.endTime());
         return dates;
     }
     
+    private JPanel beginTime(){
+        JPanel panel = new JPanel();
+        panel.setOpaque(false);
+        panel.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
+        panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));
+        Label label = new Label("Begintijd");
+        label.setBackground(Color.WHITE);
+        label.setFont(new Font("Arial", Font.PLAIN, 11));
+        panel.add(label);
+        this.beginTime = new JTextField("2015-02-11-12-10");
+        panel.add(this.beginTime);
+        return panel;
+    }
+    
+    private JPanel endTime(){
+        JPanel panel = new JPanel();
+        panel.setOpaque(false);
+        panel.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
+        panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));
+        panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));
+        Label label = new Label("Eindtijd");
+        label.setBackground(Color.WHITE);
+        label.setFont(new Font("Arial", Font.PLAIN, 11));
+        panel.add(label);
+        this.endTime = new JTextField("2015-02-11-13-20");
+        panel.add(this.endTime);
+        
+        return panel;
+    }
+    
+    private JPanel popularity(){
+        return this.popularity(3);
+    }
+
+    private JPanel popularity(int number){
+        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:
+                this.radio1.setSelected(true);
+                break;
+            case 2:       
+                this.radio2.setSelected(true);
+                break;
+            case 3:
+                this.radio3.setSelected(true);
+                break;
+            case 4:
+                this.radio4.setSelected(true);
+                break;
+            case 5:
+                this.radio5.setSelected(true);
+                break;
+        }
+
+        buttons.add(this.radio1);
+        buttons.add(this.radio2);
+        buttons.add(this.radio3);
+        buttons.add(this.radio4);
+        buttons.add(this.radio5);
+
+        this.radioButtons = new ButtonGroup();
+        this.radioButtons.add(this.radio1);
+        this.radioButtons.add(this.radio2);
+        this.radioButtons.add(this.radio3);
+        this.radioButtons.add(this.radio4);
+        this.radioButtons.add(this.radio5);
+
+        panel.add(buttons);
+        return panel;
+    }
+    
     private JPanel artistsChooser(){
         JPanel artists = new JPanel();
+        artists.setOpaque(false);
         artists.setLayout(new BoxLayout(artists, BoxLayout.X_AXIS));
-        
+        artists.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
         //list
         final JList<Act> list = new JList();
         list.setCellRenderer(new ArtistCellRenderer());
@@ -159,28 +281,31 @@ public class ActDialogPanel extends JDialog{
         
         JPanel buttonPanel = new JPanel();
         buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.Y_AXIS));
-        
-        JButton addArtists = new JButton("+");
-        addArtists.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                boolean chosen = false;
+        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));
+        addArtists.addMouseListener(new MouseListener() {
+			@Override
+			public void mouseClicked(MouseEvent e) {
+				boolean chosen = false;
                 
                 //artists 
                 ArrayList listArtists = new ArrayList<Artist>();
                 //for every artist in the agenda
                 for(Artist artistAgenda: agenda.getArtists()){
                     
-                    System.out.println("artist: " + artistAgenda);
+                    System.out.println("Artist: " + artistAgenda);
                     
                     //for every artist in the model.
                     for(Object artistObject: artistModel.toArray()){
                         Artist artistModel = (Artist) artistObject;
                         
-                        System.out.println("vergelijk: " + artistModel + " - " + artistAgenda);
+                        System.out.println("Vergelijk: " + artistModel + " - " + artistAgenda);
                         
                         if(artistModel == artistAgenda) {
-                            System.out.println("true: " + artistModel + " - " + artistAgenda);
+                            System.out.println("True: " + artistModel + " - " + artistAgenda);
                             chosen = true;
                         }                    
                     }
@@ -205,28 +330,65 @@ public class ActDialogPanel extends JDialog{
                 if(chosenArtist != null){
                     artistModel.addElement(chosenArtist);
                 }
-            }
-        });
+            
+			}
+			@Override
+			public void mouseEntered(MouseEvent arg0) {
+				
+			}
+			@Override
+			public void mouseExited(MouseEvent arg0) {
+				
+			}
+			@Override
+			public void mousePressed(MouseEvent arg0) {
+				
+			}
+
+			@Override
+			public void mouseReleased(MouseEvent arg0) {
+
+			}
+		});
         
-        JButton removeButton = new JButton("-");
-        removeButton.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                if(list.getSelectedValue() != null){
+        JLabel removeButton = new JLabel();
+        removeButton.setIcon(new ImageIcon(getClass().getResource("/remove.png")));
+        removeButton.addMouseListener(new MouseListener() {
+			@Override
+			public void mouseClicked(MouseEvent e) {
+				if(list.getSelectedValue() != null){
                     Object object = artistModel.remove(list.getSelectedIndex());
-                }
-            }
-        });
+			}}
+			@Override
+			public void mouseEntered(MouseEvent arg0) {
+				
+			}
+			@Override
+			public void mouseExited(MouseEvent arg0) {
+				
+			}
+			@Override
+			public void mousePressed(MouseEvent arg0) {
+				
+			}
+
+			@Override
+			public void mouseReleased(MouseEvent arg0) {
+
+			}
+			});
         buttonPanel.add(addArtists);
         buttonPanel.add(removeButton);
         artists.add(buttonPanel);
         return artists;
     }
 
+    
+    
     private JPanel buttons(){
         JPanel buttons = new JPanel();
-
-        JButton save = new JButton("save");
+        buttons.setOpaque(false);
+        JButton save = new JButton("Save");
         save.addActionListener(new ActionListener() {
             @Override
             public void actionPerformed(ActionEvent e) {
@@ -235,7 +397,7 @@ public class ActDialogPanel extends JDialog{
         });
         buttons.add(save);
 
-        JButton cancel = new JButton("cancel");
+        JButton cancel = new JButton("Cancel");
         cancel.addActionListener(new ActionListener() {
             @Override
             public void actionPerformed(ActionEvent e) {
@@ -271,7 +433,7 @@ public class ActDialogPanel extends JDialog{
         
         
         if(this.act == null){
-            Act act = new Act(this.name.getText(), (Stage) this.stageComboBox.getSelectedItem(), this.genre.getText(), new ActTime(2015,02,11,21,00  ,2015,02,11,23,00), artists);
+            Act act = new Act(this.name.getText(), (Stage) this.stageComboBox.getSelectedItem(), this.genre.getText(), new ActTime(this.beginTime.getText(), this.endTime.getText()), this.getSelectedButtonNumber() ,artists);
             this.model.addElement(act);
             this.agenda.addAct(act);
         }else{
@@ -279,18 +441,32 @@ public class ActDialogPanel extends JDialog{
             this.act.setGenre(this.genre.getText());
             this.act.setStage((Stage) this.stageComboBox.getSelectedItem());
             this.act.setArtists(artists);
+            this.act.setTime(new ActTime(this.beginTime.getText(), this.endTime.getText()));
+            this.act.setPopularity(this.getSelectedButtonNumber());
+            this.act.setActTime(new ActTime(this.beginTime.getText(), this.endTime.getText()));
             this.model.removeElement(this.act);
             this.model.addElement(act);
         }
-        
         System.out.println(act);
         dispose();
-
     }
 
     private void cancel(){
         dispose();
     }
+    
+    private int getSelectedButtonNumber(){
+
+        Enumeration<AbstractButton> buttons = this.radioButtons.getElements();
+        
+        while(buttons.hasMoreElements()){
+            AbstractButton button = buttons.nextElement();
+            if(button.isSelected()){
+                return Integer.valueOf(button.getText());
+            }
+        }
+        return -1;
+    }
 }
 
 class ArtistCellRenderer extends JLabel implements ListCellRenderer {

+ 30 - 11
src/gui/panels/edit/dialogs/ArtistDialogPanel.java

@@ -4,6 +4,7 @@ import agenda.Agenda;
 import agenda.Artist;
 
 import javax.swing.*;
+
 import java.awt.*;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
@@ -23,13 +24,19 @@ public class ArtistDialogPanel extends JDialog{
     public ArtistDialogPanel(Agenda agenda, DefaultListModel model){
         this.agenda = agenda;
         this.model = model;
-
+        this.getContentPane().setBackground( Color.WHITE );
+        
         JPanel main = new JPanel();
+        main.setOpaque(false);
         main.setLayout(new BoxLayout(main, BoxLayout.Y_AXIS));
-        main.add(new Label("new artist"));
+        Label label = new Label("Begintijd");
+        label.setBackground(Color.WHITE);
+        label.setFont(new Font("Arial", Font.PLAIN, 14));
+        main.add(label);
         main.add(this.namePanel());
         main.add(this.genrePanel());
         main.add(this.buttons());
+        main.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 20));
         super.add(main);
         super.setVisible(true);
         super.pack();
@@ -39,14 +46,17 @@ public class ArtistDialogPanel extends JDialog{
         this.agenda = agenda;
         this.model = model;
         this.artist = artist;
-
+        this.getContentPane().setBackground( Color.WHITE );
         JPanel main = new JPanel();
         main.setLayout(new BoxLayout(main, BoxLayout.Y_AXIS));
-        main.add(new Label("edit artist"));
+        main.setOpaque(false);
+        Label label = new Label("Edit artist");
+        label.setFont(new Font("Arial", Font.PLAIN, 11));
+        main.add(label);
         main.add(this.namePanel());
         main.add(this.genrePanel());
         main.add(this.buttons());
-
+        label.setBackground(Color.WHITE);
         this.name.setText(this.artist.getName());
         this.genre.setText(this.artist.getGenre());
 
@@ -55,8 +65,13 @@ public class ArtistDialogPanel extends JDialog{
 
     private JPanel genrePanel(){
         JPanel panel = new JPanel();
+        panel.setOpaque(false);
         panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));
-        panel.add(new Label("Genre:"));
+        Label label = new Label("Genre");
+        panel.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
+        label.setFont(new Font("Arial", Font.PLAIN, 11));
+        panel.add(label);
+        label.setBackground(Color.WHITE);
         this.genre = new JTextField();
         panel.add(this.genre);
         return panel;
@@ -64,9 +79,13 @@ public class ArtistDialogPanel extends JDialog{
 
     private JPanel namePanel(){
         JPanel name = new JPanel();
+        name.setOpaque(false);
         name.setLayout(new BoxLayout(name, BoxLayout.X_AXIS));
-        name.add(new JLabel("Name"));
-        
+        name.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
+        Label label = new Label("Name");
+        label.setFont(new Font("Arial", Font.PLAIN, 11));
+        name.add(label);
+        label.setBackground(Color.WHITE);
         this.name = new JTextField();
         
         name.add(this.name);
@@ -75,8 +94,8 @@ public class ArtistDialogPanel extends JDialog{
 
     private JPanel buttons(){
         JPanel buttons = new JPanel();
-
-        JButton save = new JButton("save");
+        buttons.setOpaque(false);
+        JButton save = new JButton("Save");
         save.addActionListener(new ActionListener() {
             @Override
             public void actionPerformed(ActionEvent e) {
@@ -85,7 +104,7 @@ public class ArtistDialogPanel extends JDialog{
         });
         buttons.add(save);
 
-        JButton cancel = new JButton("cancel");
+        JButton cancel = new JButton("Cancel");
         cancel.addActionListener(new ActionListener() {
             @Override
             public void actionPerformed(ActionEvent e) {

+ 23 - 9
src/gui/panels/edit/dialogs/StageDialogPanel.java

@@ -5,6 +5,7 @@ import agenda.Artist;
 import agenda.Stage;
 
 import javax.swing.*;
+
 import java.awt.*;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
@@ -22,12 +23,17 @@ public class StageDialogPanel extends JDialog{
     public StageDialogPanel(Agenda agenda, DefaultListModel model){
         this.agenda = agenda;
         this.model = model;
-        
+        this.getContentPane().setBackground( Color.WHITE );
         JPanel main = new JPanel();
+        main.setOpaque(false);
         main.setLayout(new BoxLayout(main, BoxLayout.Y_AXIS));
-        main.add(new Label("new stage"));
+        Label label = new Label("New stage");
+        label.setBackground(Color.WHITE);
+        label.setFont(new Font("Arial", Font.PLAIN, 14));
+        main.add(label);
         main.add(this.namePanel());
         main.add(this.buttons());
+        main.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
         super.add(main);
     }
 
@@ -36,10 +42,13 @@ public class StageDialogPanel extends JDialog{
         this.agenda = agenda;
         this.model = model;
         this.stage = stage;
-
+        this.getContentPane().setBackground( Color.WHITE );
         JPanel main = new JPanel();
+        main.setOpaque(false);
         main.setLayout(new BoxLayout(main, BoxLayout.Y_AXIS));
-        main.add(new Label("edit stage"));
+        Label label = new Label("Edit stage");
+        label.setFont(new Font("Arial", Font.PLAIN, 11));
+        main.add(label);
         main.add(this.namePanel());
         main.add(this.buttons());
         
@@ -52,8 +61,13 @@ public class StageDialogPanel extends JDialog{
     
     private JPanel namePanel(){
         JPanel name = new JPanel();
+        name.setOpaque(false);
         name.setLayout(new BoxLayout(name, BoxLayout.X_AXIS));
-        name.add(new JLabel("Name"));
+        name.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
+        Label label = new Label("Name");
+        label.setBackground(Color.WHITE);
+        label.setFont(new Font("Arial", Font.PLAIN, 11));
+        name.add(label);
         this.name = new JTextField();
         name.add(this.name);
         return name;
@@ -61,8 +75,8 @@ public class StageDialogPanel extends JDialog{
 
     private JPanel buttons(){
         JPanel buttons = new JPanel();
-        
-        JButton save = new JButton("save");
+        buttons.setOpaque(false);
+        JButton save = new JButton("Save");
         save.addActionListener(new ActionListener() {
             @Override
             public void actionPerformed(ActionEvent e) {
@@ -71,7 +85,7 @@ public class StageDialogPanel extends JDialog{
         });
         buttons.add(save);
         
-        JButton cancel = new JButton("cancel");
+        JButton cancel = new JButton("Cancel");
         cancel.addActionListener(new ActionListener() {
             @Override
             public void actionPerformed(ActionEvent e) {
@@ -111,7 +125,7 @@ public class StageDialogPanel extends JDialog{
     }
     
     protected JButton saveButton() {
-        JButton button = new JButton("save");
+        JButton button = new JButton("Save");
         button.addActionListener(new ActionListener() {
             @Override
             public void actionPerformed(ActionEvent e) {

+ 56 - 0
src/gui/simulator/AccessPoint.java

@@ -0,0 +1,56 @@
+package gui.simulator;
+
+public class AccessPoint extends DrawEngine {
+	
+	private static String imageLocation = "/simulator/ingang.png";
+	private static String facilityName = "Ingang";
+	private Terrain terrain;
+
+    public AccessPoint(Terrain terrain, int x, int y) {
+        super(imageLocation, x, y, 1, 0, SimulatorPane.Objects.ENTRANCE);
+        this.terrain = terrain;
+    }
+
+    public AccessPoint(Terrain terrain, int x, int y, double scale, double distance) {
+        super(imageLocation, x, y, scale, distance, SimulatorPane.Objects.ENTRANCE);
+        this.terrain = terrain;
+    }
+    
+    public String getFacilityName(){
+    	return facilityName;
+    }
+    
+    @Override
+    public void setX(double x){
+    	double oldPosX = this.getX();
+    	double oldPosY = this.getY();
+    	if(x<0){
+    		this.setRotation(90);
+    		this.setX(0);
+    	} else if(x>9*terrain.getWidth()/10){
+    		this.setX(9*terrain.getWidth()/10);
+    		this.setRotation(90);
+    	} else if(x>0 && x<9*terrain.getWidth()/10 && this.getY() > 50 && this.getY() < terrain.getFestivalHeight()-150){
+    		this.setX(oldPosX);
+    		this.setY(oldPosY);
+    	} else {
+    		this.setX(x);
+    	}
+    }
+
+    @Override
+    public void setY(double y){
+    	double oldPosY = this.getY();
+    	if(y<50){
+    		this.setRotation(0);
+    		this.setY(50);
+    	} else if(y>11*terrain.getFestivalHeight()/12){
+    		this.setRotation(0);
+    		this.setY(11*terrain.getFestivalHeight()/12);
+    	} else if(this.getX()>terrain.getWidth()/10 && this.getX() <9*terrain.getWidth()/10 && this.getY()> 50 && this.getY() < terrain.getFestivalHeight()-150){
+    		this.setY(oldPosY);
+    	} else {
+    		this.setY(y);
+    	}
+    }
+}

+ 110 - 0
src/gui/simulator/DrawEngine.java

@@ -0,0 +1,110 @@
+package gui.simulator;
+
+import javax.imageio.ImageIO;
+
+import java.awt.*;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.io.IOException;
+
+/**
+ * Created by gjoosen on 07/03/15.
+ * Edited by master D Mathijssen on 17-3-2015 and some other days
+ */
+public abstract class DrawEngine {
+
+    private Image image;
+    private double x, y, rotation, scale;
+    private double distanceToOtherObjects;
+    public SimulatorPane.Objects type;
+
+    public DrawEngine(String image, int x, int y, double scale, double distanceToOtherObjects, SimulatorPane.Objects objecttype){
+        try{
+            this.image = ImageIO.read(getClass().getResource(image));
+        }catch(IOException ex){
+            ex.printStackTrace();
+        }
+        this.type = objecttype;
+        this.x = x;
+        this.y = y;
+        this.scale = scale;
+        this.distanceToOtherObjects = distanceToOtherObjects;
+    }
+
+    public AffineTransform getAffineTransform(){
+        AffineTransform transform = new AffineTransform();
+        transform.translate(this.x, this.y);
+        transform.scale(this.scale, this.scale);
+        transform.rotate(Math.toRadians(this.rotation), this.image.getWidth(null) /2 , this.image.getHeight(null) / 2);
+        return transform;
+    }
+
+    public void draw(Graphics2D g){
+        g.drawImage(this.image, this.getAffineTransform(), null);
+    }
+
+    public boolean contains(Point2D point){
+        Shape shape = new Rectangle2D.Double(0, 0, image.getWidth(null), image.getHeight(null));
+        return this.getAffineTransform().createTransformedShape(shape).contains(point);
+    }
+    
+    public Image getImage(){
+    	return image;
+    }
+
+    public Point2D.Double getCenter(){
+        Point2D.Double center = new Point2D.Double(x + this.image.getWidth(null)*scale / 2, y + this.image.getHeight(null)*scale/2);
+        return center;
+    }
+
+    //getters and setters down here
+    public double getX() {
+        return x;
+    }
+
+    public double getY() {
+        return y;
+    }
+
+    public void setX(double x){
+        this.x = x;
+    }
+
+    public void setY(double y){
+        this.y = y;
+    }
+
+    public void setRotation(double rotation) {
+        this.rotation = rotation;
+    }
+
+    public double getScale() {
+        return scale;
+    }
+
+    public void setScale(double scale) {
+        this.scale = scale;
+    }
+
+    public int getWidth(){
+        return this.image.getWidth(null);
+    }
+
+    public int getHeight(){
+        return this.image.getHeight(null);
+    }
+    public double getRotation() {
+        return rotation;
+    }
+
+    public double getDistanceToOtherObjects() {
+        return distanceToOtherObjects;
+    }
+
+    public Rectangle2D.Double getRect(){
+        return new Rectangle2D.Double(-distanceToOtherObjects, - distanceToOtherObjects, image.getWidth(null)  + 2* distanceToOtherObjects, image.getHeight(null) + 2*distanceToOtherObjects);
+    }
+
+
+}

+ 52 - 0
src/gui/simulator/ExitPoint.java

@@ -0,0 +1,52 @@
+package gui.simulator;
+
+public class ExitPoint extends DrawEngine {
+	
+	private static String imageLocation = "/simulator/uitgang.png";
+	private static String facilityName = "Uitgang";
+	private Terrain terrain;
+
+
+    public ExitPoint(Terrain terrain, int x, int y, double scale, double distance) {
+        super(imageLocation, x, y, scale, distance, SimulatorPane.Objects.EXIT);
+        this.terrain = terrain;
+    }
+    
+    public String getFacilityName(){
+    	return facilityName;
+    }
+    
+    @Override
+    public void setX(double x){
+    	double oldPosX = this.getX();
+    	double oldPosY = this.getY();
+    	if(x<0){
+    		this.setRotation(90);
+    		this.setX(0);
+    	} else if(x>9*terrain.getWidth()/10){
+    		this.setX(9*terrain.getWidth()/10);
+    		this.setRotation(90);
+    	} else if(x>0 && x<9*terrain.getWidth()/10 && this.getY() > 50 && this.getY() < terrain.getFestivalHeight()-150){
+			this.setX(oldPosX);
+			this.setY(oldPosY);
+    	} else {
+			this.setX(x);
+    	}
+    }
+
+    @Override
+    public void setY(double y){
+    	double oldPosY = this.getY();
+    	if(y<50){
+    		this.setRotation(0);
+    		this.setY(50);
+    	} else if(y>11*terrain.getFestivalHeight()/12){
+    		this.setRotation(0);
+    		this.setY(11*terrain.getFestivalHeight()/12);
+    	} else if(this.getX()>terrain.getWidth()/10 && this.getX()<9*terrain.getWidth()/10 && this.getY() > 50 && this.getY() < terrain.getFestivalHeight()-150){
+    		this.setY(oldPosY);
+    	} else {
+    		this.setY(y);
+    	}
+    }
+}

+ 5 - 0
src/gui/simulator/MarkedArea.java

@@ -0,0 +1,5 @@
+package gui.simulator;
+
+public class MarkedArea {
+
+}

+ 90 - 0
src/gui/simulator/Sidebar.java

@@ -0,0 +1,90 @@
+package gui.simulator;
+
+import gui.simulator.facilities.RestRoom;
+import gui.simulator.facilities.SimulatorStage;
+
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Graphics2D;
+import java.awt.event.MouseEvent;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.util.ArrayList;
+
+public class Sidebar {
+	private int sideBarWidth;
+	private int sideBarHeight;
+	private Terrain terrain;
+	private ArrayList<DrawEngine> drawableFacilities = new ArrayList<DrawEngine>();
+	
+	/*
+	 * Constructor for initializing all variables
+	 * @param: int sideBarWidth -> width of sidebar
+	 * @param int screenHeight -> Height of screen, so sidebar will be same height 
+	 */
+	public Sidebar(int sideBarWidth, int screenHeight, Terrain terrain){
+		this.sideBarWidth = sideBarWidth;
+		this.sideBarHeight = screenHeight;
+		this.terrain = terrain;
+	}
+	
+	public void draw(Graphics2D g2){
+		//setclip
+        g2.setClip(new Rectangle2D.Double(0,0, sideBarWidth, sideBarHeight));
+        
+        //header
+        g2.setColor(Color.GRAY);
+        g2.fill3DRect(0, 0, 200, 50, true);
+        g2.setColor(Color.WHITE);
+        g2.setFont(new Font("Serif", Font.BOLD, 20));
+        g2.drawString("Drag and drop", 30, 25);
+        
+        //draw seperation line
+        g2.setColor(Color.BLACK);
+        g2.setStroke(new BasicStroke(5));
+        g2.drawLine(199, 0, 199, sideBarHeight);
+        
+        //draw objects
+        DrawEngine object1 = new SimulatorStage(20,100, 0.4, 10);
+        object1.draw(g2);
+        g2.drawString("stage", 80, 275);
+        DrawEngine object2 = new RestRoom(60,350, 1 , 10);
+        object2.draw(g2);
+        g2.drawString("toilettage", 70, 500);
+        DrawEngine object3 = new AccessPoint(terrain, 0,550, 0.5, 10);
+        object3.draw(g2);
+        g2.drawString("ingang", 70, 675);
+        DrawEngine object4 = new ExitPoint(terrain, 0,700, 0.5, 10);
+        object4.draw(g2);
+        g2.drawString("uitgang", 70, 800);
+    }
+	
+    private void getFacility(MouseEvent e){
+    	Point2D clickPoint = terrain.getClickPoint(e.getPoint());
+    	DrawEngine dragObject = null;
+    	if(e.getX() < sideBarWidth)
+		{
+			if(e.getY() < 300){
+				dragObject = new SimulatorStage((int)clickPoint.getX(),(int)clickPoint.getY(), 0.5, 10);
+				terrain.setDragObject(dragObject);
+			}else if(e.getY() > 300 && e.getY() < 550){
+				dragObject = new RestRoom((int)clickPoint.getX(),(int)clickPoint.getY(), 0.5, 10);
+				terrain.setDragObject(dragObject);
+			}else if(e.getY() > 550 && e.getY() < 800){
+				dragObject = new AccessPoint(terrain, (int)clickPoint.getX(),(int)clickPoint.getY(), 0.5, 10);
+				terrain.setDragObject(dragObject);
+			}
+			else if(e.getY() > 800){
+				dragObject = new ExitPoint(terrain, (int)clickPoint.getX(),(int)clickPoint.getY(), 0.5, 10);
+				terrain.setDragObject(dragObject);
+			}
+			if(dragObject != null)
+				terrain.addEntity(dragObject);
+		}
+    }
+	
+	public int getSideBarWidth(){
+		return sideBarWidth;
+	}
+}

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott