Integrated HTML styles, better code formatting.
This commit is contained in:
@@ -25,7 +25,7 @@ public class StudentManagementGUI extends JFrame {
|
|||||||
private final JMenu groupMenu = new JMenu();
|
private final JMenu groupMenu = new JMenu();
|
||||||
private final JMenu facultyMenu = new JMenu();
|
private final JMenu facultyMenu = new JMenu();
|
||||||
private final JMenuBar menuBar = new JMenuBar();
|
private final JMenuBar menuBar = new JMenuBar();
|
||||||
private static final JTextArea mainTextLabel = new JTextArea();
|
private static final JTextPane mainTextPane = new JTextPane();
|
||||||
private static Supervisor sv;
|
private static Supervisor sv;
|
||||||
private final JScrollPane mainScrollPane = new JScrollPane();
|
private final JScrollPane mainScrollPane = new JScrollPane();
|
||||||
|
|
||||||
@@ -74,9 +74,10 @@ public class StudentManagementGUI extends JFrame {
|
|||||||
groupMenu.setText("Group Options");
|
groupMenu.setText("Group Options");
|
||||||
facultyMenu.setText("Faculty Options");
|
facultyMenu.setText("Faculty Options");
|
||||||
|
|
||||||
mainTextLabel.setEditable(false);
|
mainTextPane.setEditable(false);
|
||||||
mainTextLabel.setFont(new java.awt.Font("Segoe UI", Font.PLAIN, 14));
|
mainTextPane.setContentType("text/html");
|
||||||
mainScrollPane.setViewportView(mainTextLabel);
|
mainTextPane.setFont(new Font("Segoe UI", Font.PLAIN, 14));
|
||||||
|
mainScrollPane.setViewportView(mainTextPane);
|
||||||
|
|
||||||
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
|
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
|
||||||
|
|
||||||
@@ -186,7 +187,7 @@ public class StudentManagementGUI extends JFrame {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void showFacultySpecEvent(ActionEvent actionEvent) {
|
private void showFacultySpecEvent(ActionEvent actionEvent) {
|
||||||
ShowSpecialtyFacultyForm form = new ShowSpecialtyFacultyForm(sv, mainTextLabel);
|
ShowSpecialtyFacultyForm form = new ShowSpecialtyFacultyForm(sv, mainTextPane);
|
||||||
form.setVisible(true);
|
form.setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -265,7 +266,7 @@ public class StudentManagementGUI extends JFrame {
|
|||||||
|
|
||||||
private void showGroupEvent(ActionEvent evt) {
|
private void showGroupEvent(ActionEvent evt) {
|
||||||
if (checkGroup() && checkFaculty()) {
|
if (checkGroup() && checkFaculty()) {
|
||||||
ShowGroupForm form = new ShowGroupForm(sv, mainTextLabel);
|
ShowGroupForm form = new ShowGroupForm(sv, mainTextPane);
|
||||||
form.setVisible(true);
|
form.setVisible(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -284,7 +285,7 @@ public class StudentManagementGUI extends JFrame {
|
|||||||
|
|
||||||
private void gradeStudentEvent(ActionEvent evt) {
|
private void gradeStudentEvent(ActionEvent evt) {
|
||||||
if (checkStudent() && checkGroup() && checkFaculty()) {
|
if (checkStudent() && checkGroup() && checkFaculty()) {
|
||||||
GradeStudentForm form = new GradeStudentForm(sv, mainTextLabel);
|
GradeStudentForm form = new GradeStudentForm(sv, mainTextPane);
|
||||||
form.setVisible(true);
|
form.setVisible(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -305,14 +306,14 @@ public class StudentManagementGUI extends JFrame {
|
|||||||
|
|
||||||
private void showGradeEvent(ActionEvent evt) {
|
private void showGradeEvent(ActionEvent evt) {
|
||||||
if (checkStudent() && checkGroup() && checkFaculty()) {
|
if (checkStudent() && checkGroup() && checkFaculty()) {
|
||||||
ShowStudentGradesForm form = new ShowStudentGradesForm(sv, mainTextLabel);
|
ShowStudentGradesForm form = new ShowStudentGradesForm(sv, mainTextPane);
|
||||||
form.setVisible(true);
|
form.setVisible(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showStudentEvent(ActionEvent evt) {
|
private void showStudentEvent(ActionEvent evt) {
|
||||||
if (checkStudent() && checkGroup() && checkFaculty()) {
|
if (checkStudent() && checkGroup() && checkFaculty()) {
|
||||||
ShowStudentForm form = new ShowStudentForm(sv, mainTextLabel);
|
ShowStudentForm form = new ShowStudentForm(sv, mainTextPane);
|
||||||
form.setVisible(true);
|
form.setVisible(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -333,7 +334,7 @@ public class StudentManagementGUI extends JFrame {
|
|||||||
|
|
||||||
private void showFacultyEvent(ActionEvent evt) {
|
private void showFacultyEvent(ActionEvent evt) {
|
||||||
if (checkFaculty()) {
|
if (checkFaculty()) {
|
||||||
ShowFacultyForm form = new ShowFacultyForm(sv, mainTextLabel);
|
ShowFacultyForm form = new ShowFacultyForm(sv, mainTextPane);
|
||||||
form.setVisible(true);
|
form.setVisible(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -376,8 +377,8 @@ public class StudentManagementGUI extends JFrame {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static JTextArea getMainLabel() {
|
public static JTextPane getMainPane() {
|
||||||
return mainTextLabel;
|
return mainTextPane;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Supervisor getSv() {
|
public static Supervisor getSv() {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import org.lumijiez.base.Faculty;
|
|||||||
import org.lumijiez.base.Group;
|
import org.lumijiez.base.Group;
|
||||||
import org.lumijiez.gui.util.ComboRenderer;
|
import org.lumijiez.gui.util.ComboRenderer;
|
||||||
import org.lumijiez.gui.util.ComponentDecorator;
|
import org.lumijiez.gui.util.ComponentDecorator;
|
||||||
|
import org.lumijiez.gui.util.Settings;
|
||||||
import org.lumijiez.gui.util.WindowConfig;
|
import org.lumijiez.gui.util.WindowConfig;
|
||||||
import org.lumijiez.managers.Supervisor;
|
import org.lumijiez.managers.Supervisor;
|
||||||
|
|
||||||
@@ -18,9 +19,9 @@ public class ShowFacultyForm extends JFrame {
|
|||||||
private final JButton submitButton = new JButton();
|
private final JButton submitButton = new JButton();
|
||||||
private final JComboBox<Faculty> facultyCombo = new JComboBox<>();
|
private final JComboBox<Faculty> facultyCombo = new JComboBox<>();
|
||||||
private final Supervisor sv;
|
private final Supervisor sv;
|
||||||
private final JTextArea mainTextLabel;
|
private final JTextPane mainTextLabel;
|
||||||
|
|
||||||
public ShowFacultyForm(Supervisor sv, JTextArea mainTextLabel) {
|
public ShowFacultyForm(Supervisor sv, JTextPane mainTextLabel) {
|
||||||
this.sv = sv;
|
this.sv = sv;
|
||||||
this.mainTextLabel = mainTextLabel;
|
this.mainTextLabel = mainTextLabel;
|
||||||
initComponents();
|
initComponents();
|
||||||
@@ -87,14 +88,14 @@ public class ShowFacultyForm extends JFrame {
|
|||||||
StringBuilder builder = new StringBuilder();
|
StringBuilder builder = new StringBuilder();
|
||||||
Faculty fac = (Faculty) facultyCombo.getSelectedItem();
|
Faculty fac = (Faculty) facultyCombo.getSelectedItem();
|
||||||
assert fac != null;
|
assert fac != null;
|
||||||
builder.append("===================== Faculty Info ========================\n");
|
builder.append("<font size='").append(Settings.FontSize).append("'><strong>===================== Faculty Info ========================</strong><br>");
|
||||||
builder.append("Name: ").append(fac.getName()).append("\n");
|
builder.append("<b>Name: </b>").append(fac.getName()).append("<br>");
|
||||||
builder.append("Specialty: ").append(fac.getField()).append("\n");
|
builder.append("<b>Specialty: </b>").append(fac.getField()).append("<br>");
|
||||||
builder.append("==========\n");
|
builder.append("<b>Groups: </b>").append("<br>");
|
||||||
builder.append("Groups: ").append("\n");
|
builder.append("<strong>==========</strong><br>");
|
||||||
for (Group gr : fac.getGroups())
|
for (Group gr : fac.getGroups())
|
||||||
builder.append(gr.getName()).append("\n").append("==========\n");
|
builder.append(gr.getName()).append("<br>").append("<strong>==========</strong><br>");
|
||||||
builder.append("============================================================");
|
builder.append("<strong>============================================================</strong>");
|
||||||
mainTextLabel.setText(builder.toString());
|
mainTextLabel.setText(builder.toString());
|
||||||
this.dispose();
|
this.dispose();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import org.lumijiez.base.Faculty;
|
|||||||
import org.lumijiez.enums.StudyField;
|
import org.lumijiez.enums.StudyField;
|
||||||
import org.lumijiez.gui.util.ComboRenderer;
|
import org.lumijiez.gui.util.ComboRenderer;
|
||||||
import org.lumijiez.gui.util.ComponentDecorator;
|
import org.lumijiez.gui.util.ComponentDecorator;
|
||||||
|
import org.lumijiez.gui.util.Settings;
|
||||||
import org.lumijiez.gui.util.WindowConfig;
|
import org.lumijiez.gui.util.WindowConfig;
|
||||||
import org.lumijiez.managers.Supervisor;
|
import org.lumijiez.managers.Supervisor;
|
||||||
|
|
||||||
@@ -18,9 +19,9 @@ public class ShowSpecialtyFacultyForm extends JFrame {
|
|||||||
private final JButton submitButton = new JButton();
|
private final JButton submitButton = new JButton();
|
||||||
private final JComboBox<StudyField> specialtyCombo = new JComboBox<>();
|
private final JComboBox<StudyField> specialtyCombo = new JComboBox<>();
|
||||||
private final Supervisor sv;
|
private final Supervisor sv;
|
||||||
private final JTextArea mainTextLabel;
|
private final JTextPane mainTextLabel;
|
||||||
|
|
||||||
public ShowSpecialtyFacultyForm(Supervisor sv, JTextArea mainTextLabel) {
|
public ShowSpecialtyFacultyForm(Supervisor sv, JTextPane mainTextLabel) {
|
||||||
this.sv = sv;
|
this.sv = sv;
|
||||||
this.mainTextLabel = mainTextLabel;
|
this.mainTextLabel = mainTextLabel;
|
||||||
initComponents();
|
initComponents();
|
||||||
@@ -87,14 +88,14 @@ public class ShowSpecialtyFacultyForm extends JFrame {
|
|||||||
StringBuilder builder = new StringBuilder();
|
StringBuilder builder = new StringBuilder();
|
||||||
StudyField fac = (StudyField) specialtyCombo.getSelectedItem();
|
StudyField fac = (StudyField) specialtyCombo.getSelectedItem();
|
||||||
assert fac != null;
|
assert fac != null;
|
||||||
builder.append("==================== Specialty Info =======================\n");
|
builder.append("<font size='").append(Settings.FontSize).append("'><strong>==================== Specialty Info =======================<strong><br>");
|
||||||
builder.append("Specialty: ").append(fac.getName()).append("\n");
|
builder.append("<b>Specialty: </b>").append(fac.getName()).append("<br>");
|
||||||
builder.append("==========\n");
|
builder.append("<strong>==========</strong><br>");
|
||||||
builder.append("Faculties: ").append("\n");
|
builder.append("<b>Faculties: </b>").append("<br>");
|
||||||
for (Faculty fc : sv.facultyManager().getFaculties())
|
for (Faculty fc : sv.facultyManager().getFaculties())
|
||||||
if (fc.getField().equals(fac))
|
if (fc.getField().equals(fac))
|
||||||
builder.append(fc.getName()).append("\n").append("==========\n");
|
builder.append(fc.getName()).append("<br>").append("<strong>==========</strong><br>");
|
||||||
builder.append("============================================================");
|
builder.append("<strong>============================================================</strong>");
|
||||||
mainTextLabel.setText(builder.toString());
|
mainTextLabel.setText(builder.toString());
|
||||||
this.dispose();
|
this.dispose();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import org.lumijiez.base.Group;
|
|||||||
import org.lumijiez.base.Student;
|
import org.lumijiez.base.Student;
|
||||||
import org.lumijiez.gui.util.ComboRenderer;
|
import org.lumijiez.gui.util.ComboRenderer;
|
||||||
import org.lumijiez.gui.util.ComponentDecorator;
|
import org.lumijiez.gui.util.ComponentDecorator;
|
||||||
|
import org.lumijiez.gui.util.Settings;
|
||||||
import org.lumijiez.gui.util.WindowConfig;
|
import org.lumijiez.gui.util.WindowConfig;
|
||||||
import org.lumijiez.managers.Supervisor;
|
import org.lumijiez.managers.Supervisor;
|
||||||
|
|
||||||
@@ -20,9 +21,9 @@ public class ShowGroupForm extends JFrame {
|
|||||||
private final JButton submitButton = new JButton();
|
private final JButton submitButton = new JButton();
|
||||||
private final JComboBox<Group> groupCombo = new JComboBox<>();
|
private final JComboBox<Group> groupCombo = new JComboBox<>();
|
||||||
private final Supervisor sv;
|
private final Supervisor sv;
|
||||||
private final JTextArea mainTextLabel;
|
private final JTextPane mainTextLabel;
|
||||||
|
|
||||||
public ShowGroupForm(Supervisor sv, JTextArea mainTextLabel) {
|
public ShowGroupForm(Supervisor sv, JTextPane mainTextLabel) {
|
||||||
this.sv = sv;
|
this.sv = sv;
|
||||||
this.mainTextLabel = mainTextLabel;
|
this.mainTextLabel = mainTextLabel;
|
||||||
initComponents();
|
initComponents();
|
||||||
@@ -88,12 +89,12 @@ public class ShowGroupForm extends JFrame {
|
|||||||
private void submitEvent(ActionEvent evt) {
|
private void submitEvent(ActionEvent evt) {
|
||||||
StringBuilder text = new StringBuilder();
|
StringBuilder text = new StringBuilder();
|
||||||
Group gr = (Group) Objects.requireNonNull(groupCombo.getSelectedItem());
|
Group gr = (Group) Objects.requireNonNull(groupCombo.getSelectedItem());
|
||||||
text.append("======================= Group Info =========================\n");
|
text.append("<font size='").append(Settings.FontSize).append("'><strong>=================== Group:</strong> ").append(gr.getName()).append("<strong>=====================</strong><br>");
|
||||||
text.append("=================== Group: ").append(gr.getName()).append("=====================\n");
|
|
||||||
for (Student student : gr.getStudents())
|
for (Student student : gr.getStudents())
|
||||||
text.append("Name: ").append(student.getName()).append("\nEmail: ").append(student.getEmail())
|
text.append("<b>Name:</b> ").append(student.getName())
|
||||||
.append("\nEnrol date: ").append(student.getEnrollmentDate())
|
.append("<br><b>Email: </b>").append(student.getEmail())
|
||||||
.append("\n===============================================\n");
|
.append("<br><b>Enrol date: </b>").append(student.getEnrollmentDate())
|
||||||
|
.append("<br><strong>===============================================</strong><br>");
|
||||||
mainTextLabel.setText(text.toString());
|
mainTextLabel.setText(text.toString());
|
||||||
this.dispose();
|
this.dispose();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import org.lumijiez.base.Student;
|
|||||||
import org.lumijiez.enums.Subjects;
|
import org.lumijiez.enums.Subjects;
|
||||||
import org.lumijiez.gui.util.ComboRenderer;
|
import org.lumijiez.gui.util.ComboRenderer;
|
||||||
import org.lumijiez.gui.util.ComponentDecorator;
|
import org.lumijiez.gui.util.ComponentDecorator;
|
||||||
|
import org.lumijiez.gui.util.Settings;
|
||||||
import org.lumijiez.gui.util.WindowConfig;
|
import org.lumijiez.gui.util.WindowConfig;
|
||||||
import org.lumijiez.managers.Supervisor;
|
import org.lumijiez.managers.Supervisor;
|
||||||
|
|
||||||
@@ -25,9 +26,9 @@ public class GradeStudentForm extends JFrame {
|
|||||||
private final JComboBox<Student> studentCombo = new JComboBox<>();
|
private final JComboBox<Student> studentCombo = new JComboBox<>();
|
||||||
private final JComboBox<Integer> gradeCombo = new JComboBox<>(grades);
|
private final JComboBox<Integer> gradeCombo = new JComboBox<>(grades);
|
||||||
private final Supervisor sv;
|
private final Supervisor sv;
|
||||||
private final JTextArea mainTextLabel;
|
private final JTextPane mainTextLabel;
|
||||||
|
|
||||||
public GradeStudentForm(Supervisor sv, JTextArea mainTextLabel) {
|
public GradeStudentForm(Supervisor sv, JTextPane mainTextLabel) {
|
||||||
this.sv = sv;
|
this.sv = sv;
|
||||||
this.mainTextLabel = mainTextLabel;
|
this.mainTextLabel = mainTextLabel;
|
||||||
initComponents();
|
initComponents();
|
||||||
@@ -121,10 +122,10 @@ public class GradeStudentForm extends JFrame {
|
|||||||
sv.addGrade(student, grade);
|
sv.addGrade(student, grade);
|
||||||
|
|
||||||
StringBuilder builder = new StringBuilder();
|
StringBuilder builder = new StringBuilder();
|
||||||
builder.append("============================================================\n");
|
builder.append("<font size='").append(Settings.FontSize).append("'><strong>============================================================</strong><br>");
|
||||||
builder.append("Grades for ").append(student.getFullname()).append(" from ").append(student.getGroup().getName()).append(":\n");
|
builder.append("<b>Grades for </b>").append(student.getFullname()).append(" <b>from</b> ").append(student.getGroup().getName()).append(":<br>");
|
||||||
for (Grade gr : student.getGrades()) builder.append(gr.getSubject()).append(": ").append(gr.getGrade()).append("\n");
|
for (Grade gr : student.getGrades()) builder.append(gr.getSubject()).append(": ").append(gr.getGrade()).append("<br>");
|
||||||
builder.append("============================================================\n");
|
builder.append("<strong>============================================================</strong><br>");
|
||||||
mainTextLabel.setText(builder.toString());
|
mainTextLabel.setText(builder.toString());
|
||||||
this.dispose();
|
this.dispose();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package org.lumijiez.gui.forms.student;
|
|||||||
import org.lumijiez.base.Student;
|
import org.lumijiez.base.Student;
|
||||||
import org.lumijiez.gui.util.ComboRenderer;
|
import org.lumijiez.gui.util.ComboRenderer;
|
||||||
import org.lumijiez.gui.util.ComponentDecorator;
|
import org.lumijiez.gui.util.ComponentDecorator;
|
||||||
|
import org.lumijiez.gui.util.Settings;
|
||||||
import org.lumijiez.gui.util.WindowConfig;
|
import org.lumijiez.gui.util.WindowConfig;
|
||||||
import org.lumijiez.managers.Supervisor;
|
import org.lumijiez.managers.Supervisor;
|
||||||
|
|
||||||
@@ -18,9 +19,9 @@ public class ShowStudentForm extends JFrame {
|
|||||||
private final JButton submitButton = new JButton();
|
private final JButton submitButton = new JButton();
|
||||||
private final JComboBox<Student> studentCombo = new JComboBox<>();
|
private final JComboBox<Student> studentCombo = new JComboBox<>();
|
||||||
private final Supervisor sv;
|
private final Supervisor sv;
|
||||||
private final JTextArea mainTextLabel;
|
private final JTextPane mainTextLabel;
|
||||||
|
|
||||||
public ShowStudentForm(Supervisor sv, JTextArea mainTextLabel) {
|
public ShowStudentForm(Supervisor sv, JTextPane mainTextLabel) {
|
||||||
this.sv = sv;
|
this.sv = sv;
|
||||||
this.mainTextLabel = mainTextLabel;
|
this.mainTextLabel = mainTextLabel;
|
||||||
initComponents();
|
initComponents();
|
||||||
@@ -89,16 +90,16 @@ public class ShowStudentForm extends JFrame {
|
|||||||
Student student = ((Student) Objects.requireNonNull(studentCombo.getSelectedItem()));
|
Student student = ((Student) Objects.requireNonNull(studentCombo.getSelectedItem()));
|
||||||
StringBuilder text = new StringBuilder();
|
StringBuilder text = new StringBuilder();
|
||||||
|
|
||||||
text.append("====================== Student Info ======================\n");
|
text.append("<font size='").append(Settings.FontSize).append("'><strong>====================== Student Info ======================</strong><br>");
|
||||||
mainTextLabel.setText(text.toString());
|
mainTextLabel.setText(text.toString());
|
||||||
text.append("Name: ").append(student.getFullname()).append(" \n")
|
text.append("<b>Name: </b>").append(student.getFullname()).append(" <br>")
|
||||||
.append("Group: ").append(student.getGroup().getName())
|
.append("<b>Group:</b> ").append(student.getGroup().getName())
|
||||||
.append(" \nFaculty: ").append(student.getFaculty().getName())
|
.append(" <br><b>Faculty:</b> ").append(student.getFaculty().getName())
|
||||||
.append(" \nEmail: ").append(student.getEmail()).append(" \n")
|
.append(" <br><b>Email:</b> ").append(student.getEmail())
|
||||||
.append("Bday: ").append(student.getDateOfBirth())
|
.append(" <br><b>Bday:</b> ").append(student.getDateOfBirth())
|
||||||
.append("\nEnrol date: ").append(student.getEnrollmentDate())
|
.append(" <br><b>Enrol date:</b> ").append(student.getEnrollmentDate())
|
||||||
.append("\nGraduated: ").append(student.isGraduated());
|
.append(" <br><b>Graduated:</b> ").append(student.isGraduated() ? "<b color='green'>Yes</b>" : "<b color='red'>No</b>");
|
||||||
text.append("\n=======================================================");
|
text.append("<br>=======================================================");
|
||||||
mainTextLabel.setText(text.toString());
|
mainTextLabel.setText(text.toString());
|
||||||
this.dispose();
|
this.dispose();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import org.lumijiez.base.Grade;
|
|||||||
import org.lumijiez.base.Student;
|
import org.lumijiez.base.Student;
|
||||||
import org.lumijiez.gui.util.ComboRenderer;
|
import org.lumijiez.gui.util.ComboRenderer;
|
||||||
import org.lumijiez.gui.util.ComponentDecorator;
|
import org.lumijiez.gui.util.ComponentDecorator;
|
||||||
|
import org.lumijiez.gui.util.Settings;
|
||||||
import org.lumijiez.gui.util.WindowConfig;
|
import org.lumijiez.gui.util.WindowConfig;
|
||||||
import org.lumijiez.managers.Supervisor;
|
import org.lumijiez.managers.Supervisor;
|
||||||
|
|
||||||
@@ -19,9 +20,9 @@ public class ShowStudentGradesForm extends JFrame {
|
|||||||
private final JButton submitButton = new JButton();
|
private final JButton submitButton = new JButton();
|
||||||
private final JComboBox<Student> studentCombo = new JComboBox<>();
|
private final JComboBox<Student> studentCombo = new JComboBox<>();
|
||||||
private final Supervisor sv;
|
private final Supervisor sv;
|
||||||
private final JTextArea mainTextLabel;
|
private final JTextPane mainTextLabel;
|
||||||
|
|
||||||
public ShowStudentGradesForm(Supervisor sv, JTextArea mainTextLabel) {
|
public ShowStudentGradesForm(Supervisor sv, JTextPane mainTextLabel) {
|
||||||
this.sv = sv;
|
this.sv = sv;
|
||||||
this.mainTextLabel = mainTextLabel;
|
this.mainTextLabel = mainTextLabel;
|
||||||
initComponents();
|
initComponents();
|
||||||
@@ -89,11 +90,11 @@ public class ShowStudentGradesForm extends JFrame {
|
|||||||
private void submitEvent(ActionEvent evt) {
|
private void submitEvent(ActionEvent evt) {
|
||||||
Student student = ((Student) Objects.requireNonNull(studentCombo.getSelectedItem()));
|
Student student = ((Student) Objects.requireNonNull(studentCombo.getSelectedItem()));
|
||||||
StringBuilder builder = new StringBuilder();
|
StringBuilder builder = new StringBuilder();
|
||||||
builder.append("============================================================\n");
|
builder.append("<font size='").append(Settings.FontSize).append("'><strong>============================================================</strong><br>");
|
||||||
builder.append("Grades for ").append(student.getFullname()).append(" from ").append(student.getGroup().getName()).append(":\n");
|
builder.append("<b>Grades for </b>").append(student.getFullname()).append(" <b>from</b> ").append(student.getGroup().getName()).append(":<br>");
|
||||||
for (Grade grade : student.getGrades())
|
for (Grade grade : student.getGrades())
|
||||||
builder.append(grade.getSubject()).append(": ").append(grade.getGrade()).append("\n");
|
builder.append(grade.getSubject()).append(": ").append(grade.getGrade()).append("<br>");
|
||||||
builder.append("============================================================\n");
|
builder.append("<strong>============================================================<strong><br>");
|
||||||
mainTextLabel.setText(builder.toString());
|
mainTextLabel.setText(builder.toString());
|
||||||
this.dispose();
|
this.dispose();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,64 +5,63 @@ import org.lumijiez.base.Group;
|
|||||||
import org.lumijiez.base.Student;
|
import org.lumijiez.base.Student;
|
||||||
import org.lumijiez.gui.StudentManagementGUI;
|
import org.lumijiez.gui.StudentManagementGUI;
|
||||||
|
|
||||||
|
|
||||||
public class DisplayHandler {
|
public class DisplayHandler {
|
||||||
public static void displayStudents() {
|
public static void displayStudents() {
|
||||||
StringBuilder text = new StringBuilder();
|
StringBuilder text = new StringBuilder();
|
||||||
text.append("======================== Students ==========================\n");
|
text.append("<font size='").append(Settings.FontSize).append("'><strong>======================== Students ==========================</strong><br>");
|
||||||
for (Student student : StudentManagementGUI.getSv().studentManager().getStudents()) {
|
for (Student student : StudentManagementGUI.getSv().studentManager().getStudents())
|
||||||
text.append("Name: ").append(student.getFullname()).append("\nGroup: ").append(student.getGroup().getName())
|
text.append("<b>Name: </b>").append(student.getFullname())
|
||||||
.append("\nEmail: ").append(student.getEmail()).append("\nGraduated: ").append((student.isGraduated() ? "Yes" : "No"));
|
.append("<br><b>Group: </b>").append(student.getGroup().getName())
|
||||||
text.append("\n===============================================\n");
|
.append("<br><b>Email: </b>").append(student.getEmail())
|
||||||
}
|
.append("<br><b>Graduated: </b>").append((student.isGraduated() ? "<b color='green'>Yes</b>" : "<b color='red'>No</b>"))
|
||||||
StudentManagementGUI.getMainLabel().setText(text.toString());
|
.append("<br><strong>===============================================</strong><br>");
|
||||||
|
StudentManagementGUI.getMainPane().setText(text.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void displayGroups() {
|
public static void displayGroups() {
|
||||||
StringBuilder text = new StringBuilder();
|
StringBuilder text = new StringBuilder();
|
||||||
text.append("========================= Groups ===========================\n");
|
text.append("<font size='").append(Settings.FontSize).append("'><strong>========================= Groups ===========================</strong><br>");
|
||||||
for (Group group : StudentManagementGUI.getSv().groupManager().getGroups()) {
|
for (Group group : StudentManagementGUI.getSv().groupManager().getGroups())
|
||||||
text.append("Name: ").append(group.getName()).append("\nFaculty: ").append(group.getFaculty().getName())
|
text.append("<b>Name: </b>").append(group.getName())
|
||||||
.append("\nNumber of students: ").append(group.getStudents().size());
|
.append("<br><b>Faculty: </b>").append(group.getFaculty().getName())
|
||||||
text.append("\n===============================================\n");
|
.append("<br><b>Number of students: </b>").append(group.getStudents().size())
|
||||||
}
|
.append("<br><strong>===============================================</strong><br>");
|
||||||
StudentManagementGUI.getMainLabel().setText(text.toString());
|
StudentManagementGUI.getMainPane().setText(text.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void displayFaculties() {
|
public static void displayFaculties() {
|
||||||
StringBuilder text = new StringBuilder();
|
StringBuilder text = new StringBuilder();
|
||||||
text.append("======================= Faculties =========================\n");
|
text.append("<font size='").append(Settings.FontSize).append("'><strong>======================= Faculties =========================</strong><br>");
|
||||||
for (Faculty fac : StudentManagementGUI.getSv().facultyManager().getFaculties()) {
|
for (Faculty fac : StudentManagementGUI.getSv().facultyManager().getFaculties())
|
||||||
text.append("Name: ").append(fac.getName()).append("\nSpecialty: ").append(fac.getField().getName())
|
text.append("<b>Name: </b>").append(fac.getName()).append("<br> <b>Specialty: </b>").append(fac.getField().getName())
|
||||||
.append("\nAbbreviation: ").append(fac.getAbbreviation())
|
.append("<br><b>Abbreviation:</b> ").append(fac.getAbbreviation())
|
||||||
.append("\nNumber of groups: ").append(fac.getGroups().size());
|
.append("<br><b>Number of groups: </b>").append(fac.getGroups().size())
|
||||||
text.append("\n===============================================\n");
|
.append("<br><strong>===============================================</strong><br>");
|
||||||
}
|
StudentManagementGUI.getMainPane().setText(text.toString());
|
||||||
StudentManagementGUI.getMainLabel().setText(text.toString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void displayGraduates() {
|
public static void displayGraduates() {
|
||||||
StringBuilder text = new StringBuilder();
|
StringBuilder text = new StringBuilder();
|
||||||
text.append("======================== Students ==========================\n");
|
text.append("<font size='").append(Settings.FontSize).append("'><strong>======================== Students ==========================</strong<br>");
|
||||||
for (Student st : StudentManagementGUI.getSv().studentManager().getStudents()) {
|
for (Student st : StudentManagementGUI.getSv().studentManager().getStudents())
|
||||||
if (st.isGraduated()) {
|
if (st.isGraduated())
|
||||||
text.append("Name: ").append(st.getFullname()).append("\nGroup: ").append(st.getGroup().getName())
|
text.append("<b>Name: </b>").append(st.getFullname())
|
||||||
.append("\nGraduated: ").append("Yes");
|
.append("<br><b>Group: </b>").append(st.getGroup().getName())
|
||||||
text.append("\n===============================================\n");
|
.append("<br><b>Graduated: </b>").append("<b color='green'>Yes</b>")
|
||||||
}
|
.append("<br>===============================================<br>");
|
||||||
}
|
StudentManagementGUI.getMainPane().setText(text.toString());
|
||||||
StudentManagementGUI.getMainLabel().setText(text.toString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void displayEnrolled() {
|
public static void displayEnrolled() {
|
||||||
StringBuilder text = new StringBuilder();
|
StringBuilder text = new StringBuilder();
|
||||||
text.append("======================== Students ==========================\n");
|
text.append("<font size='").append(Settings.FontSize).append("'><strong>======================== Students ==========================</strong><br>");
|
||||||
for (Student st : StudentManagementGUI.getSv().studentManager().getStudents()) {
|
for (Student st : StudentManagementGUI.getSv().studentManager().getStudents())
|
||||||
if (!st.isGraduated()) {
|
if (!st.isGraduated())
|
||||||
text.append("Name: ").append(st.getFullname()).append("\nGroup: ").append(st.getGroup().getName())
|
text.append("<b>Name: </b>").append(st.getFullname())
|
||||||
.append("\nGraduated: ").append("No");
|
.append("<br><b>Group: </b>").append(st.getGroup().getName())
|
||||||
text.append("\n===============================================\n");
|
.append("<br><b>Graduated: </b>").append("<b color='red'>No</b>")
|
||||||
}
|
.append("<br><strong>===============================================</strong><br>");
|
||||||
}
|
StudentManagementGUI.getMainPane().setText(text.toString());
|
||||||
StudentManagementGUI.getMainLabel().setText(text.toString());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
5
Lab2/src/main/java/org/lumijiez/gui/util/Settings.java
Normal file
5
Lab2/src/main/java/org/lumijiez/gui/util/Settings.java
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
package org.lumijiez.gui.util;
|
||||||
|
|
||||||
|
public class Settings {
|
||||||
|
public static int FontSize = 5;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user