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