From c232d6a01c76fc66bd72341a5eefc39ae5a64ca2 Mon Sep 17 00:00:00 2001 From: guusvdongen Date: Fri, 13 Feb 2015 17:23:07 +0100 Subject: [PATCH 01/13] Create Artist --- Artist | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 Artist diff --git a/Artist b/Artist new file mode 100644 index 0000000..960fd40 --- /dev/null +++ b/Artist @@ -0,0 +1,72 @@ +import java.io.Serializable; + +import javax.swing.ImageIcon; + + +public class Artist implements Serializable{ + + private static final long serialVersionUID = 1; + + private String name; + private String genre; + private ImageIcon image; + private String description; + + public Artist(String name, String genre, String image, String description) + { + this.name = name; + this.genre = genre; + this.description = description; + + if ( !image.equals("null")) { + this.image = new ImageIcon(image); + } else { + this.image = null; + } + } + + public String getName() + { + return this.name; + } + + public String getGenre() + { + return this.genre; + } + + public ImageIcon getImage() + { + return this.image; + } + + public String getDescription() + { + return this.description; + } + + public void setName(String name) + { + this.name = name; + } + + public void setGenre(String genre) + { + this.genre = genre; + } + + public void setImageIconString(String image) + { + this.image = new ImageIcon(image); + } + + public void setImageIcon(ImageIcon image) + { + this.image = image; + } + + public void setDescription(String description) + { + this.description = description; + } +} From 0e78c56ad76ea3b4fd45778ba5caab0bcd580187 Mon Sep 17 00:00:00 2001 From: guusvdongen Date: Fri, 13 Feb 2015 17:24:11 +0100 Subject: [PATCH 02/13] Event --- Event | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 Event diff --git a/Event b/Event new file mode 100644 index 0000000..a34ecd2 --- /dev/null +++ b/Event @@ -0,0 +1,93 @@ +import java.io.Serializable; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.GregorianCalendar; + +public class Event implements Serializable { + + private static final long serialVersionUID = 1; + + private GregorianCalendar startDate; + private GregorianCalendar endDate; + private Artist artist; + private String description; + private int expectedPopularity; + private int ID; + + public Event(int startYear, int startMonth, int startDay, int startHour, + int startMinute, int endYear, int endMonth, int endDay, + int endHour, int endMinute, Artist artist, String description, + int expectedPopularity, int ID) { + startDate = new GregorianCalendar(startYear, startMonth - 1, startDay, + startHour, startMinute); + endDate = new GregorianCalendar(endYear, endMonth - 1, endDay, endHour, + endMinute); + this.artist = artist; + this.description = description; + this.expectedPopularity = expectedPopularity; + this.ID = ID; + } + + public GregorianCalendar getStartDate() { + return this.startDate; + } + + public GregorianCalendar getEndDate() { + return this.endDate; + } + + public Artist getArtist() { + return this.artist; + } + + public String getDescription() { + return this.description; + } + + public int getID() { + return this.ID; + } + + public int getExpectedPopularity() { + return this.expectedPopularity; + } + + public void setStartDate(int startYear, int startMonth, int startDay, + int startHour, int startMinute) { + startDate.set(startYear, startMonth - 1, startDay, startHour, + startMinute); + } + + public void setEndDate(int endYear, int endMonth, int endDay, int endHour, + int endMinute) { + endDate.set(endYear, endMonth - 1, endDay, endHour, endMinute); + } + + public void setArtist(Artist artist) { + this.artist.setName(artist.getName()); + this.artist.setGenre(artist.getGenre()); + this.artist.setImageIcon(artist.getImage()); + this.artist.setDescription(artist.getDescription()); + } + + public void setDescription(String description) { + this.description = description; + } + + public void setExpectedPopularity(int popularity) { + this.expectedPopularity = popularity; + } + + public void setID(int ID) { + this.ID = ID; + } + + public String toString() { + DateFormat format = new SimpleDateFormat("dd-MM-yyyy"); + format.setLenient(false); + + return artist.getName() + " plays from " + + format.format(startDate.getTime()) + " to " + + format.format(endDate.getTime()) + "."; + } +} From c10341c4039a1b136be0403e676094c14f97e027 Mon Sep 17 00:00:00 2001 From: guusvdongen Date: Fri, 13 Feb 2015 17:24:51 +0100 Subject: [PATCH 03/13] Stage --- Stage | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 Stage diff --git a/Stage b/Stage new file mode 100644 index 0000000..eae5615 --- /dev/null +++ b/Stage @@ -0,0 +1,49 @@ +import java.io.Serializable; +import java.util.ArrayList; + + +public class Stage implements Serializable { + + private static final long serialVersionUID = 1; + + private ArrayList events; + private String description; + private int ID; + + public Stage(String description, int ID ) + { + this.events = new ArrayList(); + this.description = description; + this.ID = ID; + } + + public Event getEvent(int number) + { + return events.get(number); + } + + public String getDescription() + { + return this.description; + } + + public int getID() + { + return this.ID; + } + + public void setDescription(String description) + { + this.description = description; + } + + public void setID(int ID) + { + this.ID = ID; + } + + public void addEvent(Event event) + { + events.add(event); + } +} From a0cdeb1794b523c2b0efdd9be900b2433bd10fc4 Mon Sep 17 00:00:00 2001 From: guusvdongen Date: Fri, 13 Feb 2015 17:25:34 +0100 Subject: [PATCH 04/13] Create Agenda --- Agenda | 188 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 188 insertions(+) create mode 100644 Agenda diff --git a/Agenda b/Agenda new file mode 100644 index 0000000..07ce3bd --- /dev/null +++ b/Agenda @@ -0,0 +1,188 @@ +import java.io.EOFException; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.Serializable; +import java.util.ArrayList; + +public class Agenda implements Serializable { + + private static final long serialVersionUID = 1; + + private ArrayList stages; + private ArrayList events; + private ArrayList artists; + + public Agenda() { + stages = new ArrayList(); + events = new ArrayList(); + artists = new ArrayList(); + } + + public void addStage(Stage stage) { + stages.add(stage); + } + + public void addEvent(Event event) { + events.add(event); + } + + public void addArtist(Artist artist) { + artists.add(artist); + } + + public void fillArtists() { + FileInputStream fis = null; + ObjectInputStream ois = null; + + try { + fis = new FileInputStream("artists.dat"); + ois = new ObjectInputStream(fis); + + Object object; + object = ois.readObject(); + try { + while (object != null) { + artists.add((Artist) object); + object = ois.readObject(); + } + } catch (EOFException e) { + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + public void fillEvents() { + FileInputStream fis = null; + ObjectInputStream ois = null; + + try { + fis = new FileInputStream("events.dat"); + ois = new ObjectInputStream(fis); + + Object object; + object = ois.readObject(); + try { + while (object != null) { + events.add((Event) object); + object = ois.readObject(); + } + } catch (EOFException e) { + } + } catch (Exception e) { + e.printStackTrace(); + } + + } + + public void fillStages() { + FileInputStream fis = null; + ObjectInputStream ois = null; + + try { + fis = new FileInputStream("stages.dat"); + ois = new ObjectInputStream(fis); + + Object object; + object = ois.readObject(); + try { + while (object != null) { + stages.add((Stage) object); + object = ois.readObject(); + } + } catch (EOFException e) { + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + public void saveStages() { + + try { + File file = new File("stages.dat"); + if (!file.exists()){ + file.createNewFile(); + } + FileOutputStream fos = new FileOutputStream(file); + ObjectOutputStream oos = new ObjectOutputStream(fos); + for (Stage stage : stages) { + oos.writeObject(stage); + } + oos.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + public void saveEvents() { + + try { + File file = new File("events.dat"); + if (!file.exists()){ + file.createNewFile(); + } + FileOutputStream fos = new FileOutputStream(file); + ObjectOutputStream oos = new ObjectOutputStream(fos); + for (Event event : events) { + oos.writeObject(event); + } + oos.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + public void saveArtists() { + + try { + File file = new File("artists.dat"); + if (!file.exists()){ + file.createNewFile(); + } + FileOutputStream fos = new FileOutputStream(file); + ObjectOutputStream oos = new ObjectOutputStream(fos); + for (Artist artist : artists) { + oos.writeObject(artist); + } + oos.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + public void addEvents() + { + int ID = 0; + for (Stage stage : stages) + { + ID = stage.getID(); + for (Event event : events) + { + if ( ID == event.getID()) + { + stage.addEvent(event); + } + } + } + } + + public void saveAll() + { + saveArtists(); + saveEvents(); + saveStages(); + } + + public void fillAll() + { + fillArtists(); + fillEvents(); + fillStages(); + addEvents(); + } +} From 63e6138e83e6e479ff9625dd5fcddc11c649b0c8 Mon Sep 17 00:00:00 2001 From: guusvdongen Date: Fri, 13 Feb 2015 17:26:13 +0100 Subject: [PATCH 05/13] Create GUI --- GUI | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 GUI diff --git a/GUI b/GUI new file mode 100644 index 0000000..9d2ac44 --- /dev/null +++ b/GUI @@ -0,0 +1,5 @@ + +public class GUI { + + //Leeg +} From 6d6c5cd153ae106508ccd67b1b0ce171a843b55e Mon Sep 17 00:00:00 2001 From: guusvdongen Date: Fri, 13 Feb 2015 17:36:49 +0100 Subject: [PATCH 06/13] Create test --- test | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test diff --git a/test b/test new file mode 100644 index 0000000..0e12545 --- /dev/null +++ b/test @@ -0,0 +1,16 @@ +Eventuele methode om de Arraylisten mee te vullen. + +public void test() + { + Artist artist = new Artist("Paul", "Rock", "null", "description"); + Event e = new Event(2015,2,13,15,0,2015,2,13,16,0,artist,"Description",7, 1); + Stage s = new Stage("Main Stage", 1); + + addArtist(artist); + addEvent(e); + addStage(s); + + saveAll(); + fillAll(); + System.out.println("Saved All Data!"); + } From 4e6abc1551176a13c31c81fc59a7acc0a52b20e2 Mon Sep 17 00:00:00 2001 From: guusvdongen Date: Fri, 13 Feb 2015 17:37:27 +0100 Subject: [PATCH 07/13] Rename test to testmethode --- test => testmethode | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename test => testmethode (100%) diff --git a/test b/testmethode similarity index 100% rename from test rename to testmethode From d065860c4bb3ee7a589630d21217e4e7f0ae79fa Mon Sep 17 00:00:00 2001 From: guusvdongen Date: Fri, 13 Feb 2015 17:37:53 +0100 Subject: [PATCH 08/13] Delete Event.java --- Event.java | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 Event.java diff --git a/Event.java b/Event.java deleted file mode 100644 index 62cf8b4..0000000 --- a/Event.java +++ /dev/null @@ -1,15 +0,0 @@ - -public class Event -{ - private int startTime; - private int endTime; - private Artist artist; - private String description; - private int id; - - public Event() - { - - } - -} From f69ac37ea847e6f3774cd40c56227cbbfd2dc89e Mon Sep 17 00:00:00 2001 From: guusvdongen Date: Fri, 13 Feb 2015 17:38:09 +0100 Subject: [PATCH 09/13] Delete Artist.java --- Artist.java | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 Artist.java diff --git a/Artist.java b/Artist.java deleted file mode 100644 index 911b7fa..0000000 --- a/Artist.java +++ /dev/null @@ -1,18 +0,0 @@ -import javax.swing.ImageIcon; - - -public class Artist -{ - private String genre; - private String name; - private String description; - private ImageIcon image; - private int id; - - public Artist() - { - - } - - -} From ea3d16c533644d7cf4277fe50a308ce54cfa3896 Mon Sep 17 00:00:00 2001 From: guusvdongen Date: Fri, 13 Feb 2015 17:38:23 +0100 Subject: [PATCH 10/13] Delete README.md --- README.md | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 README.md diff --git a/README.md b/README.md deleted file mode 100644 index 18f4a66..0000000 --- a/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# FestivalPlanner -Avans - Technische Informatica - Periode 3 - Project Festival Planner - -##Project Leden -* Kenneth van Ewijk -* Remco Sannen -* Wesley de Hek -* Yorick Rommers -* Guus van Dongen - -##Taakverdeling -| Deel | Wie | -| ---------- |-----------| -|Achterliggende code|Guus van Dongen| -|Tijdlijn|Yorick Rommers| -|Window|Kenneth van Ewijk| -|Tabel overzicht|Wesley de Hek| -|Event Details|Remco Sannen| -|Artiest|-| From b5dbb8e0583ea739d4235a10dbaf30c6317f7858 Mon Sep 17 00:00:00 2001 From: guusvdongen Date: Fri, 13 Feb 2015 17:38:30 +0100 Subject: [PATCH 11/13] Delete Stage.java --- Stage.java | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 Stage.java diff --git a/Stage.java b/Stage.java deleted file mode 100644 index d58808e..0000000 --- a/Stage.java +++ /dev/null @@ -1,14 +0,0 @@ -import java.util.ArrayList; - - -public class Stage -{ - private ArrayList performances; - private int expectedPopularity; - private String description; - - public Stage() - { - - } -} From 1ed16ab22f1ee87fdfc11c0a9b6b4adc00ef1e3a Mon Sep 17 00:00:00 2001 From: guusvdongen Date: Fri, 13 Feb 2015 17:38:35 +0100 Subject: [PATCH 12/13] Delete Panel.java --- Panel.java | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 Panel.java diff --git a/Panel.java b/Panel.java deleted file mode 100644 index 43fdeae..0000000 --- a/Panel.java +++ /dev/null @@ -1,4 +0,0 @@ -public class Panel extends JPanel -{ - -} From a1520cf55c06bbbb2059a6903c83876f334a913c Mon Sep 17 00:00:00 2001 From: guusvdongen Date: Fri, 13 Feb 2015 17:38:40 +0100 Subject: [PATCH 13/13] Delete Data.java --- Data.java | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 Data.java diff --git a/Data.java b/Data.java deleted file mode 100644 index 148c48c..0000000 --- a/Data.java +++ /dev/null @@ -1,15 +0,0 @@ -import java.util.ArrayList; - - -public class Data -{ - private ArrayList stages; - private ArrayList events; - private ArrayList artists; - - public Data() - { - // TODO Auto-generated constructor stub - } - -}