|
@@ -1,23 +1,38 @@
|
|
|
package gui.panels.edit.dialogs;
|
|
package gui.panels.edit.dialogs;
|
|
|
|
|
|
|
|
-import agenda.*;
|
|
|
|
|
-import com.sun.codemodel.internal.JOp;
|
|
|
|
|
-
|
|
|
|
|
-import javax.swing.*;
|
|
|
|
|
-import java.awt.*;
|
|
|
|
|
|
|
+import java.awt.Color;
|
|
|
|
|
+import java.awt.Component;
|
|
|
|
|
+import java.awt.Label;
|
|
|
import java.awt.event.ActionEvent;
|
|
import java.awt.event.ActionEvent;
|
|
|
import java.awt.event.ActionListener;
|
|
import java.awt.event.ActionListener;
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
|
|
|
|
|
|
|
+import javax.swing.BoxLayout;
|
|
|
|
|
+import javax.swing.DefaultListModel;
|
|
|
|
|
+import javax.swing.JButton;
|
|
|
|
|
+import javax.swing.JComboBox;
|
|
|
|
|
+import javax.swing.JDialog;
|
|
|
|
|
+import javax.swing.JLabel;
|
|
|
|
|
+import javax.swing.JList;
|
|
|
|
|
+import javax.swing.JOptionPane;
|
|
|
|
|
+import javax.swing.JPanel;
|
|
|
|
|
+import javax.swing.JScrollPane;
|
|
|
|
|
+import javax.swing.JTextField;
|
|
|
|
|
+import javax.swing.ListCellRenderer;
|
|
|
|
|
+
|
|
|
|
|
+import agenda.Act;
|
|
|
|
|
+import agenda.ActTime;
|
|
|
|
|
+import agenda.Agenda;
|
|
|
|
|
+import agenda.Artist;
|
|
|
|
|
+import agenda.Stage;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* Created by gjoosen on 20/02/15.
|
|
* Created by gjoosen on 20/02/15.
|
|
|
*/
|
|
*/
|
|
|
public class ActDialogPanel extends JDialog{
|
|
public class ActDialogPanel extends JDialog{
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
private Agenda agenda;
|
|
private Agenda agenda;
|
|
|
- private JTextField name, genre, beginTime, endTime;
|
|
|
|
|
|
|
+ private JTextField name, genre;
|
|
|
private JComboBox stageComboBox;
|
|
private JComboBox stageComboBox;
|
|
|
|
|
|
|
|
private DefaultListModel model;
|
|
private DefaultListModel model;
|
|
@@ -39,7 +54,6 @@ public class ActDialogPanel extends JDialog{
|
|
|
main.add(this.dates());
|
|
main.add(this.dates());
|
|
|
main.add(this.artistsChooser());
|
|
main.add(this.artistsChooser());
|
|
|
|
|
|
|
|
- main.add(timeSetter());
|
|
|
|
|
main.add(this.buttons());
|
|
main.add(this.buttons());
|
|
|
super.add(main);
|
|
super.add(main);
|
|
|
super.setVisible(true);
|
|
super.setVisible(true);
|
|
@@ -68,7 +82,6 @@ public class ActDialogPanel extends JDialog{
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
main.add(this.artistsChooser());
|
|
main.add(this.artistsChooser());
|
|
|
- main.add(this.timeSetter());
|
|
|
|
|
main.add(this.buttons());
|
|
main.add(this.buttons());
|
|
|
super.add(main);
|
|
super.add(main);
|
|
|
}
|
|
}
|
|
@@ -209,39 +222,6 @@ public class ActDialogPanel extends JDialog{
|
|
|
artists.add(buttonPanel);
|
|
artists.add(buttonPanel);
|
|
|
return artists;
|
|
return artists;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- private JPanel timeSetter(){
|
|
|
|
|
- this.beginTime = new JTextField();
|
|
|
|
|
- this.endTime = new JTextField();
|
|
|
|
|
-
|
|
|
|
|
- JPanel time = new JPanel();
|
|
|
|
|
- time.setLayout(new BoxLayout(time, BoxLayout.Y_AXIS));
|
|
|
|
|
-
|
|
|
|
|
- JPanel begin = new JPanel();
|
|
|
|
|
- begin.setLayout(new GridLayout());
|
|
|
|
|
- begin.add(new JLabel("begin time:"));
|
|
|
|
|
- begin.add(this.beginTime);
|
|
|
|
|
-
|
|
|
|
|
- JPanel end = new JPanel();
|
|
|
|
|
- end.setLayout(new GridLayout());
|
|
|
|
|
- end.add(new JLabel("end time:"));
|
|
|
|
|
- end.add(this.endTime);
|
|
|
|
|
-
|
|
|
|
|
- time.add(begin);
|
|
|
|
|
- time.add(end);
|
|
|
|
|
-
|
|
|
|
|
- if(this.act == null){
|
|
|
|
|
- System.out.println("default txt.");
|
|
|
|
|
- this.beginTime.setText("2015-10-11-08-10");
|
|
|
|
|
- this.endTime.setText("2015-10-11-12-20");
|
|
|
|
|
- }else{
|
|
|
|
|
- System.out.println("non txt.");
|
|
|
|
|
-
|
|
|
|
|
- this.beginTime.setText(this.act.getActTime().getBeginTimeString());
|
|
|
|
|
- this.endTime.setText(this.act.getActTime().getEndTimeString());
|
|
|
|
|
- }
|
|
|
|
|
- return time;
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
private JPanel buttons(){
|
|
private JPanel buttons(){
|
|
|
JPanel buttons = new JPanel();
|
|
JPanel buttons = new JPanel();
|
|
@@ -291,7 +271,7 @@ public class ActDialogPanel extends JDialog{
|
|
|
|
|
|
|
|
|
|
|
|
|
if(this.act == null){
|
|
if(this.act == null){
|
|
|
- Act act = new Act(this.name.getText(), (Stage) this.stageComboBox.getSelectedItem(), this.genre.getText(), new ActTime(this.beginTime.getText() ,this.endTime.getText()), artists);
|
|
|
|
|
|
|
+ Act act = new Act(this.name.getText(), (Stage) this.stageComboBox.getSelectedItem(), this.genre.getText(), new ActTime(2015,02,11,21,00 ,2015,02,11,23,00), artists);
|
|
|
this.model.addElement(act);
|
|
this.model.addElement(act);
|
|
|
this.agenda.addAct(act);
|
|
this.agenda.addAct(act);
|
|
|
}else{
|
|
}else{
|
|
@@ -299,7 +279,6 @@ public class ActDialogPanel extends JDialog{
|
|
|
this.act.setGenre(this.genre.getText());
|
|
this.act.setGenre(this.genre.getText());
|
|
|
this.act.setStage((Stage) this.stageComboBox.getSelectedItem());
|
|
this.act.setStage((Stage) this.stageComboBox.getSelectedItem());
|
|
|
this.act.setArtists(artists);
|
|
this.act.setArtists(artists);
|
|
|
- this.act.setActTime(new ActTime(this.beginTime.getText() ,this.endTime.getText()));
|
|
|
|
|
this.model.removeElement(this.act);
|
|
this.model.removeElement(this.act);
|
|
|
this.model.addElement(act);
|
|
this.model.addElement(act);
|
|
|
}
|
|
}
|