Better UI, added LookAndFeel, changed fonts
This commit is contained in:
@@ -9,16 +9,11 @@ import java.util.List;
|
||||
public class FacultyManager implements Serializable {
|
||||
|
||||
private final StudentManager sm = new StudentManager();
|
||||
|
||||
private final GroupManager gm = new GroupManager(sm);
|
||||
|
||||
private final List<Faculty> faculties = new ArrayList<>();
|
||||
|
||||
public Faculty getFaculty(String facultyName) {
|
||||
for (Faculty fc : faculties)
|
||||
if (fc.getName().equals(facultyName)) return fc;
|
||||
return null;
|
||||
}
|
||||
|
||||
public GroupManager getGm() {
|
||||
return gm;
|
||||
}
|
||||
|
||||
@@ -13,13 +13,8 @@ public class GroupManager implements Serializable {
|
||||
}
|
||||
|
||||
private final StudentManager sm;
|
||||
private final List<Group> groups = new ArrayList<>();
|
||||
|
||||
public Group getGroup(String groupName) {
|
||||
for (Group group : groups)
|
||||
if (group.getName().equals(groupName)) return group;
|
||||
return null;
|
||||
}
|
||||
private final List<Group> groups = new ArrayList<>();
|
||||
|
||||
public void addGroup(Group group) {
|
||||
groups.add(group);
|
||||
|
||||
@@ -1,16 +1,10 @@
|
||||
package org.lumijiez.managers;
|
||||
|
||||
import org.lumijiez.base.Faculty;
|
||||
import org.lumijiez.base.Group;
|
||||
import org.lumijiez.base.Student;
|
||||
import org.lumijiez.util.FullStudentData;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import static org.lumijiez.enums.StudyField.DEFAULT_UNASSIGNED;
|
||||
|
||||
public class StudentManager implements Serializable {
|
||||
private final List<Student> students = new ArrayList<>();
|
||||
@@ -23,13 +17,6 @@ public class StudentManager implements Serializable {
|
||||
return students;
|
||||
}
|
||||
|
||||
public Student getStudent(FullStudentData data) {
|
||||
for (Student st : students) {
|
||||
if (st.getFSD().equals(data)) return st;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void deleteStudent(Student student) {
|
||||
students.remove(student);
|
||||
}
|
||||
|
||||
@@ -3,12 +3,10 @@ package org.lumijiez.managers;
|
||||
import org.lumijiez.base.Faculty;
|
||||
import org.lumijiez.base.Grade;
|
||||
import org.lumijiez.base.Group;
|
||||
import org.lumijiez.util.FullStudentData;
|
||||
import org.lumijiez.base.Student;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
public class Supervisor implements Serializable {
|
||||
private final FacultyManager fm;
|
||||
@@ -31,6 +29,10 @@ public class Supervisor implements Serializable {
|
||||
}
|
||||
}
|
||||
|
||||
public void addGrade(Student student, Grade grade) {
|
||||
student.addGrade(grade);
|
||||
}
|
||||
|
||||
public void editGroup(Group group, String name, Faculty faculty) {
|
||||
group.setName(name);
|
||||
Faculty oldFac = group.getFaculty();
|
||||
@@ -38,6 +40,7 @@ public class Supervisor implements Serializable {
|
||||
faculty.addGroup(group);
|
||||
oldFac.getGroups().remove(group);
|
||||
}
|
||||
|
||||
public void deleteGroup(Group group) {
|
||||
getFm().getGm().deleteGroup(group);
|
||||
for (Student st : group.getStudents()) {
|
||||
@@ -45,10 +48,22 @@ public class Supervisor implements Serializable {
|
||||
}
|
||||
}
|
||||
|
||||
public void addStudent(String name, String surname, Group group, Faculty faculty, Date birth, Date enrol) {
|
||||
Student newStudent = new Student(name, surname, group, faculty, birth, enrol);
|
||||
public void addStudent(String name, String surname, String email, Group group, Faculty faculty, Date birth, Date enrol) {
|
||||
Student newStudent = new Student(name, surname, email, group, faculty, birth, enrol);
|
||||
getFm().getGm().getSm().addStudent(newStudent);
|
||||
group.addStudent(newStudent);
|
||||
}
|
||||
|
||||
public void editStudent(Student student, String name, String surname, String email, Group group, Faculty faculty) {
|
||||
student.getGroup().deleteStudent(student);
|
||||
student.setName(name);
|
||||
student.setSurname(surname);
|
||||
student.setFullname(name + " " + surname);
|
||||
student.setEmail(email);
|
||||
student.setGroup(group);
|
||||
group.addStudent(student);
|
||||
student.setFaculty(faculty);
|
||||
student.setDateOfBirth(student.getDateOfBirth());
|
||||
student.setEnrollmentDate(student.getEnrollmentDate());
|
||||
}
|
||||
|
||||
public void addGroup(Group group, Faculty faculty) {
|
||||
@@ -62,54 +77,7 @@ public class Supervisor implements Serializable {
|
||||
getFm().getGm().getSm().deleteStudent(st);
|
||||
}
|
||||
|
||||
public String getStudentsText() {
|
||||
StringBuilder info = new StringBuilder();
|
||||
for (Student st : fm.getGm().getSm().getStudents()) {
|
||||
info.append(st.getFullname()).append(" ").append(st.getGroup().getName()).append("\n");
|
||||
}
|
||||
return info.toString();
|
||||
}
|
||||
|
||||
public String getGradesText(FullStudentData data) {
|
||||
StringBuilder info = new StringBuilder();
|
||||
for (Grade gr : fm.getGm().getSm().getStudent(data).getGrades()) {
|
||||
info.append(gr.getSubject()).append(" ").append(gr.getGrade());
|
||||
}
|
||||
return info.toString();
|
||||
}
|
||||
|
||||
public String getGroupsText() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (Group gr : fm.getGm().getGroups())
|
||||
builder.append(gr.getName()).append("\n");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
public String getFacultiesText() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (Faculty fc : fm.getFaculties())
|
||||
builder.append(fc.getName()).append("\n");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
public FacultyManager getFm() {
|
||||
return fm;
|
||||
}
|
||||
|
||||
// public void changeGroup(NameSurnameGroup NSG, String groupName) {
|
||||
// Group gr = groupManager.findGroup(groupName);
|
||||
// groupManager.getGroup(groupName).getStudent(NSG.name(), NSG.surname()).setGroup(gr);
|
||||
// }
|
||||
|
||||
// public void addStudent(NameSurnameGroup NSG) {
|
||||
// Group currentGroup = groupManager.getGroup(NSG.group());
|
||||
// currentGroup.addStudent(new Student(NSG.name(), NSG.surname(), currentGroup));
|
||||
// }
|
||||
|
||||
// public void addGrade(NameSurnameGroup NSG, Grade grade) {
|
||||
// Student student = groupManager.getGroup(NSG.group()).getStudent(NSG.name(), NSG.surname());
|
||||
// student.addGrade(grade);
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user