Merge guus dev
This commit is contained in:
@@ -205,9 +205,9 @@ public class AddEventPanel extends JFrame{
|
||||
|
||||
String stageName = (String)stage2.getSelectedItem();
|
||||
|
||||
Stage stage = null;
|
||||
AgendaStage stage = null;
|
||||
|
||||
for(Stage s : agenda.getStages())
|
||||
for(AgendaStage s : agenda.getStages())
|
||||
{
|
||||
if (s.getName().equals(stageName))
|
||||
{
|
||||
|
||||
@@ -58,7 +58,7 @@ public class AddStagePanel extends JFrame{
|
||||
String description = descriptionTF.getText();
|
||||
|
||||
boolean alreadyExists = false;
|
||||
for (Stage stage : agenda.getStages())
|
||||
for (AgendaStage stage : agenda.getStages())
|
||||
{
|
||||
if (stage.getName().equals(name))
|
||||
{
|
||||
@@ -70,7 +70,7 @@ public class AddStagePanel extends JFrame{
|
||||
}
|
||||
else if ( alreadyExists == false )
|
||||
{
|
||||
Stage s = new Stage(name,description);
|
||||
AgendaStage s = new AgendaStage(name,description);
|
||||
agenda.addStage(s);
|
||||
JOptionPane.showMessageDialog(null, "Stage added!");
|
||||
setVisible(false);
|
||||
|
||||
+5
-5
@@ -17,17 +17,17 @@ public class Agenda implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1;
|
||||
|
||||
private ArrayList<Stage> stages;
|
||||
private ArrayList<AgendaStage> stages;
|
||||
private ArrayList<Event> events;
|
||||
private ArrayList<Artist> artists;
|
||||
|
||||
public Agenda() {
|
||||
stages = new ArrayList<Stage>();
|
||||
stages = new ArrayList<AgendaStage>();
|
||||
events = new ArrayList<Event>();
|
||||
artists = new ArrayList<Artist>();
|
||||
}
|
||||
|
||||
public void addStage(Stage stage){
|
||||
public void addStage(AgendaStage stage){
|
||||
stages.add(stage);
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public class Agenda implements Serializable {
|
||||
{
|
||||
return artists;
|
||||
}
|
||||
public ArrayList<Stage> getStages()
|
||||
public ArrayList<AgendaStage> getStages()
|
||||
{
|
||||
return stages;
|
||||
}
|
||||
@@ -179,7 +179,7 @@ public class Agenda implements Serializable {
|
||||
{
|
||||
boolean exists = false;
|
||||
String name = e.getStage().getName();
|
||||
for (Stage s : stages)
|
||||
for (AgendaStage s : stages)
|
||||
{
|
||||
if ( s.getName().equals(name) ) {
|
||||
exists = true;
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package Agenda;
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Stage implements Serializable {
|
||||
public class AgendaStage implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1;
|
||||
|
||||
private String name;
|
||||
private String description;
|
||||
|
||||
public Stage(String name, String description)
|
||||
public AgendaStage(String name, String description)
|
||||
{
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
@@ -221,9 +221,9 @@ public class EditEventPanel extends JFrame{
|
||||
|
||||
String stageName = (String)stage2.getSelectedItem();
|
||||
|
||||
Stage stage = null;
|
||||
AgendaStage stage = null;
|
||||
|
||||
for(Stage s : agenda.getStages())
|
||||
for(AgendaStage s : agenda.getStages())
|
||||
{
|
||||
if (s.getName().equals(stageName))
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@ public class EditStagePanel extends JFrame{
|
||||
|
||||
private static final long serialVersionUID = 1;
|
||||
|
||||
public EditStagePanel(Agenda agenda, Stage sta)
|
||||
public EditStagePanel(Agenda agenda, AgendaStage sta)
|
||||
{
|
||||
super("Stage editscreen!");
|
||||
setDefaultCloseOperation(HIDE_ON_CLOSE);
|
||||
@@ -59,7 +59,7 @@ public class EditStagePanel extends JFrame{
|
||||
String description = descriptionTF.getText();
|
||||
|
||||
boolean alreadyExists = false;
|
||||
for (Stage stage : agenda.getStages())
|
||||
for (AgendaStage stage : agenda.getStages())
|
||||
{
|
||||
if (stage.getName().equals(name) && !stage.equals(sta))
|
||||
{
|
||||
@@ -101,10 +101,10 @@ public class EditStagePanel extends JFrame{
|
||||
|
||||
if(JOptionPane.showConfirmDialog(null, "Are you sure you want to remove this stage?", "Remove Stage", JOptionPane.YES_NO_OPTION) == JOptionPane.OK_OPTION)
|
||||
{
|
||||
Iterator<Stage> it = agenda.getStages().iterator();
|
||||
Iterator<AgendaStage> it = agenda.getStages().iterator();
|
||||
while(it.hasNext())
|
||||
{
|
||||
Stage s = it.next();
|
||||
AgendaStage s = it.next();
|
||||
if(s.equals(sta))
|
||||
{
|
||||
it.remove();
|
||||
|
||||
+5
-5
@@ -19,13 +19,13 @@ public class Event implements Serializable {
|
||||
private int stopHour;
|
||||
private int stopMinute;
|
||||
private Artist artist;
|
||||
private Stage stage;
|
||||
private AgendaStage stage;
|
||||
private String description;
|
||||
private int expectedPopularity;
|
||||
|
||||
public Event(String eventName, int startYear, int startMonth, int startDay,
|
||||
int startHour, int startMinute, int endYear, int endMonth,
|
||||
int endDay, int endHour, int endMinute, Artist artist, Stage stage,
|
||||
int endDay, int endHour, int endMinute, Artist artist, AgendaStage stage,
|
||||
String description, int expectedPopularity) {
|
||||
this.eventName = eventName;
|
||||
this.startDate = new GregorianCalendar(startYear, startMonth - 1,
|
||||
@@ -43,7 +43,7 @@ public class Event implements Serializable {
|
||||
}
|
||||
|
||||
public Event(String eventName, GregorianCalendar startDate,
|
||||
GregorianCalendar endDate, Artist artist, Stage stage,
|
||||
GregorianCalendar endDate, Artist artist, AgendaStage stage,
|
||||
String description, int expectedPopularity) {
|
||||
this.eventName = eventName;
|
||||
this.startDate = startDate;
|
||||
@@ -86,7 +86,7 @@ public class Event implements Serializable {
|
||||
return this.description;
|
||||
}
|
||||
|
||||
public Stage getStage() {
|
||||
public AgendaStage getStage() {
|
||||
return this.stage;
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ public class Event implements Serializable {
|
||||
this.expectedPopularity = popularity;
|
||||
}
|
||||
|
||||
public void setStage(Stage stage) {
|
||||
public void setStage(AgendaStage stage) {
|
||||
this.stage = stage;
|
||||
}
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ public class PanelArtSta extends JPanel implements Panel{
|
||||
else
|
||||
{
|
||||
dataStage = new Object[1];
|
||||
dataStage[0] = new Stage("Geen Stages", "Geen Stages");
|
||||
dataStage[0] = new AgendaStage("Geen Stages", "Geen Stages");
|
||||
stages.setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,6 +60,16 @@ public class MenuBar extends JMenuBar
|
||||
|
||||
file.addSeparator();
|
||||
|
||||
item = new JMenuItem("Load agenda");
|
||||
item.addActionListener(new ActionListener() {
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
w.getPanel().agenda.loadAgenda();
|
||||
}
|
||||
});
|
||||
file.add(item);
|
||||
|
||||
item = new JMenuItem("Agenda");
|
||||
item.addActionListener(new ActionListener()
|
||||
{
|
||||
|
||||
+19
-3
@@ -28,14 +28,14 @@ import javax.swing.JPanel;
|
||||
import javax.swing.Timer;
|
||||
|
||||
import Agenda.Agenda;
|
||||
import Listeners.WindowFocusListener;
|
||||
import Agenda.AgendaStage;
|
||||
import Listeners.Mouse;
|
||||
import Listeners.MouseMotion;
|
||||
import Listeners.MouseWheel;
|
||||
import Listeners.WindowFocusListener;
|
||||
import Objects.DrawObject;
|
||||
import Objects.Entrance;
|
||||
import Objects.Food;
|
||||
import Objects.OldPath;
|
||||
import Objects.Path;
|
||||
import Objects.Stage;
|
||||
import Objects.Toilet;
|
||||
@@ -168,7 +168,23 @@ public class Panel extends JPanel implements ActionListener
|
||||
switch (index)
|
||||
{
|
||||
case 0:
|
||||
return new Stage(null);
|
||||
ArrayList<AgendaStage> stages = agenda.getStages();
|
||||
Object[] s = new Object[stages.size()];
|
||||
AgendaStage stage = null;
|
||||
if (stages.size() != 0) {
|
||||
for (int i = 0; i < stages.size(); i++) {
|
||||
s[i] = stages.get(i);
|
||||
}
|
||||
|
||||
stage = (AgendaStage) JOptionPane.showInputDialog(null,
|
||||
"Select the right Stage", "Select Stage",
|
||||
JOptionPane.PLAIN_MESSAGE, null, s, "stage");
|
||||
}
|
||||
if (stage != null){
|
||||
return new Stage(null, stage);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
case 1:
|
||||
return new Toilet(null);
|
||||
case 2:
|
||||
|
||||
+17
-11
@@ -45,14 +45,17 @@ public class Mouse extends MouseAdapter
|
||||
if (e.getX() >= panel.getScrollfactor() && e.getX() < last + image.getWidth() + panel.getScrollfactor())
|
||||
{
|
||||
DrawObject tempDrawObj = panel.createNewDrawObject(i);
|
||||
tempDrawObj.setPosition(clickPoint);
|
||||
if (!panel.getObjects().isEmpty())
|
||||
panel.clearObjectSelection();
|
||||
panel.setDragObject(tempDrawObj);
|
||||
panel.getDragObject().setSelected(true);
|
||||
panel.getPP().setSelected(tempDrawObj);
|
||||
panel.setSelectedObject(tempDrawObj);
|
||||
selectedObject = tempDrawObj;
|
||||
if (tempDrawObj != null)
|
||||
{
|
||||
tempDrawObj.setPosition(clickPoint);
|
||||
if (!panel.getObjects().isEmpty())
|
||||
panel.clearObjectSelection();
|
||||
panel.setDragObject(tempDrawObj);
|
||||
panel.getDragObject().setSelected(true);
|
||||
panel.getPP().setSelected(tempDrawObj);
|
||||
panel.setSelectedObject(tempDrawObj);
|
||||
selectedObject = tempDrawObj;
|
||||
}
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
@@ -71,7 +74,8 @@ public class Mouse extends MouseAdapter
|
||||
{
|
||||
if (SwingUtilities.isRightMouseButton(e))
|
||||
{
|
||||
if(o instanceof Waypoint){
|
||||
if (o instanceof Waypoint)
|
||||
{
|
||||
new WaypointPopup(o);
|
||||
}
|
||||
}
|
||||
@@ -137,8 +141,10 @@ public class Mouse extends MouseAdapter
|
||||
|
||||
public void mouseReleased(MouseEvent e)
|
||||
{
|
||||
if(panel.getDragObject() != null) {
|
||||
if(panel.getDragObject().getRectangleColor() != Color.RED) {
|
||||
if (panel.getDragObject() != null)
|
||||
{
|
||||
if (panel.getDragObject().getRectangleColor() != Color.RED)
|
||||
{
|
||||
panel.getDragObject().setPosition(panel.getDragObject().getPosition(), true);
|
||||
panel.getPP().update();
|
||||
panel.setDragObject(null);
|
||||
|
||||
+16
-1
@@ -2,11 +2,16 @@ package Objects;
|
||||
|
||||
import java.awt.geom.Point2D;
|
||||
|
||||
import Agenda.AgendaStage;
|
||||
|
||||
public class Stage extends DrawObject
|
||||
{
|
||||
public Stage(Point2D position)
|
||||
AgendaStage stage;
|
||||
|
||||
public Stage(Point2D position, AgendaStage st)
|
||||
{
|
||||
super("stage", position);
|
||||
stage = st;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -15,4 +20,14 @@ public class Stage extends DrawObject
|
||||
return "Stage";
|
||||
}
|
||||
|
||||
public AgendaStage getStage()
|
||||
{
|
||||
return stage;
|
||||
}
|
||||
|
||||
public void setStage(AgendaStage stage)
|
||||
{
|
||||
this.stage = stage;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user