Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4a9a1c869f | ||
|
|
58dd8b21be | ||
|
|
f9c25f406c | ||
|
|
43e2dca06e | ||
|
|
18b9510f04 | ||
|
|
ac9ccd1abd | ||
|
|
047770950f | ||
|
|
3ece3588e6 | ||
|
|
9ee421b792 | ||
|
|
9739ead0df | ||
|
|
e50d7cf29d | ||
|
|
1a3e8871a6 | ||
|
|
e001163a74 | ||
|
|
5363546c45 |
@@ -0,0 +1,125 @@
|
|||||||
|
import java.awt.BorderLayout;
|
||||||
|
import java.awt.FlowLayout;
|
||||||
|
import java.awt.GridLayout;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
|
||||||
|
import javax.swing.JButton;
|
||||||
|
import javax.swing.JFrame;
|
||||||
|
import javax.swing.JLabel;
|
||||||
|
import javax.swing.JOptionPane;
|
||||||
|
import javax.swing.JPanel;
|
||||||
|
import javax.swing.JTextField;
|
||||||
|
|
||||||
|
|
||||||
|
public class AddArtistPanel extends JFrame{
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1;
|
||||||
|
|
||||||
|
public AddArtistPanel(Agenda agenda)
|
||||||
|
{
|
||||||
|
super("Artist addscreen!");
|
||||||
|
setDefaultCloseOperation(HIDE_ON_CLOSE);
|
||||||
|
JPanel content = new JPanel(new BorderLayout());
|
||||||
|
JPanel south = new JPanel(new FlowLayout());
|
||||||
|
JPanel center = new JPanel(new GridLayout(5,2));
|
||||||
|
content.add(south, BorderLayout.SOUTH);
|
||||||
|
content.add(center, BorderLayout.CENTER);
|
||||||
|
|
||||||
|
JPanel panel1 = new JPanel();
|
||||||
|
JLabel name = new JLabel("Artist name: ");
|
||||||
|
panel1.add(name);
|
||||||
|
center.add(panel1);
|
||||||
|
|
||||||
|
JPanel panel2 = new JPanel();
|
||||||
|
JTextField nameTF = new JTextField("",15);
|
||||||
|
panel2.add(nameTF);
|
||||||
|
center.add(panel2);
|
||||||
|
|
||||||
|
JLabel genre = new JLabel("Genre: ");
|
||||||
|
JPanel panel3 = new JPanel();
|
||||||
|
panel3.add(genre);
|
||||||
|
center.add(panel3);
|
||||||
|
|
||||||
|
JTextField genreTF = new JTextField("",15);
|
||||||
|
JPanel panel4 = new JPanel();
|
||||||
|
panel4.add(genreTF);
|
||||||
|
center.add(panel4);
|
||||||
|
|
||||||
|
JPanel panel5 = new JPanel();
|
||||||
|
JLabel image = new JLabel("Image: ");
|
||||||
|
panel5.add(image);
|
||||||
|
center.add(panel5);
|
||||||
|
|
||||||
|
JPanel panel6 = new JPanel();
|
||||||
|
JTextField imageTF = new JTextField("null", 15);
|
||||||
|
panel6.add(imageTF);
|
||||||
|
center.add(panel6);
|
||||||
|
|
||||||
|
JPanel panel7 = new JPanel();
|
||||||
|
JLabel description = new JLabel("Description: ");
|
||||||
|
panel7.add(description);
|
||||||
|
center.add(panel7);
|
||||||
|
|
||||||
|
JPanel panel8 = new JPanel();
|
||||||
|
JTextField descriptionTF = new JTextField("", 15);
|
||||||
|
panel8.add(descriptionTF);
|
||||||
|
center.add(panel8);
|
||||||
|
|
||||||
|
JPanel panel9 = new JPanel();
|
||||||
|
JLabel background = new JLabel("Background: ");
|
||||||
|
panel9.add(background);
|
||||||
|
center.add(panel9);
|
||||||
|
|
||||||
|
JPanel panel10 = new JPanel();
|
||||||
|
JTextField backgroundTF = new JTextField("", 15);
|
||||||
|
panel10.add(backgroundTF);
|
||||||
|
center.add(panel10);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
JButton add = new JButton("Add artist!");
|
||||||
|
south.add(add);
|
||||||
|
|
||||||
|
add.addActionListener(new ActionListener()
|
||||||
|
{
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
String name = nameTF.getText();
|
||||||
|
String genre = genreTF.getText();
|
||||||
|
String image = imageTF.getText();
|
||||||
|
String description = descriptionTF.getText();
|
||||||
|
String background = backgroundTF.getText();
|
||||||
|
|
||||||
|
boolean alreadyExists = false;
|
||||||
|
for (Artist artist : agenda.getArtists())
|
||||||
|
{
|
||||||
|
if (artist.getName().equals(name))
|
||||||
|
{
|
||||||
|
alreadyExists = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (name.isEmpty() == true){
|
||||||
|
JOptionPane.showMessageDialog(null, "Fill in a correct name!");
|
||||||
|
}
|
||||||
|
else if (alreadyExists == false)
|
||||||
|
{
|
||||||
|
Artist a = new Artist(name,genre,image,description, background);
|
||||||
|
agenda.addArtist(a);
|
||||||
|
JOptionPane.showMessageDialog(null, "Artist added!");
|
||||||
|
setVisible(false);
|
||||||
|
dispose();
|
||||||
|
Window.updatePanel();
|
||||||
|
} else {
|
||||||
|
JOptionPane.showMessageDialog(null, "Choose a different artist name!");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
setContentPane(content);
|
||||||
|
setVisible(true);
|
||||||
|
setSize(500,320);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,307 @@
|
|||||||
|
import java.awt.BorderLayout;
|
||||||
|
import java.awt.FlowLayout;
|
||||||
|
import java.awt.GridLayout;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
|
||||||
|
import javax.swing.JButton;
|
||||||
|
import javax.swing.JComboBox;
|
||||||
|
import javax.swing.JFrame;
|
||||||
|
import javax.swing.JLabel;
|
||||||
|
import javax.swing.JOptionPane;
|
||||||
|
import javax.swing.JPanel;
|
||||||
|
import javax.swing.JSeparator;
|
||||||
|
import javax.swing.JTextField;
|
||||||
|
import javax.swing.SwingConstants;
|
||||||
|
|
||||||
|
|
||||||
|
public class AddEventPanel extends JFrame{
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1;
|
||||||
|
|
||||||
|
public AddEventPanel(Agenda agenda)
|
||||||
|
{
|
||||||
|
super("Event addscreen!");
|
||||||
|
setDefaultCloseOperation(HIDE_ON_CLOSE);
|
||||||
|
JPanel content = new JPanel(new BorderLayout());
|
||||||
|
JPanel south = new JPanel(new FlowLayout());
|
||||||
|
JPanel center = new JPanel(new GridLayout(7,2));
|
||||||
|
content.add(south, BorderLayout.SOUTH);
|
||||||
|
content.add(center, BorderLayout.CENTER);
|
||||||
|
|
||||||
|
GregorianCalendar today = new GregorianCalendar();
|
||||||
|
|
||||||
|
JPanel panel1 = new JPanel();
|
||||||
|
JLabel name = new JLabel("Event name: ");
|
||||||
|
panel1.add(name);
|
||||||
|
center.add(panel1);
|
||||||
|
|
||||||
|
JPanel panel2 = new JPanel();
|
||||||
|
JTextField nameTF = new JTextField("",15);
|
||||||
|
panel2.add(nameTF);
|
||||||
|
center.add(panel2);
|
||||||
|
|
||||||
|
JLabel starttime = new JLabel("Starttime: ");
|
||||||
|
JPanel panel3 = new JPanel();
|
||||||
|
panel3.add(starttime);
|
||||||
|
center.add(panel3);
|
||||||
|
|
||||||
|
Integer[] hours = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23 };
|
||||||
|
JComboBox<Integer> hour = new JComboBox<Integer>(hours);
|
||||||
|
hour.setSelectedIndex(today.get(GregorianCalendar.HOUR_OF_DAY));
|
||||||
|
JPanel panel4 = new JPanel();
|
||||||
|
panel4.add(hour);
|
||||||
|
center.add(panel4);
|
||||||
|
|
||||||
|
Integer[] minutes = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59};
|
||||||
|
JComboBox<Integer> minute = new JComboBox<Integer>(minutes);
|
||||||
|
minute.setSelectedIndex(today.get(GregorianCalendar.MINUTE));
|
||||||
|
panel4.add(minute);
|
||||||
|
panel4.add(new JSeparator(SwingConstants.VERTICAL));
|
||||||
|
panel4.add(new JSeparator(SwingConstants.VERTICAL));
|
||||||
|
|
||||||
|
|
||||||
|
Integer[] days = { 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
|
||||||
|
JComboBox<Integer> day = new JComboBox<Integer>(days);
|
||||||
|
day.setSelectedIndex(today.get(GregorianCalendar.DAY_OF_MONTH) - 1);
|
||||||
|
panel4.add(day);
|
||||||
|
|
||||||
|
String[] months = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"};
|
||||||
|
JComboBox<String> month = new JComboBox<String>(months);
|
||||||
|
month.setSelectedIndex(today.get(GregorianCalendar.MONTH));
|
||||||
|
panel4.add(month);
|
||||||
|
|
||||||
|
|
||||||
|
Integer[] years = { 2015,2016,2017,2018};
|
||||||
|
JComboBox<Integer> year = new JComboBox<Integer>(years);
|
||||||
|
panel4.add(year);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
JPanel panel5 = new JPanel();
|
||||||
|
JLabel endtime = new JLabel("Endtime: ");
|
||||||
|
panel5.add(endtime);
|
||||||
|
center.add(panel5);
|
||||||
|
|
||||||
|
JComboBox<Integer> hourE = new JComboBox<Integer>(hours);
|
||||||
|
hourE.setSelectedIndex(today.get(GregorianCalendar.HOUR_OF_DAY));
|
||||||
|
JPanel panel6 = new JPanel();
|
||||||
|
panel6.add(hourE);
|
||||||
|
center.add(panel6);
|
||||||
|
|
||||||
|
JComboBox<Integer> minuteE = new JComboBox<Integer>(minutes);
|
||||||
|
minuteE.setSelectedIndex(today.get(GregorianCalendar.MINUTE));
|
||||||
|
panel6.add(minuteE);
|
||||||
|
panel6.add(new JSeparator(SwingConstants.VERTICAL));
|
||||||
|
panel6.add(new JSeparator(SwingConstants.VERTICAL));
|
||||||
|
|
||||||
|
|
||||||
|
JComboBox<Integer> dayE = new JComboBox<Integer>(days);
|
||||||
|
dayE.setSelectedIndex(today.get(GregorianCalendar.DAY_OF_MONTH) - 1);
|
||||||
|
panel6.add(dayE);
|
||||||
|
|
||||||
|
JComboBox<String> monthE = new JComboBox<String>(months);
|
||||||
|
monthE.setSelectedIndex(today.get(GregorianCalendar.MONTH));
|
||||||
|
panel6.add(monthE);
|
||||||
|
|
||||||
|
|
||||||
|
JComboBox<Integer> yearE = new JComboBox<Integer>(years);
|
||||||
|
panel6.add(yearE);
|
||||||
|
|
||||||
|
|
||||||
|
JPanel panel7 = new JPanel();
|
||||||
|
JLabel artist2 = new JLabel("Artist: ");
|
||||||
|
panel7.add(artist2);
|
||||||
|
center.add(panel7);
|
||||||
|
|
||||||
|
JPanel panel8 = new JPanel();
|
||||||
|
String[] artists = new String[agenda.getArtists().size()];
|
||||||
|
|
||||||
|
for ( int idx = 0; idx < agenda.getArtists().size(); idx ++)
|
||||||
|
{
|
||||||
|
artists[idx] = agenda.getArtists().get(idx).getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
JComboBox<String> artist = new JComboBox<String>(artists);
|
||||||
|
panel8.add(artist);
|
||||||
|
center.add(panel8);
|
||||||
|
|
||||||
|
JPanel panel9 = new JPanel();
|
||||||
|
JLabel stage = new JLabel("Stage: ");
|
||||||
|
panel9.add(stage);
|
||||||
|
center.add(panel9);
|
||||||
|
|
||||||
|
JPanel panel10 = new JPanel();
|
||||||
|
String[] stages = new String[agenda.getStages().size()];
|
||||||
|
|
||||||
|
for ( int idx = 0; idx < agenda.getStages().size(); idx ++)
|
||||||
|
{
|
||||||
|
stages[idx] = agenda.getStages().get(idx).getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
JComboBox<String> stage2 = new JComboBox<String>(stages);
|
||||||
|
panel10.add(stage2);
|
||||||
|
center.add(panel10);
|
||||||
|
|
||||||
|
JPanel panel11 = new JPanel();
|
||||||
|
JLabel description = new JLabel("Description: ");
|
||||||
|
panel11.add(description);
|
||||||
|
center.add(panel11);
|
||||||
|
|
||||||
|
JPanel panel12 = new JPanel();
|
||||||
|
JTextField descriptionTF = new JTextField("",15);
|
||||||
|
panel12.add(descriptionTF);
|
||||||
|
center.add(panel12);
|
||||||
|
|
||||||
|
JPanel panel13 = new JPanel();
|
||||||
|
JLabel expectedPopularity = new JLabel("Expected Popularity: ");
|
||||||
|
panel13.add(expectedPopularity);
|
||||||
|
center.add(panel13);
|
||||||
|
|
||||||
|
JPanel panel14 = new JPanel();
|
||||||
|
Integer[] eps= { 1,2,3,4,5,6,7,8,9,10};
|
||||||
|
JComboBox<Integer> ep = new JComboBox<Integer>(eps);
|
||||||
|
panel14.add(ep);
|
||||||
|
center.add(panel14);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
JButton add = new JButton("Add event!");
|
||||||
|
south.add(add);
|
||||||
|
|
||||||
|
add.addActionListener(new ActionListener()
|
||||||
|
{
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
boolean everythingCorrect = true;
|
||||||
|
String name = nameTF.getText();
|
||||||
|
|
||||||
|
int hourS = hour.getSelectedIndex();
|
||||||
|
int minuteS = minute.getSelectedIndex();
|
||||||
|
int dayS = day.getSelectedIndex() + 1;
|
||||||
|
String monthS = (String) month.getSelectedItem();
|
||||||
|
int yearS = year.getSelectedIndex() + 2015;
|
||||||
|
|
||||||
|
int hourEnd = hourE.getSelectedIndex();
|
||||||
|
int minuteEnd = minuteE.getSelectedIndex();
|
||||||
|
int dayEnd = dayE.getSelectedIndex() + 1;
|
||||||
|
String monthEnd = (String) monthE.getSelectedItem();
|
||||||
|
int yearEnd = yearE.getSelectedIndex() + 2015;
|
||||||
|
|
||||||
|
String artistName = (String)artist.getSelectedItem();
|
||||||
|
|
||||||
|
Artist artist = null;
|
||||||
|
|
||||||
|
for(Artist a : agenda.getArtists())
|
||||||
|
{
|
||||||
|
if (a.getName().equals(artistName))
|
||||||
|
{
|
||||||
|
artist = a;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String stageName = (String)stage2.getSelectedItem();
|
||||||
|
|
||||||
|
Stage stage = null;
|
||||||
|
|
||||||
|
for(Stage s : agenda.getStages())
|
||||||
|
{
|
||||||
|
if (s.getName().equals(stageName))
|
||||||
|
{
|
||||||
|
stage = s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String description = descriptionTF.getText();
|
||||||
|
|
||||||
|
int popularity = ep.getSelectedIndex() + 1;
|
||||||
|
|
||||||
|
if (dayS > monthDays(monthS)){
|
||||||
|
everythingCorrect = false;
|
||||||
|
JOptionPane.showMessageDialog(null, "Invalid Date!");
|
||||||
|
}
|
||||||
|
else if (yearS > yearEnd || monthToInt(monthS) > monthToInt(monthEnd) || dayS > dayEnd || hourS > hourEnd || minuteS > minuteEnd){
|
||||||
|
everythingCorrect = false;
|
||||||
|
JOptionPane.showMessageDialog(null, "End time is earlier then start time!");
|
||||||
|
}
|
||||||
|
else if (dayS != dayEnd || monthS.equals(monthEnd) == false || yearS != yearEnd){
|
||||||
|
everythingCorrect = false;
|
||||||
|
JOptionPane.showMessageDialog(null, "Event is too long! It can't be longer than a single day.");
|
||||||
|
} else if (name.isEmpty()){
|
||||||
|
everythingCorrect = false;
|
||||||
|
JOptionPane.showMessageDialog(null, "Fill in a correct name!");
|
||||||
|
} else if (stage == null){
|
||||||
|
everythingCorrect = false;
|
||||||
|
JOptionPane.showMessageDialog(null, "Missing a stage!");
|
||||||
|
} else if (artist == null){
|
||||||
|
JOptionPane.showMessageDialog(null, "Missing a artist!");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (everythingCorrect == true)
|
||||||
|
{
|
||||||
|
Event event = new Event(name,yearS,monthToInt(monthS),dayS,hourS,minuteS,yearEnd,monthToInt(monthEnd),dayEnd,hourEnd, minuteEnd, artist, stage,description, popularity);
|
||||||
|
agenda.addEvent(event);
|
||||||
|
everythingCorrect = false;
|
||||||
|
JOptionPane.showMessageDialog(null, "Event added!");
|
||||||
|
setVisible(false);
|
||||||
|
dispose();
|
||||||
|
Window.updatePanel();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
setContentPane(content);
|
||||||
|
setVisible(true);
|
||||||
|
setSize(700,320);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public int monthToInt(String month)
|
||||||
|
{
|
||||||
|
int number = 0;
|
||||||
|
switch (month)
|
||||||
|
{
|
||||||
|
case "January": number = 1; break;
|
||||||
|
case "February": number = 2; break;
|
||||||
|
case "March": number = 3; break;
|
||||||
|
case "April": number = 4; break;
|
||||||
|
case "May": number = 5; break;
|
||||||
|
case "June":number = 6; break;
|
||||||
|
case "July": number = 7; break;
|
||||||
|
case "August": number = 8; break;
|
||||||
|
case "September":number = 9; break;
|
||||||
|
case "October": number = 10; break;
|
||||||
|
case "November": number = 11; break;
|
||||||
|
case "December": number = 12; break;
|
||||||
|
}
|
||||||
|
return number;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int monthDays(String month)
|
||||||
|
{
|
||||||
|
int number = 0;
|
||||||
|
switch (month)
|
||||||
|
{
|
||||||
|
case "January": number = 31; break;
|
||||||
|
case "February": number = 28; break;
|
||||||
|
case "March": number = 31; break;
|
||||||
|
case "April": number = 30; break;
|
||||||
|
case "May": number = 31; break;
|
||||||
|
case "June":number = 30; break;
|
||||||
|
case "July": number = 31; break;
|
||||||
|
case "August": number = 31; break;
|
||||||
|
case "September":number = 30; break;
|
||||||
|
case "October": number = 31; break;
|
||||||
|
case "November": number = 30; break;
|
||||||
|
case "December": number = 31; break;
|
||||||
|
}
|
||||||
|
return number;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
import java.awt.BorderLayout;
|
||||||
|
import java.awt.FlowLayout;
|
||||||
|
import java.awt.GridLayout;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
|
||||||
|
import javax.swing.JButton;
|
||||||
|
import javax.swing.JFrame;
|
||||||
|
import javax.swing.JLabel;
|
||||||
|
import javax.swing.JOptionPane;
|
||||||
|
import javax.swing.JPanel;
|
||||||
|
import javax.swing.JTextField;
|
||||||
|
|
||||||
|
|
||||||
|
public class AddStagePanel extends JFrame{
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1;
|
||||||
|
|
||||||
|
public AddStagePanel(Agenda agenda)
|
||||||
|
{
|
||||||
|
super("Stage addscreen!");
|
||||||
|
setDefaultCloseOperation(HIDE_ON_CLOSE);
|
||||||
|
JPanel content = new JPanel(new BorderLayout());
|
||||||
|
JPanel south = new JPanel(new FlowLayout());
|
||||||
|
JPanel center = new JPanel(new GridLayout(2,2));
|
||||||
|
content.add(south, BorderLayout.SOUTH);
|
||||||
|
content.add(center, BorderLayout.CENTER);
|
||||||
|
|
||||||
|
JPanel panel1 = new JPanel();
|
||||||
|
JLabel name = new JLabel("Stage name: ");
|
||||||
|
panel1.add(name);
|
||||||
|
center.add(panel1);
|
||||||
|
|
||||||
|
JPanel panel2 = new JPanel();
|
||||||
|
JTextField nameTF = new JTextField("",15);
|
||||||
|
panel2.add(nameTF);
|
||||||
|
center.add(panel2);
|
||||||
|
|
||||||
|
JLabel description = new JLabel("Stage Description: ");
|
||||||
|
JPanel panel3 = new JPanel();
|
||||||
|
panel3.add(description);
|
||||||
|
center.add(panel3);
|
||||||
|
|
||||||
|
JTextField descriptionTF = new JTextField("",15);
|
||||||
|
JPanel panel4 = new JPanel();
|
||||||
|
panel4.add(descriptionTF);
|
||||||
|
center.add(panel4);
|
||||||
|
|
||||||
|
|
||||||
|
JButton add = new JButton("Add stage!");
|
||||||
|
south.add(add);
|
||||||
|
|
||||||
|
add.addActionListener(new ActionListener()
|
||||||
|
{
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
String name = nameTF.getText();
|
||||||
|
String description = descriptionTF.getText();
|
||||||
|
|
||||||
|
boolean alreadyExists = false;
|
||||||
|
for (Stage stage : agenda.getStages())
|
||||||
|
{
|
||||||
|
if (stage.getName().equals(name))
|
||||||
|
{
|
||||||
|
alreadyExists = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (name.isEmpty()){
|
||||||
|
JOptionPane.showMessageDialog(null, "Fill in a correct name!");
|
||||||
|
}
|
||||||
|
else if ( alreadyExists == false )
|
||||||
|
{
|
||||||
|
Stage s = new Stage(name,description);
|
||||||
|
agenda.addStage(s);
|
||||||
|
JOptionPane.showMessageDialog(null, "Stage added!");
|
||||||
|
setVisible(false);
|
||||||
|
dispose();
|
||||||
|
Window.updatePanel();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
JOptionPane.showMessageDialog(null, "Choose a different stage name!");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
setContentPane(content);
|
||||||
|
setVisible(true);
|
||||||
|
setSize(400,180);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -211,6 +211,8 @@ public class Agenda implements Serializable {
|
|||||||
public void clearAgenda()
|
public void clearAgenda()
|
||||||
{
|
{
|
||||||
events.clear();
|
events.clear();
|
||||||
|
stages.clear();
|
||||||
|
artists.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void fillAllLists()
|
public void fillAllLists()
|
||||||
|
|||||||
+22
-3
@@ -1,9 +1,14 @@
|
|||||||
|
|
||||||
|
|
||||||
import java.awt.BorderLayout;
|
import java.awt.BorderLayout;
|
||||||
|
import java.awt.Dimension;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
|
||||||
|
import javax.swing.Box;
|
||||||
import javax.swing.BoxLayout;
|
import javax.swing.BoxLayout;
|
||||||
|
import javax.swing.JButton;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import javax.swing.JSeparator;
|
import javax.swing.JSeparator;
|
||||||
@@ -11,21 +16,35 @@ import javax.swing.SwingConstants;
|
|||||||
|
|
||||||
public class ArtistPanel extends JPanel{
|
public class ArtistPanel extends JPanel{
|
||||||
|
|
||||||
public ArtistPanel(Event event)
|
public ArtistPanel(Event event, Agenda a, TabbedPane tab)
|
||||||
{
|
{
|
||||||
super(new BorderLayout());
|
super(new BorderLayout());
|
||||||
JLabel name = new JLabel(event.getArtist().getName());
|
JLabel name = new JLabel(event.getArtist().getName());
|
||||||
|
JButton edit = new JButton("Edit Info");
|
||||||
|
edit.addActionListener(new ActionListener(){
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e)
|
||||||
|
{
|
||||||
|
EditArtistPanel editter = new EditArtistPanel(a, event.getArtist(), tab);
|
||||||
|
}
|
||||||
|
});
|
||||||
name.setFont(new Font("Dialog", Font.BOLD, 20));
|
name.setFont(new Font("Dialog", Font.BOLD, 20));
|
||||||
JLabel description = new JLabel("<html>" + " <b> Genre: </b> " + event.getArtist().getGenre() + "<br> <br> <b> Beschrijving </b> <br> <br>" + event.getArtist().getDescription() + " <br> <br> <b> achtergrondinfo </b> <br> <br>" + event.getArtist().getBackground() + "</html>");
|
JLabel description = new JLabel("<html>" + " <b> Genre: </b> " + event.getArtist().getGenre() + "<br> <br> <b> Beschrijving </b> <br> <br>" + event.getArtist().getDescription() + " <br> <br> <b> achtergrondinfo </b> <br> <br>" + event.getArtist().getBackground() + "</html>");
|
||||||
description.setFont(new Font("Dialog", Font.PLAIN, 12));
|
description.setFont(new Font("Dialog", Font.PLAIN, 12));
|
||||||
JPanel panel = new JPanel();
|
JPanel panel = new JPanel();
|
||||||
panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS));
|
panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS));
|
||||||
|
JPanel panel2 = new JPanel();
|
||||||
|
panel2.setLayout(new BoxLayout(panel2, BoxLayout.LINE_AXIS));
|
||||||
|
panel2.setAlignmentX(LEFT_ALIGNMENT);
|
||||||
JLabel photo = new JLabel(event.getArtist().getImage());
|
JLabel photo = new JLabel(event.getArtist().getImage());
|
||||||
panel.add(name);
|
panel2.add(name);
|
||||||
|
panel2.add(Box.createRigidArea(new Dimension(10,0)));
|
||||||
|
panel2.add(edit);
|
||||||
|
panel.add(panel2);
|
||||||
panel.add(new JSeparator(SwingConstants.HORIZONTAL));
|
panel.add(new JSeparator(SwingConstants.HORIZONTAL));
|
||||||
add(photo, BorderLayout.EAST);
|
add(photo, BorderLayout.EAST);
|
||||||
add(description, BorderLayout.CENTER);
|
add(description, BorderLayout.CENTER);
|
||||||
add(panel, BorderLayout.NORTH);
|
add(panel, BorderLayout.NORTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,181 @@
|
|||||||
|
import java.awt.BorderLayout;
|
||||||
|
import java.awt.FlowLayout;
|
||||||
|
import java.awt.GridLayout;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
import java.util.Iterator;
|
||||||
|
|
||||||
|
import javax.swing.JButton;
|
||||||
|
import javax.swing.JFrame;
|
||||||
|
import javax.swing.JLabel;
|
||||||
|
import javax.swing.JOptionPane;
|
||||||
|
import javax.swing.JPanel;
|
||||||
|
import javax.swing.JTextField;
|
||||||
|
|
||||||
|
public class EditArtistPanel extends JFrame {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1;
|
||||||
|
|
||||||
|
public EditArtistPanel(Agenda agenda, Artist art, TabbedPane tab)
|
||||||
|
{
|
||||||
|
super("Artist editscreen!");
|
||||||
|
setDefaultCloseOperation(HIDE_ON_CLOSE);
|
||||||
|
JPanel content = new JPanel(new BorderLayout());
|
||||||
|
JPanel south = new JPanel(new FlowLayout());
|
||||||
|
JPanel center = new JPanel(new GridLayout(5,2));
|
||||||
|
content.add(south, BorderLayout.SOUTH);
|
||||||
|
content.add(center, BorderLayout.CENTER);
|
||||||
|
|
||||||
|
JPanel panel1 = new JPanel();
|
||||||
|
JLabel name = new JLabel("Artist name: ");
|
||||||
|
panel1.add(name);
|
||||||
|
center.add(panel1);
|
||||||
|
|
||||||
|
JPanel panel2 = new JPanel();
|
||||||
|
JTextField nameTF = new JTextField(art.getName(),15);
|
||||||
|
panel2.add(nameTF);
|
||||||
|
center.add(panel2);
|
||||||
|
|
||||||
|
JLabel genre = new JLabel("Genre: ");
|
||||||
|
JPanel panel3 = new JPanel();
|
||||||
|
panel3.add(genre);
|
||||||
|
center.add(panel3);
|
||||||
|
|
||||||
|
JTextField genreTF = new JTextField(art.getGenre(),15);
|
||||||
|
JPanel panel4 = new JPanel();
|
||||||
|
panel4.add(genreTF);
|
||||||
|
center.add(panel4);
|
||||||
|
|
||||||
|
JPanel panel5 = new JPanel();
|
||||||
|
JLabel image = new JLabel("Image: ");
|
||||||
|
panel5.add(image);
|
||||||
|
center.add(panel5);
|
||||||
|
|
||||||
|
JPanel panel6 = new JPanel();
|
||||||
|
JTextField imageTF = new JTextField("null", 15);
|
||||||
|
panel6.add(imageTF);
|
||||||
|
center.add(panel6);
|
||||||
|
|
||||||
|
JPanel panel7 = new JPanel();
|
||||||
|
JLabel description = new JLabel("Description: ");
|
||||||
|
panel7.add(description);
|
||||||
|
center.add(panel7);
|
||||||
|
|
||||||
|
JPanel panel8 = new JPanel();
|
||||||
|
JTextField descriptionTF = new JTextField(art.getDescription(), 15);
|
||||||
|
panel8.add(descriptionTF);
|
||||||
|
center.add(panel8);
|
||||||
|
|
||||||
|
JPanel panel9 = new JPanel();
|
||||||
|
JLabel background = new JLabel("Background: ");
|
||||||
|
panel9.add(background);
|
||||||
|
center.add(panel9);
|
||||||
|
|
||||||
|
JPanel panel10 = new JPanel();
|
||||||
|
JTextField backgroundTF = new JTextField(art.getBackground(), 15);
|
||||||
|
panel10.add(backgroundTF);
|
||||||
|
center.add(panel10);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
JButton edit = new JButton("Edit artist!");
|
||||||
|
south.add(edit);
|
||||||
|
|
||||||
|
edit.addActionListener(new ActionListener()
|
||||||
|
{
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
String name = nameTF.getText();
|
||||||
|
String genre = genreTF.getText();
|
||||||
|
String image = imageTF.getText();
|
||||||
|
String description = descriptionTF.getText();
|
||||||
|
String background = backgroundTF.getText();
|
||||||
|
|
||||||
|
boolean alreadyExists = false;
|
||||||
|
for (Artist artist : agenda.getArtists())
|
||||||
|
{
|
||||||
|
if (artist.getName().equals(name) && !artist.equals(art))
|
||||||
|
{
|
||||||
|
alreadyExists = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (name.isEmpty() == true){
|
||||||
|
JOptionPane.showMessageDialog(null, "Fill in a correct name!");
|
||||||
|
}
|
||||||
|
else if (alreadyExists == false)
|
||||||
|
{
|
||||||
|
art.setName(name);
|
||||||
|
art.setGenre(genre);
|
||||||
|
art.setImageIconString(image);
|
||||||
|
art.setDescription(description);
|
||||||
|
art.setBackground(background);
|
||||||
|
JOptionPane.showMessageDialog(null, "Artist edited!");
|
||||||
|
setVisible(false);
|
||||||
|
dispose();
|
||||||
|
Window.updatePanel();
|
||||||
|
if(tab != null)
|
||||||
|
{
|
||||||
|
tab.setVisible(false);
|
||||||
|
tab.dispose();
|
||||||
|
Event eventartist = null;
|
||||||
|
for(Event event: agenda.getEvents())
|
||||||
|
{
|
||||||
|
if (event.getArtist().getName().equals(name))
|
||||||
|
{
|
||||||
|
eventartist = event;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
TabbedPane panel = new TabbedPane(agenda, eventartist, false);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
JOptionPane.showMessageDialog(null, "Choose a different artist name!");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
JButton remove = new JButton("Remove artist!");
|
||||||
|
for(Event e : agenda.getEvents())
|
||||||
|
{
|
||||||
|
if(e.getArtist().equals(art))
|
||||||
|
{
|
||||||
|
remove.setEnabled(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
south.add(remove);
|
||||||
|
|
||||||
|
remove.addActionListener(new ActionListener()
|
||||||
|
{
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
|
||||||
|
if(JOptionPane.showConfirmDialog(null, "Are you sure you want to remove this artist?", "Remove Artist", JOptionPane.YES_NO_OPTION) == JOptionPane.OK_OPTION)
|
||||||
|
{
|
||||||
|
Iterator<Artist> it = agenda.getArtists().iterator();
|
||||||
|
while(it.hasNext())
|
||||||
|
{
|
||||||
|
Artist a = it.next();
|
||||||
|
if(a.equals(art))
|
||||||
|
{
|
||||||
|
it.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
JOptionPane.showMessageDialog(null, "Artist removed!");
|
||||||
|
setVisible(false);
|
||||||
|
dispose();
|
||||||
|
Window.updatePanel();
|
||||||
|
if(tab != null)
|
||||||
|
{
|
||||||
|
tab.setVisible(false);
|
||||||
|
tab.dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
setContentPane(content);
|
||||||
|
setVisible(true);
|
||||||
|
setSize(500,320);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,375 @@
|
|||||||
|
import java.awt.BorderLayout;
|
||||||
|
import java.awt.FlowLayout;
|
||||||
|
import java.awt.GridLayout;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.Iterator;
|
||||||
|
|
||||||
|
import javax.swing.JButton;
|
||||||
|
import javax.swing.JComboBox;
|
||||||
|
import javax.swing.JFrame;
|
||||||
|
import javax.swing.JLabel;
|
||||||
|
import javax.swing.JOptionPane;
|
||||||
|
import javax.swing.JPanel;
|
||||||
|
import javax.swing.JSeparator;
|
||||||
|
import javax.swing.JTextField;
|
||||||
|
import javax.swing.SwingConstants;
|
||||||
|
|
||||||
|
|
||||||
|
public class EditEventPanel extends JFrame{
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1;
|
||||||
|
|
||||||
|
public EditEventPanel(Agenda agenda, Event e, TabbedPane tab)
|
||||||
|
{
|
||||||
|
super("Event editscreen!");
|
||||||
|
setDefaultCloseOperation(HIDE_ON_CLOSE);
|
||||||
|
JPanel content = new JPanel(new BorderLayout());
|
||||||
|
JPanel south = new JPanel(new FlowLayout());
|
||||||
|
JPanel center = new JPanel(new GridLayout(7,2));
|
||||||
|
content.add(south, BorderLayout.SOUTH);
|
||||||
|
content.add(center, BorderLayout.CENTER);
|
||||||
|
|
||||||
|
|
||||||
|
JPanel panel1 = new JPanel();
|
||||||
|
JLabel name = new JLabel("Event name: ");
|
||||||
|
panel1.add(name);
|
||||||
|
center.add(panel1);
|
||||||
|
|
||||||
|
JPanel panel2 = new JPanel();
|
||||||
|
JTextField nameTF = new JTextField(e.getEventName(),15);
|
||||||
|
panel2.add(nameTF);
|
||||||
|
center.add(panel2);
|
||||||
|
|
||||||
|
JLabel starttime = new JLabel("Starttime: ");
|
||||||
|
JPanel panel3 = new JPanel();
|
||||||
|
panel3.add(starttime);
|
||||||
|
center.add(panel3);
|
||||||
|
|
||||||
|
Integer[] hours = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23 };
|
||||||
|
JComboBox<Integer> hour = new JComboBox<Integer>(hours);
|
||||||
|
hour.setSelectedIndex(e.getStartDate().get(GregorianCalendar.HOUR_OF_DAY));
|
||||||
|
JPanel panel4 = new JPanel();
|
||||||
|
panel4.add(hour);
|
||||||
|
center.add(panel4);
|
||||||
|
|
||||||
|
Integer[] minutes = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59};
|
||||||
|
JComboBox<Integer> minute = new JComboBox<Integer>(minutes);
|
||||||
|
minute.setSelectedIndex(e.getStartDate().get(GregorianCalendar.MINUTE));
|
||||||
|
panel4.add(minute);
|
||||||
|
panel4.add(new JSeparator(SwingConstants.VERTICAL));
|
||||||
|
panel4.add(new JSeparator(SwingConstants.VERTICAL));
|
||||||
|
|
||||||
|
|
||||||
|
Integer[] days = { 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
|
||||||
|
JComboBox<Integer> day = new JComboBox<Integer>(days);
|
||||||
|
day.setSelectedIndex(e.getStartDate().get(GregorianCalendar.DAY_OF_MONTH) - 1);
|
||||||
|
panel4.add(day);
|
||||||
|
|
||||||
|
String[] months = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"};
|
||||||
|
JComboBox<String> month = new JComboBox<String>(months);
|
||||||
|
month.setSelectedIndex(e.getStartDate().get(GregorianCalendar.MONTH));
|
||||||
|
panel4.add(month);
|
||||||
|
|
||||||
|
|
||||||
|
Integer[] years = { 2015,2016,2017,2018};
|
||||||
|
JComboBox<Integer> year = new JComboBox<Integer>(years);
|
||||||
|
year.setSelectedItem(e.getStartDate().get(GregorianCalendar.YEAR));
|
||||||
|
panel4.add(year);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
JPanel panel5 = new JPanel();
|
||||||
|
JLabel endtime = new JLabel("Endtime: ");
|
||||||
|
panel5.add(endtime);
|
||||||
|
center.add(panel5);
|
||||||
|
|
||||||
|
JComboBox<Integer> hourE = new JComboBox<Integer>(hours);
|
||||||
|
hourE.setSelectedIndex(e.getEndDate().get(GregorianCalendar.HOUR_OF_DAY));
|
||||||
|
JPanel panel6 = new JPanel();
|
||||||
|
panel6.add(hourE);
|
||||||
|
center.add(panel6);
|
||||||
|
|
||||||
|
JComboBox<Integer> minuteE = new JComboBox<Integer>(minutes);
|
||||||
|
minuteE.setSelectedIndex(e.getEndDate().get(GregorianCalendar.MINUTE));
|
||||||
|
panel6.add(minuteE);
|
||||||
|
panel6.add(new JSeparator(SwingConstants.VERTICAL));
|
||||||
|
panel6.add(new JSeparator(SwingConstants.VERTICAL));
|
||||||
|
|
||||||
|
|
||||||
|
JComboBox<Integer> dayE = new JComboBox<Integer>(days);
|
||||||
|
dayE.setSelectedIndex(e.getEndDate().get(GregorianCalendar.DAY_OF_MONTH) - 1);
|
||||||
|
panel6.add(dayE);
|
||||||
|
|
||||||
|
JComboBox<String> monthE = new JComboBox<String>(months);
|
||||||
|
monthE.setSelectedIndex(e.getEndDate().get(GregorianCalendar.MONTH));
|
||||||
|
panel6.add(monthE);
|
||||||
|
|
||||||
|
|
||||||
|
JComboBox<Integer> yearE = new JComboBox<Integer>(years);
|
||||||
|
yearE.setSelectedItem(e.getEndDate().get(GregorianCalendar.YEAR));
|
||||||
|
panel6.add(yearE);
|
||||||
|
|
||||||
|
|
||||||
|
JPanel panel7 = new JPanel();
|
||||||
|
JLabel artist2 = new JLabel("Artist: ");
|
||||||
|
panel7.add(artist2);
|
||||||
|
center.add(panel7);
|
||||||
|
|
||||||
|
JPanel panel8 = new JPanel();
|
||||||
|
String[] artists = new String[agenda.getArtists().size()];
|
||||||
|
int artistIndex = 0;
|
||||||
|
|
||||||
|
for ( int idx = 0; idx < agenda.getArtists().size(); idx ++)
|
||||||
|
{
|
||||||
|
artists[idx] = agenda.getArtists().get(idx).getName();
|
||||||
|
if(agenda.getArtists().get(idx).equals(e.getArtist()))
|
||||||
|
{
|
||||||
|
artistIndex = idx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
JComboBox<String> artist = new JComboBox<String>(artists);
|
||||||
|
artist.setSelectedIndex(artistIndex);
|
||||||
|
panel8.add(artist);
|
||||||
|
center.add(panel8);
|
||||||
|
|
||||||
|
JPanel panel9 = new JPanel();
|
||||||
|
JLabel stage = new JLabel("Stage: ");
|
||||||
|
panel9.add(stage);
|
||||||
|
center.add(panel9);
|
||||||
|
|
||||||
|
JPanel panel10 = new JPanel();
|
||||||
|
String[] stages = new String[agenda.getStages().size()];
|
||||||
|
|
||||||
|
int stageIndex = 0;
|
||||||
|
|
||||||
|
for ( int idx = 0; idx < agenda.getStages().size(); idx ++)
|
||||||
|
{
|
||||||
|
stages[idx] = agenda.getStages().get(idx).getName();
|
||||||
|
if(agenda.getStages().get(idx).equals(e.getStage()))
|
||||||
|
{
|
||||||
|
stageIndex = idx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
JComboBox<String> stage2 = new JComboBox<String>(stages);
|
||||||
|
stage2.setSelectedIndex(stageIndex);
|
||||||
|
panel10.add(stage2);
|
||||||
|
center.add(panel10);
|
||||||
|
|
||||||
|
JPanel panel11 = new JPanel();
|
||||||
|
JLabel description = new JLabel("Description: ");
|
||||||
|
panel11.add(description);
|
||||||
|
center.add(panel11);
|
||||||
|
|
||||||
|
JPanel panel12 = new JPanel();
|
||||||
|
JTextField descriptionTF = new JTextField(e.getDescription(),15);
|
||||||
|
panel12.add(descriptionTF);
|
||||||
|
center.add(panel12);
|
||||||
|
|
||||||
|
JPanel panel13 = new JPanel();
|
||||||
|
JLabel expectedPopularity = new JLabel("Expected Popularity: ");
|
||||||
|
panel13.add(expectedPopularity);
|
||||||
|
center.add(panel13);
|
||||||
|
|
||||||
|
JPanel panel14 = new JPanel();
|
||||||
|
Integer[] eps= { 1,2,3,4,5,6,7,8,9,10};
|
||||||
|
JComboBox<Integer> ep = new JComboBox<Integer>(eps);
|
||||||
|
ep.setSelectedIndex(e.getExpectedPopularity() - 1);
|
||||||
|
panel14.add(ep);
|
||||||
|
center.add(panel14);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
JButton add = new JButton("Edit event!");
|
||||||
|
south.add(add);
|
||||||
|
|
||||||
|
add.addActionListener(new ActionListener()
|
||||||
|
{
|
||||||
|
public void actionPerformed(ActionEvent f) {
|
||||||
|
boolean everythingCorrect = true;
|
||||||
|
String name = nameTF.getText();
|
||||||
|
|
||||||
|
int hourS = hour.getSelectedIndex();
|
||||||
|
int minuteS = minute.getSelectedIndex();
|
||||||
|
int dayS = day.getSelectedIndex() + 1;
|
||||||
|
String monthS = (String) month.getSelectedItem();
|
||||||
|
int yearS = year.getSelectedIndex() + 2015;
|
||||||
|
|
||||||
|
int hourEnd = hourE.getSelectedIndex();
|
||||||
|
int minuteEnd = minuteE.getSelectedIndex();
|
||||||
|
int dayEnd = dayE.getSelectedIndex() + 1;
|
||||||
|
String monthEnd = (String) monthE.getSelectedItem();
|
||||||
|
int yearEnd = yearE.getSelectedIndex() + 2015;
|
||||||
|
|
||||||
|
String artistName = (String)artist.getSelectedItem();
|
||||||
|
|
||||||
|
Artist artist = null;
|
||||||
|
|
||||||
|
for(Artist a : agenda.getArtists())
|
||||||
|
{
|
||||||
|
if (a.getName().equals(artistName))
|
||||||
|
{
|
||||||
|
artist = a;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String stageName = (String)stage2.getSelectedItem();
|
||||||
|
|
||||||
|
Stage stage = null;
|
||||||
|
|
||||||
|
for(Stage s : agenda.getStages())
|
||||||
|
{
|
||||||
|
if (s.getName().equals(stageName))
|
||||||
|
{
|
||||||
|
stage = s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String description = descriptionTF.getText();
|
||||||
|
|
||||||
|
int popularity = ep.getSelectedIndex() + 1;
|
||||||
|
|
||||||
|
if (dayS > monthDays(monthS)){
|
||||||
|
everythingCorrect = false;
|
||||||
|
JOptionPane.showMessageDialog(null, "Invalid Date!");
|
||||||
|
}
|
||||||
|
else if (yearS > yearEnd || monthToInt(monthS) > monthToInt(monthEnd) || dayS > dayEnd || hourS > hourEnd || minuteS > minuteEnd){
|
||||||
|
everythingCorrect = false;
|
||||||
|
JOptionPane.showMessageDialog(null, "End time is earlier then start time!");
|
||||||
|
}
|
||||||
|
else if (dayS != dayEnd || monthS.equals(monthEnd) == false || yearS != yearEnd){
|
||||||
|
everythingCorrect = false;
|
||||||
|
JOptionPane.showMessageDialog(null, "Event is too long! It can't be longer than a single day.");
|
||||||
|
} else if (name.isEmpty()){
|
||||||
|
everythingCorrect = false;
|
||||||
|
JOptionPane.showMessageDialog(null, "Fill in a correct name!");
|
||||||
|
} else if (stage == null){
|
||||||
|
everythingCorrect = false;
|
||||||
|
JOptionPane.showMessageDialog(null, "Missing a stage!");
|
||||||
|
} else if (artist == null){
|
||||||
|
JOptionPane.showMessageDialog(null, "Missing a artist!");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (everythingCorrect == true)
|
||||||
|
{
|
||||||
|
e.setEventName(name);
|
||||||
|
e.setDescription(description);
|
||||||
|
e.setExpectedPopularity(popularity);
|
||||||
|
e.setArtist(artist);
|
||||||
|
e.setStage(stage);
|
||||||
|
e.setStartDate(yearS, monthToInt(monthS), dayS, hourS, minuteS);
|
||||||
|
e.setEndDate(yearEnd, monthToInt(monthEnd), dayEnd, hourEnd, minuteEnd);
|
||||||
|
|
||||||
|
everythingCorrect = false;
|
||||||
|
JOptionPane.showMessageDialog(null, "Event edited!");
|
||||||
|
setVisible(false);
|
||||||
|
dispose();
|
||||||
|
Window.updatePanel();
|
||||||
|
if(tab != null)
|
||||||
|
{
|
||||||
|
tab.setVisible(false);
|
||||||
|
tab.dispose();
|
||||||
|
Event eventartist = null;
|
||||||
|
for(Event event: agenda.getEvents())
|
||||||
|
{
|
||||||
|
if (event.getEventName().equals(name))
|
||||||
|
{
|
||||||
|
eventartist = event;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
TabbedPane panel = new TabbedPane(agenda, eventartist, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
JButton remove = new JButton("Remove event!");
|
||||||
|
south.add(remove);
|
||||||
|
|
||||||
|
remove.addActionListener(new ActionListener()
|
||||||
|
{
|
||||||
|
public void actionPerformed(ActionEvent f) {
|
||||||
|
|
||||||
|
if(JOptionPane.showConfirmDialog(null, "Are you sure you want to remove this event?", "Remove Event", JOptionPane.YES_NO_OPTION) == JOptionPane.OK_OPTION)
|
||||||
|
{
|
||||||
|
Iterator<Event> it = agenda.getEvents().iterator();
|
||||||
|
while(it.hasNext())
|
||||||
|
{
|
||||||
|
Event ev = it.next();
|
||||||
|
if(ev.equals(e))
|
||||||
|
{
|
||||||
|
it.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
JOptionPane.showMessageDialog(null, "Event removed!");
|
||||||
|
setVisible(false);
|
||||||
|
dispose();
|
||||||
|
Window.updatePanel();
|
||||||
|
if(tab != null)
|
||||||
|
{
|
||||||
|
tab.setVisible(false);
|
||||||
|
tab.dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
setContentPane(content);
|
||||||
|
setVisible(true);
|
||||||
|
setSize(700,320);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int monthToInt(String month)
|
||||||
|
{
|
||||||
|
int number = 0;
|
||||||
|
switch (month)
|
||||||
|
{
|
||||||
|
case "January": number = 1; break;
|
||||||
|
case "February": number = 2; break;
|
||||||
|
case "March": number = 3; break;
|
||||||
|
case "April": number = 4; break;
|
||||||
|
case "May": number = 5; break;
|
||||||
|
case "June":number = 6; break;
|
||||||
|
case "July": number = 7; break;
|
||||||
|
case "August": number = 8; break;
|
||||||
|
case "September":number = 9; break;
|
||||||
|
case "October": number = 10; break;
|
||||||
|
case "November": number = 11; break;
|
||||||
|
case "December": number = 12; break;
|
||||||
|
}
|
||||||
|
return number;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int monthDays(String month)
|
||||||
|
{
|
||||||
|
int number = 0;
|
||||||
|
switch (month)
|
||||||
|
{
|
||||||
|
case "January": number = 31; break;
|
||||||
|
case "February": number = 28; break;
|
||||||
|
case "March": number = 31; break;
|
||||||
|
case "April": number = 30; break;
|
||||||
|
case "May": number = 31; break;
|
||||||
|
case "June":number = 30; break;
|
||||||
|
case "July": number = 31; break;
|
||||||
|
case "August": number = 31; break;
|
||||||
|
case "September":number = 30; break;
|
||||||
|
case "October": number = 31; break;
|
||||||
|
case "November": number = 30; break;
|
||||||
|
case "December": number = 31; break;
|
||||||
|
}
|
||||||
|
return number;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,127 @@
|
|||||||
|
import java.awt.BorderLayout;
|
||||||
|
import java.awt.FlowLayout;
|
||||||
|
import java.awt.GridLayout;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
import java.util.Iterator;
|
||||||
|
|
||||||
|
import javax.swing.JButton;
|
||||||
|
import javax.swing.JFrame;
|
||||||
|
import javax.swing.JLabel;
|
||||||
|
import javax.swing.JOptionPane;
|
||||||
|
import javax.swing.JPanel;
|
||||||
|
import javax.swing.JTextField;
|
||||||
|
|
||||||
|
|
||||||
|
public class EditStagePanel extends JFrame{
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1;
|
||||||
|
|
||||||
|
public EditStagePanel(Agenda agenda, Stage sta)
|
||||||
|
{
|
||||||
|
super("Stage editscreen!");
|
||||||
|
setDefaultCloseOperation(HIDE_ON_CLOSE);
|
||||||
|
JPanel content = new JPanel(new BorderLayout());
|
||||||
|
JPanel south = new JPanel(new FlowLayout());
|
||||||
|
JPanel center = new JPanel(new GridLayout(2,2));
|
||||||
|
content.add(south, BorderLayout.SOUTH);
|
||||||
|
content.add(center, BorderLayout.CENTER);
|
||||||
|
|
||||||
|
JPanel panel1 = new JPanel();
|
||||||
|
JLabel name = new JLabel("Stage name: ");
|
||||||
|
panel1.add(name);
|
||||||
|
center.add(panel1);
|
||||||
|
|
||||||
|
JPanel panel2 = new JPanel();
|
||||||
|
JTextField nameTF = new JTextField(sta.getName(),15);
|
||||||
|
panel2.add(nameTF);
|
||||||
|
center.add(panel2);
|
||||||
|
|
||||||
|
JLabel description = new JLabel("Stage Description: ");
|
||||||
|
JPanel panel3 = new JPanel();
|
||||||
|
panel3.add(description);
|
||||||
|
center.add(panel3);
|
||||||
|
|
||||||
|
JTextField descriptionTF = new JTextField(sta.getDescription(),15);
|
||||||
|
JPanel panel4 = new JPanel();
|
||||||
|
panel4.add(descriptionTF);
|
||||||
|
center.add(panel4);
|
||||||
|
|
||||||
|
|
||||||
|
JButton add = new JButton("Edit stage!");
|
||||||
|
south.add(add);
|
||||||
|
|
||||||
|
add.addActionListener(new ActionListener()
|
||||||
|
{
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
String name = nameTF.getText();
|
||||||
|
String description = descriptionTF.getText();
|
||||||
|
|
||||||
|
boolean alreadyExists = false;
|
||||||
|
for (Stage stage : agenda.getStages())
|
||||||
|
{
|
||||||
|
if (stage.getName().equals(name) && !stage.equals(sta))
|
||||||
|
{
|
||||||
|
alreadyExists = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (name.isEmpty()){
|
||||||
|
JOptionPane.showMessageDialog(null, "Fill in a correct name!");
|
||||||
|
}
|
||||||
|
else if ( alreadyExists == false )
|
||||||
|
{
|
||||||
|
sta.setName(name);
|
||||||
|
sta.setDescription(description);
|
||||||
|
JOptionPane.showMessageDialog(null, "Stage edited!");
|
||||||
|
setVisible(false);
|
||||||
|
dispose();
|
||||||
|
Window.updatePanel();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
JOptionPane.showMessageDialog(null, "Choose a different stage name!");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
JButton remove = new JButton("Remove stage!");
|
||||||
|
for(Event e : agenda.getEvents())
|
||||||
|
{
|
||||||
|
if(e.getStage().equals(sta))
|
||||||
|
{
|
||||||
|
remove.setEnabled(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
south.add(remove);
|
||||||
|
|
||||||
|
remove.addActionListener(new ActionListener()
|
||||||
|
{
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
|
||||||
|
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();
|
||||||
|
while(it.hasNext())
|
||||||
|
{
|
||||||
|
Stage s = it.next();
|
||||||
|
if(s.equals(sta))
|
||||||
|
{
|
||||||
|
it.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
JOptionPane.showMessageDialog(null, "Stage removed!");
|
||||||
|
setVisible(false);
|
||||||
|
dispose();
|
||||||
|
Window.updatePanel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
setContentPane(content);
|
||||||
|
setVisible(true);
|
||||||
|
setSize(400,180);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+18
-2
@@ -1,10 +1,15 @@
|
|||||||
|
|
||||||
|
|
||||||
import java.awt.BorderLayout;
|
import java.awt.BorderLayout;
|
||||||
|
import java.awt.Dimension;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
|
||||||
|
import javax.swing.Box;
|
||||||
import javax.swing.BoxLayout;
|
import javax.swing.BoxLayout;
|
||||||
|
import javax.swing.JButton;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import javax.swing.JSeparator;
|
import javax.swing.JSeparator;
|
||||||
@@ -14,7 +19,7 @@ public class EventPanel extends JPanel{
|
|||||||
|
|
||||||
private static final long serialVersionUID = 504733981352439417L;
|
private static final long serialVersionUID = 504733981352439417L;
|
||||||
|
|
||||||
public EventPanel(Event event)
|
public EventPanel(Event event, Agenda a, TabbedPane tab)
|
||||||
{
|
{
|
||||||
super(new BorderLayout());
|
super(new BorderLayout());
|
||||||
SimpleDateFormat dateformatter = new SimpleDateFormat("dd-MM-yyyy");
|
SimpleDateFormat dateformatter = new SimpleDateFormat("dd-MM-yyyy");
|
||||||
@@ -28,8 +33,16 @@ public class EventPanel extends JPanel{
|
|||||||
JPanel row = new JPanel();
|
JPanel row = new JPanel();
|
||||||
row.setLayout(new BoxLayout(row, BoxLayout.LINE_AXIS));
|
row.setLayout(new BoxLayout(row, BoxLayout.LINE_AXIS));
|
||||||
JPanel panel = new JPanel();
|
JPanel panel = new JPanel();
|
||||||
|
JButton edit = new JButton("Edit Info");
|
||||||
|
edit.addActionListener(new ActionListener(){
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e)
|
||||||
|
{
|
||||||
|
EditEventPanel edit = new EditEventPanel(a, event, tab);
|
||||||
|
}
|
||||||
|
});
|
||||||
panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS));
|
panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS));
|
||||||
JLabel title = new JLabel("<html>" + event.getEventName() + "</html>");
|
JLabel title = new JLabel(event.getEventName());
|
||||||
JLabel date = new JLabel("<html>" + dateformatter.format(event.getEndDate().getTime()) + "</html>");
|
JLabel date = new JLabel("<html>" + dateformatter.format(event.getEndDate().getTime()) + "</html>");
|
||||||
JLabel data = new JLabel("<html> " + event.getStage().getName() + "<br> <br>" + event.getArtist().getName() + "<br> <br>" + event.getExpectedPopularity() + "<br> <br>" + timeformatter.format(event.getStartDate().getTime()) + " - " + timeformatter.format(event.getEndDate().getTime()) + "<br> <br> </html>");
|
JLabel data = new JLabel("<html> " + event.getStage().getName() + "<br> <br>" + event.getArtist().getName() + "<br> <br>" + event.getExpectedPopularity() + "<br> <br>" + timeformatter.format(event.getStartDate().getTime()) + " - " + timeformatter.format(event.getEndDate().getTime()) + "<br> <br> </html>");
|
||||||
JLabel text = new JLabel("<html> Podium: <br> <br> Artiest: <br> <br> Populariteit: <br> <br> Tijd: <br> <br> </html>");
|
JLabel text = new JLabel("<html> Podium: <br> <br> Artiest: <br> <br> Populariteit: <br> <br> Tijd: <br> <br> </html>");
|
||||||
@@ -43,6 +56,9 @@ public class EventPanel extends JPanel{
|
|||||||
JLabel description = new JLabel("<html> <b> Beschrijving </b> <br> <br>" + event.getDescription() + "</html>");
|
JLabel description = new JLabel("<html> <b> Beschrijving </b> <br> <br>" + event.getDescription() + "</html>");
|
||||||
description.setFont(new Font("Dialog", Font.PLAIN, 12));
|
description.setFont(new Font("Dialog", Font.PLAIN, 12));
|
||||||
row.add(title);
|
row.add(title);
|
||||||
|
row.add(Box.createRigidArea(new Dimension(10,0)));
|
||||||
|
row.add(edit);
|
||||||
|
row.add(Box.createRigidArea(new Dimension(30,0)));
|
||||||
row.add(date);
|
row.add(date);
|
||||||
box1.add(row);
|
box1.add(row);
|
||||||
box1.add(new JSeparator(SwingConstants.HORIZONTAL));
|
box1.add(new JSeparator(SwingConstants.HORIZONTAL));
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ public class Main {
|
|||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
//new Window();
|
//new Window();
|
||||||
|
|
||||||
Window w = new Window();
|
Window w = new Window();
|
||||||
Agenda agn = w.getAgenda();
|
Agenda agn = w.getAgenda();
|
||||||
|
|
||||||
@@ -19,9 +19,9 @@ public class Main {
|
|||||||
Event e2 = new Event("Coldplay Live", 2015, 2, 25, 20, 00, 2015, 2, 25, 22, 00, a1, s1, "A concert from a very famous band", 1);
|
Event e2 = new Event("Coldplay Live", 2015, 2, 25, 20, 00, 2015, 2, 25, 22, 00, a1, s1, "A concert from a very famous band", 1);
|
||||||
Event e3 = new Event("Nirvana in memory", 2015, 2, 24, 16, 30, 2015, 2, 24, 20, 45, a2, s1, "A concert in memory of a once very famous band", 4);
|
Event e3 = new Event("Nirvana in memory", 2015, 2, 24, 16, 30, 2015, 2, 24, 20, 45, a2, s1, "A concert in memory of a once very famous band", 4);
|
||||||
Event e4 = new Event("Epic Rap Battles of History", 2015, 3, 3, 12, 30, 2015, 3, 12, 18, 45, a3, s2, "Rap battle with Eminem and ERP", 3);
|
Event e4 = new Event("Epic Rap Battles of History", 2015, 3, 3, 12, 30, 2015, 3, 12, 18, 45, a3, s2, "Rap battle with Eminem and ERP", 3);
|
||||||
Event e5 = new Event("Coldplay Live", 2015, 2, 26, 21, 00, 2015, 2, 24, 23, 00, a1, s1, "A concert from a very famous band", 2);
|
Event e5 = new Event("Coldplay Live", 2015, 2, 26, 21, 00, 2015, 2, 26, 23, 00, a1, s1, "A concert from a very famous band", 2);
|
||||||
Event e6 = new Event("Coldplay Live", 2015, 2, 27, 20, 00, 2015, 2, 25, 22, 00, a1, s1, "A concert from a very famous band", 1);
|
Event e6 = new Event("Coldplay Live", 2015, 2, 27, 20, 00, 2015, 2, 27, 22, 00, a1, s1, "A concert from a very famous band", 1);
|
||||||
Event e7 = new Event("Nirvana in memory", 2015, 2, 28, 16, 30, 2015, 2, 24, 20, 45, a2, s1, "A concert in memory of a once very famous band", 4);
|
Event e7 = new Event("Nirvana in memory", 2015, 2, 28, 16, 30, 2015, 2, 28, 20, 45, a2, s1, "A concert in memory of a once very famous band", 4);
|
||||||
Event e8 = new Event("Epic Rap Battles of History", 2015, 3, 2, 12, 30, 2015, 3, 12, 18, 45, a3, s2, "Rap battle with Eminem and ERP", 3);
|
Event e8 = new Event("Epic Rap Battles of History", 2015, 3, 2, 12, 30, 2015, 3, 12, 18, 45, a3, s2, "Rap battle with Eminem and ERP", 3);
|
||||||
|
|
||||||
agn.addEvent(e1);
|
agn.addEvent(e1);
|
||||||
@@ -35,7 +35,9 @@ public class Main {
|
|||||||
|
|
||||||
agn.fillArtists();
|
agn.fillArtists();
|
||||||
agn.fillStages();
|
agn.fillStages();
|
||||||
w.updatePanel("timeline");
|
|
||||||
|
w.updatePanel();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+15
-11
@@ -27,30 +27,34 @@ public class MenuBar extends JMenuBar {
|
|||||||
newEvent.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, ActionEvent.CTRL_MASK));
|
newEvent.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, ActionEvent.CTRL_MASK));
|
||||||
newEvent.addActionListener(new ActionListener() {
|
newEvent.addActionListener(new ActionListener() {
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
//TODO
|
new AddEventPanel(w.getAgenda());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
JMenuItem newArtist = new JMenuItem("New Artist");
|
JMenuItem newArtist = new JMenuItem("New Artist");
|
||||||
newArtist.addActionListener(new ActionListener() {
|
newArtist.addActionListener(new ActionListener() {
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
//TODO
|
new AddArtistPanel(w.getAgenda());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
JMenuItem newStage = new JMenuItem("New Stage");
|
JMenuItem newStage = new JMenuItem("New Stage");
|
||||||
newStage.addActionListener(new ActionListener() {
|
newStage.addActionListener(new ActionListener() {
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
//TODO
|
new AddStagePanel(w.getAgenda());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
JMenuItem newAgenda = new JMenuItem("New Agenda");
|
JMenuItem newAgenda = new JMenuItem("New Agenda");
|
||||||
newAgenda.addActionListener(new ActionListener() {
|
newAgenda.addActionListener(new ActionListener() {
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
Agenda a = new Agenda();
|
|
||||||
w.setAgenda(a);
|
if(JOptionPane.showConfirmDialog(null, "Are you sure you want to create a new agenda?", "New Agenda", JOptionPane.YES_NO_OPTION) == JOptionPane.OK_OPTION)
|
||||||
Window.updatePanel("table");
|
{
|
||||||
|
Agenda ag = w.getAgenda();
|
||||||
|
ag.clearAgenda();
|
||||||
|
Window.updatePanel();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -59,7 +63,7 @@ public class MenuBar extends JMenuBar {
|
|||||||
open.addActionListener(new ActionListener() {
|
open.addActionListener(new ActionListener() {
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
w.getAgenda().loadAgenda();
|
w.getAgenda().loadAgenda();
|
||||||
Window.updatePanel("table");
|
Window.updatePanel();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -68,7 +72,7 @@ public class MenuBar extends JMenuBar {
|
|||||||
save.addActionListener(new ActionListener() {
|
save.addActionListener(new ActionListener() {
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
w.getAgenda().saveAgenda();
|
w.getAgenda().saveAgenda();
|
||||||
Window.updatePanel("table");
|
Window.updatePanel();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -104,21 +108,21 @@ public class MenuBar extends JMenuBar {
|
|||||||
JMenuItem timeline = new JMenuItem("Timeline");
|
JMenuItem timeline = new JMenuItem("Timeline");
|
||||||
timeline.addActionListener(new ActionListener() {
|
timeline.addActionListener(new ActionListener() {
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
Window.updatePanel("timeline");
|
Window.changePanel("timeline");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
JMenuItem table = new JMenuItem("Table");
|
JMenuItem table = new JMenuItem("Table");
|
||||||
table.addActionListener(new ActionListener() {
|
table.addActionListener(new ActionListener() {
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
Window.updatePanel("table");
|
Window.changePanel("table");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
JMenuItem art_sta = new JMenuItem("Artists and Stages");
|
JMenuItem art_sta = new JMenuItem("Artists and Stages");
|
||||||
art_sta.addActionListener(new ActionListener() {
|
art_sta.addActionListener(new ActionListener() {
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
Window.updatePanel("art_sta");
|
Window.changePanel("art_sta");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
+35
-10
@@ -17,11 +17,13 @@ public class PanelArtSta extends JPanel implements Panel{
|
|||||||
JList stages;
|
JList stages;
|
||||||
Object[] dataArtist;
|
Object[] dataArtist;
|
||||||
Object[] dataStage;
|
Object[] dataStage;
|
||||||
|
Window w;
|
||||||
|
|
||||||
public PanelArtSta(Window w)
|
public PanelArtSta(Window w)
|
||||||
{
|
{
|
||||||
super();
|
super();
|
||||||
a = w.getAgenda();
|
a = w.getAgenda();
|
||||||
|
this.w = w;
|
||||||
|
|
||||||
artists = new JList();
|
artists = new JList();
|
||||||
artists.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
|
artists.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
|
||||||
@@ -34,7 +36,7 @@ public class PanelArtSta extends JPanel implements Panel{
|
|||||||
|
|
||||||
if (artists.getSelectedIndex() == -1) {
|
if (artists.getSelectedIndex() == -1) {
|
||||||
} else {
|
} else {
|
||||||
JOptionPane.showMessageDialog(null, "Artist Selected: " + a.getArtists().get(artists.getSelectedIndex()));
|
new EditArtistPanel(w.getAgenda(), a.getArtists().get(artists.getSelectedIndex()), null);
|
||||||
artists.clearSelection();
|
artists.clearSelection();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -54,7 +56,7 @@ public class PanelArtSta extends JPanel implements Panel{
|
|||||||
|
|
||||||
if (stages.getSelectedIndex() == -1) {
|
if (stages.getSelectedIndex() == -1) {
|
||||||
} else {
|
} else {
|
||||||
JOptionPane.showMessageDialog(null, "Stage Selected: " + a.getStages().get(stages.getSelectedIndex()));
|
new EditStagePanel(w.getAgenda(), a.getStages().get(stages.getSelectedIndex()));
|
||||||
stages.clearSelection();
|
stages.clearSelection();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -70,24 +72,47 @@ public class PanelArtSta extends JPanel implements Panel{
|
|||||||
|
|
||||||
public void compileData()
|
public void compileData()
|
||||||
{
|
{
|
||||||
int artists = a.getArtists().size();
|
int artistsList = a.getArtists().size();
|
||||||
int stages = a.getStages().size();
|
int stagesList = a.getStages().size();
|
||||||
dataArtist = new Object[artists];
|
|
||||||
dataStage = new Object[stages];
|
|
||||||
|
|
||||||
for(int i = 0; i < artists; i++)
|
if(artistsList > 0)
|
||||||
{
|
{
|
||||||
dataArtist[i] = a.getArtists().get(i);
|
dataArtist = new Object[artistsList];
|
||||||
|
for(int i = 0; i < artistsList; i++)
|
||||||
|
{
|
||||||
|
dataArtist[i] = a.getArtists().get(i);
|
||||||
|
}
|
||||||
|
artists.setEnabled(true);
|
||||||
}
|
}
|
||||||
for(int i = 0; i < stages; i++)
|
else
|
||||||
{
|
{
|
||||||
dataStage[i] = a.getStages().get(i);
|
dataArtist = new Object[1];
|
||||||
|
dataArtist[0] = new Artist("Geen Artists", "Geen Artists", "null", "Geen Artists", "Geen Artists");
|
||||||
|
artists.setEnabled(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(stagesList > 0)
|
||||||
|
{
|
||||||
|
dataStage = new Object[stagesList];
|
||||||
|
|
||||||
|
for(int i = 0; i < stagesList; i++)
|
||||||
|
{
|
||||||
|
dataStage[i] = a.getStages().get(i);
|
||||||
|
}
|
||||||
|
stages.setEnabled(true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dataStage = new Object[1];
|
||||||
|
dataStage[0] = new Stage("Geen Stages", "Geen Stages");
|
||||||
|
stages.setEnabled(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||||
public void update(ArrayList<Event> event) {
|
public void update(ArrayList<Event> event) {
|
||||||
|
a = w.getAgenda();
|
||||||
compileData();
|
compileData();
|
||||||
AbstractListModel artistsList = new ContentList(dataArtist);
|
AbstractListModel artistsList = new ContentList(dataArtist);
|
||||||
AbstractListModel stagesList = new ContentList(dataStage);
|
AbstractListModel stagesList = new ContentList(dataStage);
|
||||||
|
|||||||
+36
-8
@@ -24,7 +24,7 @@ import javax.swing.table.AbstractTableModel;
|
|||||||
/**
|
/**
|
||||||
* Constructs a JTable in a ScrolPane.
|
* Constructs a JTable in a ScrolPane.
|
||||||
* @author Wesley
|
* @author Wesley
|
||||||
* @version 1.2
|
* @version 1.3
|
||||||
*/
|
*/
|
||||||
public class PanelTable extends JPanel implements Panel{
|
public class PanelTable extends JPanel implements Panel{
|
||||||
|
|
||||||
@@ -40,16 +40,19 @@ public class PanelTable extends JPanel implements Panel{
|
|||||||
private ArrayList<Event> fullEvents;
|
private ArrayList<Event> fullEvents;
|
||||||
private JTable table;
|
private JTable table;
|
||||||
private JTable selectedCell;
|
private JTable selectedCell;
|
||||||
|
private Agenda a;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor makes the table and adds it to a scrollPane.
|
* Constructor makes the table and adds it to a scrollPane.
|
||||||
* @param events
|
* @param events
|
||||||
*/
|
*/
|
||||||
public PanelTable() {
|
public PanelTable(Agenda a) {
|
||||||
super.setLayout(new BorderLayout());
|
super.setLayout(new BorderLayout());
|
||||||
|
this.a = a;
|
||||||
table= new JTable();
|
table= new JTable();
|
||||||
table.setAutoCreateRowSorter(true);
|
table.setAutoCreateRowSorter(true);
|
||||||
table.setAutoResizeMode(table.AUTO_RESIZE_ALL_COLUMNS);
|
table.setAutoResizeMode(table.AUTO_RESIZE_ALL_COLUMNS);
|
||||||
|
table.getTableHeader().setReorderingAllowed(false);
|
||||||
table.addMouseListener(new MouseAdapter() {
|
table.addMouseListener(new MouseAdapter() {
|
||||||
public void mouseClicked(MouseEvent e) { if(e.getClickCount() > 1 ) cellClicked(e); else selectedCell = (JTable) e.getSource(); }
|
public void mouseClicked(MouseEvent e) { if(e.getClickCount() > 1 ) cellClicked(e); else selectedCell = (JTable) e.getSource(); }
|
||||||
});
|
});
|
||||||
@@ -62,7 +65,7 @@ public class PanelTable extends JPanel implements Panel{
|
|||||||
public void actionPerformed(ActionEvent e) { filter(); }
|
public void actionPerformed(ActionEvent e) { filter(); }
|
||||||
});
|
});
|
||||||
buttonPanel.add(button);
|
buttonPanel.add(button);
|
||||||
button = new JButton(new ImageIcon("sprites/sprite0.png"));
|
button = new JButton(new ImageIcon("src/sprites/sprite0.png"));
|
||||||
button.addActionListener(new ActionListener() {
|
button.addActionListener(new ActionListener() {
|
||||||
public void actionPerformed(ActionEvent e) { update(fullEvents, true); }
|
public void actionPerformed(ActionEvent e) { update(fullEvents, true); }
|
||||||
});
|
});
|
||||||
@@ -87,7 +90,7 @@ public class PanelTable extends JPanel implements Panel{
|
|||||||
data = new Object[rows][columnes];
|
data = new Object[rows][columnes];
|
||||||
for(int x = 0; x < rows; x++) {
|
for(int x = 0; x < rows; x++) {
|
||||||
Object[] tempData = new Object[columnes];
|
Object[] tempData = new Object[columnes];
|
||||||
tempData[0] = "Stage 1";
|
tempData[0] = events.get(x).getStage().getName();
|
||||||
tempData[1] = events.get(x).getEventName();
|
tempData[1] = events.get(x).getEventName();
|
||||||
tempData[2] = events.get(x).getArtist().getName();
|
tempData[2] = events.get(x).getArtist().getName();
|
||||||
tempData[3] = formatter.format(events.get(x).getStartDate().getTime());
|
tempData[3] = formatter.format(events.get(x).getStartDate().getTime());
|
||||||
@@ -139,7 +142,7 @@ public class PanelTable extends JPanel implements Panel{
|
|||||||
*/
|
*/
|
||||||
private void openEventDialog(int row) {
|
private void openEventDialog(int row) {
|
||||||
Event event = events.get(row);
|
Event event = events.get(row);
|
||||||
new TabbedPane(event, true);
|
new TabbedPane(a, event, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -148,7 +151,7 @@ public class PanelTable extends JPanel implements Panel{
|
|||||||
*/
|
*/
|
||||||
private void openArtistDialog(int row) {
|
private void openArtistDialog(int row) {
|
||||||
Event event = events.get(row);
|
Event event = events.get(row);
|
||||||
new TabbedPane(event, false);
|
new TabbedPane(a, event, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -171,7 +174,7 @@ public class PanelTable extends JPanel implements Panel{
|
|||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
for(Event event : fullEvents) {
|
for(Event event : fullEvents) {
|
||||||
if(event.equals(events.get(selectedCell.getSelectedRow()))) {
|
if(event.getEventName().equals(events.get(selectedCell.getSelectedRow()).getEventName())) {
|
||||||
filteredList.add(event);
|
filteredList.add(event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -183,7 +186,32 @@ public class PanelTable extends JPanel implements Panel{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 3:
|
||||||
|
int selectedCellStartTime = events.get(selectedCell.getSelectedRow()).getStartDate().getTime().getHours()*100;
|
||||||
|
selectedCellStartTime += events.get(selectedCell.getSelectedRow()).getStartDate().getTime().getMinutes();
|
||||||
|
int selectedCellEndTime = events.get(selectedCell.getSelectedRow()).getEndDate().getTime().getHours()*100;
|
||||||
|
selectedCellEndTime += events.get(selectedCell.getSelectedRow()).getEndDate().getTime().getMinutes();
|
||||||
|
for(Event event : fullEvents) {
|
||||||
|
int time = event.getStartDate().getTime().getHours()*100;
|
||||||
|
time += event.getStartDate().getTime().getMinutes();
|
||||||
|
if(time >= selectedCellStartTime && time <= selectedCellEndTime) {
|
||||||
|
filteredList.add(event);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
selectedCellStartTime = events.get(selectedCell.getSelectedRow()).getStartDate().getTime().getHours()*100;
|
||||||
|
selectedCellStartTime += events.get(selectedCell.getSelectedRow()).getStartDate().getTime().getMinutes();
|
||||||
|
selectedCellEndTime = events.get(selectedCell.getSelectedRow()).getEndDate().getTime().getHours()*100;
|
||||||
|
selectedCellEndTime += events.get(selectedCell.getSelectedRow()).getEndDate().getTime().getMinutes();
|
||||||
|
for(Event event : fullEvents) {
|
||||||
|
int time = event.getEndDate().getTime().getHours()*100;
|
||||||
|
time += event.getEndDate().getTime().getMinutes();
|
||||||
|
if(time >= selectedCellStartTime && time <= selectedCellEndTime) {
|
||||||
|
filteredList.add(event);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
update(filteredList,false);
|
update(filteredList,false);
|
||||||
selectedCell = null;
|
selectedCell = null;
|
||||||
|
|||||||
+5
-7
@@ -1,17 +1,17 @@
|
|||||||
|
|
||||||
//een jframe met info, heeft alleen een event object (het desbetreffende event) en een boolean met daarin true of false (slaande op je wel of niet met het event wilt starten) nodig.
|
//een jframe met info, heeft alleen een agenda object, event object (het desbetreffende event) en een boolean met daarin true of false (slaande op je wel of niet met het event wilt starten) nodig.
|
||||||
//Voorderest heeft dit niks nodig en is het een apart openend JFrame wat gewoon weer afgesloten kan worden.
|
//Voorderest heeft dit niks nodig en is het een apart openend JFrame wat gewoon weer afgesloten kan worden.
|
||||||
import javax.swing.JFrame;
|
import javax.swing.JFrame;
|
||||||
import javax.swing.JTabbedPane;
|
import javax.swing.JTabbedPane;
|
||||||
|
|
||||||
public class TabbedPane extends JFrame{
|
public class TabbedPane extends JFrame{
|
||||||
|
|
||||||
public TabbedPane(Event event, boolean eventSelected)
|
public TabbedPane(Agenda a, Event event, boolean eventSelected)
|
||||||
{
|
{
|
||||||
super("info GUI");
|
super("info GUI");
|
||||||
JTabbedPane tab = new JTabbedPane();
|
JTabbedPane tab = new JTabbedPane();
|
||||||
tab.add("Event", new EventPanel(event));
|
tab.add("Event", new EventPanel(event, a, this));
|
||||||
tab.add("Artist", new ArtistPanel(event));
|
tab.add("Artist", new ArtistPanel(event, a, this));
|
||||||
if(eventSelected)
|
if(eventSelected)
|
||||||
{
|
{
|
||||||
tab.setSelectedIndex(0);
|
tab.setSelectedIndex(0);
|
||||||
@@ -24,6 +24,4 @@ public class TabbedPane extends JFrame{
|
|||||||
setSize(480, 410);
|
setSize(480, 410);
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//"Event", new EventPanel("Introductie", "Hoofdpodium", "14:00-15:00", "Populair", "Paul Lindelauf", "25-02-2015", "Het begin van het festival, wordt gepresenteerd door Paul Lindelauf. En ik moet nog een hele hoop onzin toevoegen om dit goed te kunnen testen, dus daarom doe ik dat nu ook maar even. En nog een hele hoop informatie vanwege REDENEN. En waarom de fuck hij nu wel ineens normaal kan doen weet ik niet, maar zal dus maar voor de volgende keer onthouden minder onzin te typen."
|
|
||||||
//"Artist", new ArtistPanel("Paul Lindelauf", "Paultje Lindelauf <br> <br> Paultje is de ster van de show en opent de voorstelling. Hierna komen de geweldige artiesten.<br> <br>", "Achtergrondinformatie<br> <br> Paul staat bekend als de man die zijn leerlingen treiterde met zijn diagrammen, leiderschap en Excel.", "src/content/Paul.jpg"
|
|
||||||
+17
-13
@@ -71,7 +71,7 @@ public class Window extends JFrame {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
//Agenda Panels
|
//Agenda Panels
|
||||||
Panel tablePanel = new PanelTable();
|
Panel tablePanel = new PanelTable(agenda);
|
||||||
panels.put("table", tablePanel);
|
panels.put("table", tablePanel);
|
||||||
|
|
||||||
Panel art_staPanel = new PanelArtSta(this);
|
Panel art_staPanel = new PanelArtSta(this);
|
||||||
@@ -100,7 +100,7 @@ public class Window extends JFrame {
|
|||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
date.set(GregorianCalendar.DAY_OF_MONTH, date.get(GregorianCalendar.DAY_OF_MONTH) - 7);
|
date.set(GregorianCalendar.DAY_OF_MONTH, date.get(GregorianCalendar.DAY_OF_MONTH) - 7);
|
||||||
dateLabel.setText(formatter.format(date.getTime()));
|
dateLabel.setText(formatter.format(date.getTime()));
|
||||||
changePanel();
|
updatePanel();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
bottomPanel.add(new JSeparator(SwingConstants.VERTICAL));
|
bottomPanel.add(new JSeparator(SwingConstants.VERTICAL));
|
||||||
@@ -113,7 +113,7 @@ public class Window extends JFrame {
|
|||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
date.set(GregorianCalendar.DAY_OF_MONTH, date.get(GregorianCalendar.DAY_OF_MONTH) - 1);
|
date.set(GregorianCalendar.DAY_OF_MONTH, date.get(GregorianCalendar.DAY_OF_MONTH) - 1);
|
||||||
dateLabel.setText(formatter.format(date.getTime()));
|
dateLabel.setText(formatter.format(date.getTime()));
|
||||||
changePanel();
|
updatePanel();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
bottomPanel.add(new JSeparator(SwingConstants.VERTICAL));
|
bottomPanel.add(new JSeparator(SwingConstants.VERTICAL));
|
||||||
@@ -126,7 +126,7 @@ public class Window extends JFrame {
|
|||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
date = new GregorianCalendar();
|
date = new GregorianCalendar();
|
||||||
dateLabel.setText(formatter.format(date.getTime()));
|
dateLabel.setText(formatter.format(date.getTime()));
|
||||||
changePanel();
|
updatePanel();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
bottomPanel.add(new JSeparator(SwingConstants.VERTICAL));
|
bottomPanel.add(new JSeparator(SwingConstants.VERTICAL));
|
||||||
@@ -139,7 +139,7 @@ public class Window extends JFrame {
|
|||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
date.set(GregorianCalendar.DAY_OF_MONTH, date.get(GregorianCalendar.DAY_OF_MONTH) + 1);
|
date.set(GregorianCalendar.DAY_OF_MONTH, date.get(GregorianCalendar.DAY_OF_MONTH) + 1);
|
||||||
dateLabel.setText(formatter.format(date.getTime()));
|
dateLabel.setText(formatter.format(date.getTime()));
|
||||||
changePanel();
|
updatePanel();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
bottomPanel.add(new JSeparator(SwingConstants.VERTICAL));
|
bottomPanel.add(new JSeparator(SwingConstants.VERTICAL));
|
||||||
@@ -152,7 +152,7 @@ public class Window extends JFrame {
|
|||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
date.set(GregorianCalendar.DAY_OF_MONTH, date.get(GregorianCalendar.DAY_OF_MONTH) + 7);
|
date.set(GregorianCalendar.DAY_OF_MONTH, date.get(GregorianCalendar.DAY_OF_MONTH) + 7);
|
||||||
dateLabel.setText(formatter.format(date.getTime()));
|
dateLabel.setText(formatter.format(date.getTime()));
|
||||||
changePanel();
|
updatePanel();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
bottomPanel.add(new JSeparator(SwingConstants.VERTICAL));
|
bottomPanel.add(new JSeparator(SwingConstants.VERTICAL));
|
||||||
@@ -164,27 +164,31 @@ public class Window extends JFrame {
|
|||||||
|
|
||||||
setContentPane(mainPanel);
|
setContentPane(mainPanel);
|
||||||
|
|
||||||
changePanel();
|
updatePanel();
|
||||||
|
|
||||||
//Show window
|
//Show window
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
this.getRootPane().addComponentListener(new ComponentAdapter()
|
this.getRootPane().addComponentListener(new ComponentAdapter()
|
||||||
{
|
{
|
||||||
public void componentResized(ComponentEvent e) {
|
public void componentResized(ComponentEvent e) {
|
||||||
TimelinePanel tempTimeLine = (TimelinePanel) timeline;
|
if(currentPanel == "timeline")
|
||||||
tempTimeLine.refresh();
|
{
|
||||||
// System.out.println("WINDOWS: " + tempframe.getWidth());
|
TimelinePanel tempTimeLine = (TimelinePanel) timeline;
|
||||||
|
tempTimeLine.refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void updatePanel(String panel)
|
public static void changePanel(String panel)
|
||||||
{
|
{
|
||||||
currentPanel = panel;
|
currentPanel = panel;
|
||||||
changePanel();
|
updatePanel();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void changePanel()
|
public static void updatePanel()
|
||||||
{
|
{
|
||||||
centerPanel.removeAll();
|
centerPanel.removeAll();
|
||||||
Panel p = panels.get(currentPanel);
|
Panel p = panels.get(currentPanel);
|
||||||
|
|||||||
Reference in New Issue
Block a user