1
0
Fork 0
This repository has been archived on 2024-02-17. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
Projection_Planning/src/main/java/GUI/ProjectionHandler.java
Tergel TSAGAAN 1b25c747b1 removed sout
2021-01-04 21:58:22 +01:00

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;
}
}
}