62 lines
1.8 KiB
Java
62 lines
1.8 KiB
Java
package GUI;
|
|
|
|
import javax.swing.*;
|
|
import java.awt.*;
|
|
import java.awt.event.WindowAdapter;
|
|
import java.awt.event.WindowEvent;
|
|
|
|
public class ProjectionHandler extends JDialog {
|
|
private JPanel contentPane;
|
|
private JButton cancelButton;
|
|
private JButton confirmButton;
|
|
private JComboBox competitionComboBox;
|
|
private JComboBox dayComboBox;
|
|
private JComboBox slotComboBox;
|
|
private JPanel competitionPanel;
|
|
private JPanel slotPanel;
|
|
private JPanel dayPanel;
|
|
private JLabel competitionLabel;
|
|
private JLabel slotLabel;
|
|
private JLabel dayLabel;
|
|
private JPanel filmPanel;
|
|
private JLabel filmLabel;
|
|
private JComboBox filmComboBox;
|
|
private ProjectionType projectionType;
|
|
|
|
public ProjectionHandler(ProjectionType projectionType) {
|
|
this.projectionType = projectionType;
|
|
setContentPane(contentPane);
|
|
setModal(true);
|
|
setPreferredSize(new Dimension(500, 300));
|
|
handleDialogName();
|
|
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
|
|
addWindowListener(new WindowAdapter() {
|
|
public void windowClosing(WindowEvent e) {
|
|
dispose();
|
|
}
|
|
});
|
|
setLocationRelativeTo(null);
|
|
}
|
|
|
|
private void handleDialogName() {
|
|
switch (this.projectionType) {
|
|
case ADD: {
|
|
setTitle("Add projection");
|
|
confirmButton.setText("Add");
|
|
break;
|
|
}
|
|
case EDIT: {
|
|
setTitle("Edit projection");
|
|
confirmButton.setText("Edit");
|
|
break;
|
|
}
|
|
case REMOVE: {
|
|
setTitle("Remove projection");
|
|
confirmButton.setText("remove");
|
|
break;
|
|
}
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
}
|