Lab8/.classpath
Lab8/.project
Lab8
org.eclipse.jdt.core.javabuilder
org.eclipse.jdt.core.javanature
Lab8/Depts.txt
AM,Administration,11773
EN,Engineering,11787
EC,Executive,10856
SL,Sales,12165
FN,Finance,11841
MR,Marketing,11365
MF,Manufacturing,10961
Lab8/Emps.dat
Lab8/.settings/org.eclipse.jdt.core.prefs
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.7
Lab8/edu/iup/cosc210/company/bo/Company.classpackage edu.iup.cosc210.company.bo;
publicsynchronizedclass Company {
private java.util.List departments;
private java.util.List employees;
public void Company();
public void addDepartment(Department);
public Department findDepartment(String);
public int getNoDepts();
public Department getDeparment(int);
public void addEmployee(Employee);
public int getNoEmployees();
public Employee getEmployee(int);
}
Lab8/edu/iup/cosc210/company/bo/Company.javaLab8/edu/iup/cosc210/company/bo/Company.javapackage edu.iup.cosc210.company.bo;
import java.util.ArrayList;
import java.util.List;
/**
* A Company. Maintains a list of departments and methods access
* the company's departments.
*
* @author David T. Smith
*/
publicclassCompany{
privateList<Department> departments =newArrayList<Department>();
privateList<Employee> employees =newArrayList<Employee>();
/**
* Add a Department to the list of departments for this company.
*
* @param department - the company to be added
*/
publicvoid addDepartment(Department department){
departments.add(department);
}
/**
* Find a department with a given department code
*
* @param deptCode - the department code used to find a department
* @return the department with the given code. Returns null if
* a department by the given department code is not found.
*/
publicDepartment findDepartment(String deptCode){
for(Department department : departments){
if(deptCode.equals(department.getDeptCode())){
return department;
}
}
returnnull;
}
/**
* Get the number of departments in this company.
* @return the number of departments in this company.
*/
publicint getNoDepts(){
return departments.size();
}
/**
* Get the ith department in this company
* @param i - index identifying the department to be returned
* @return the ith department in this company
*/
publicDepartment getDeparment(int i){
retur ...
3. private java.util.List employees;
public void Company();
public void addDepartment(Department);
public Department findDepartment(String);
public int getNoDepts();
public Department getDeparment(int);
public void addEmployee(Employee);
public int getNoEmployees();
public Employee getEmployee(int);
}
Lab8/edu/iup/cosc210/company/bo/Company.javaLab8/edu/iup/
cosc210/company/bo/Company.javapackage edu.iup.cosc210.co
mpany.bo;
import java.util.ArrayList;
import java.util.List;
/**
* A Company. Maintains a list of departments and methods acc
ess
* the company's departments.
*
* @author David T. Smith
*/
publicclassCompany{
privateList<Department> departments =newArrayList<Departme
nt>();
privateList<Employee> employees =newArrayList<Employee>()
;
/**
* Add a Department to the list of departments for this compa
4. ny.
*
* @param department - the company to be added
*/
publicvoid addDepartment(Department department){
departments.add(department);
}
/**
* Find a department with a given department code
*
* @param deptCode -
the department code used to find a department
* @return the department with the given code. Returns null
if
* a department by the given department code is not found.
*/
publicDepartment findDepartment(String deptCode){
for(Department department : departments){
if(deptCode.equals(department.getDeptCode())){
return department;
}
}
returnnull;
}
/**
* Get the number of departments in this company.
* @return the number of departments in this company.
*/
publicint getNoDepts(){
return departments.size();
}
/**
5. * Get the ith department in this company
* @param i - index identifying the department to be returned
* @return the ith department in this company
*/
publicDepartment getDeparment(int i){
return departments.get(i);
}
/**
* Add an employee to the department's list of employees
*
* @param employee -
* employee to add to the department
*/
publicvoid addEmployee(Employee employee){
Department dept = findDepartment(employee.getDeptCode());
if(dept !=null){
dept.addEmployee(employee);
}
employees.add(employee);
}
/**
* Get the number of employees in the department
*
* @return - the number of employees in the department
*/
publicint getNoEmployees(){
return employees.size();
}
/**
* Get an employee given an index position
*
* @param emp -
6. * the employee to return
* @return - the employee at the given position
* @throws IndexOutOfBoundsException
* if the index is less that 0 or greater than or equal t
o the
* number of employees.
*/
publicEmployee getEmployee(int index){
return employees.get(index);
}
}
Lab8/edu/iup/cosc210/company/bo/CompanyReport.classpackag
e edu.iup.cosc210.company.bo;
publicsynchronizedclass CompanyReport {
private Company company;
privatestatic java.text.SimpleDateFormat dateFormatter;
privatestatic java.text.DecimalFormat decformatter;
static void <clinit>();
public void CompanyReport();
publicstatic void main(String[]);
public void loadDepts(String) throws
NumberFormatException, java.io.IOException;
public void loadEmployees(String) throws Exception;
public void printCompanyReport();
}
Lab8/edu/iup/cosc210/company/bo/CompanyReport.javaLab8/ed
u/iup/cosc210/company/bo/CompanyReport.javapackage edu.iup
.cosc210.company.bo;
import java.io.FileNotFoundException;
7. import java.io.IOException;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import edu.iup.cosc210.company.io.DepartmentReader;
import edu.iup.cosc210.company.io.EmployeeInputStream;
/**
* Test printing of the company report.
*
* @author David T. Smith
*/
publicclassCompanyReport{
privateCompany company =newCompany();
privatestaticSimpleDateFormat dateFormatter =newSimpleDateF
ormat("MM/dd/yyyy");
privatestaticDecimalFormat decformatter =newDecimalFormat("
#,###,###.00");
/**
* Main method to print the company report: Creates a compa
ny Loads
* Departments from the file name given in the first command
line argument
* Loads Employees from the file name given in the last com
mand line
* argument
*
* @param args - the command line arguments.
*/
publicstaticvoid main(String[] args){
if(args.length <2){
System.out
.println("Usage: java edu.iup.cosc210.company <department file
> <employee file>");
System.exit(-100);
8. }
CompanyReport companyReport =newCompanyReport();
try{
companyReport.loadDepts(args[0]);
companyReport.loadEmployees(args[1]);
companyReport.printCompanyReport();
}catch(FileNotFoundException e){
System.out.println("Unable to run: "+ e.getMessage());
System.exit(-1);
}catch(IOException e){
e.printStackTrace();
}catch(Exception e){
e.printStackTrace();
}
}
/**
* Load departments from a text file.
* @param fileName -
the filename of the file that contains the departments.
* @throws IOException -
in the event the file cannot be opened or read.
*/
publicvoid loadDepts(String fileName)throwsNumberFormatExc
eption,
IOException{
DepartmentReader in =newDepartmentReader(fileName);
Department department;
while((department = in.readDepartment())!=null){
company.addDepartment(department);
}
}
9. /**
* Load Employees from a binary file. The employees are ad
ded to the list of employees
* for their respective Department as indicated by deptCode.
* @param fileName -
the name of the file that contains the employees.
* @throws Exception - catches an Exception.
*/
publicvoid loadEmployees(String fileName)throwsException{
EmployeeInputStream in =newEmployeeInputStream(fileName);
Employee employee;
while((employee = in.readEmployee())!=null){
company.addEmployee(employee);
}
}
/**
* Prints a company report. Report include information on th
e department
* and a list of all employees.
*/
publicvoid printCompanyReport(){
// loop over all departments
for(int i =0; i < company.getNoDepts(); i++){
Department department = company.getDeparment(i);
// print the department header
System.out.println(department.getDeptName()+" Department");
System.out.println();
System.out.printf("%-20s%-
20sn","Manager: ", department.getManager().getFirstName()+"
"+ department.getManager().getLastName());
System.out.printf("%-20s%-
20sn","Staff Size: ", department.getNoEmployees());
10. System.out.printf("%-
20s%dn","Vacation Days: ",department.getTotalVacationDays()
);
System.out.println();
// print the column labels for employees
System.out.printf("%-5s %-26s %-10s %-3s %-8s %-6s %-
3sn","ID",
"Employee Name","Hire Date","Typ","Salary","Rate","Vac");
// loop over all employees in the department
for(int j =0; j < department.getNoEmployees(); j++){
Employee emp = department.getEmployee(j);
System.out.printf("%5d %-26s %s %c %10s %6s %3dn",
emp.getEmployeeNumber(),
emp.getFirstName()+" "+
emp.getLastName(),
dateFormatter.format(emp.getHireDate()),
emp.getEmployeeType(),
emp.getSalary()==0?"": decformatter.format(em
p.getSalary()),
emp.getHourlyRate()==0?"":String.format("%6.
2f", emp.getHourlyRate()),
emp.getVacationDays());
}
System.out.println();
System.out.println();
}
}
}
Lab8/edu/iup/cosc210/company/bo/Department.classpackage
edu.iup.cosc210.company.bo;
publicsynchronizedclass Department {
11. private String deptCode;
private String deptName;
private int mgrEmpId;
private java.util.List employees;
private Employee manager;
public void Department(String, String, int);
public void addEmployee(Employee);
public void removeEmployee(Employee);
public String getDeptCode();
public String getDeptName();
public Employee getManager();
public int getNoEmployees();
public Employee getEmployee(int);
public int getTotalVacationDays();
public boolean equals(Object);
}
Lab8/edu/iup/cosc210/company/bo/Department.javaLab8/edu/iu
p/cosc210/company/bo/Department.javapackage edu.iup.cosc21
0.company.bo;
import java.util.ArrayList;
import java.util.List;
/**
* A Department of a Company.
*
* @author David T. Smith
*
*/
publicclassDepartment{
privateString deptCode;
privateString deptName;
12. privateint mgrEmpId;
privateList<Employee> employees =newArrayList<Employee>()
;
privateEmployee manager;
/**
* Constructor for Department.
*
* @param deptCode -
* the department code
* @param deptName -
* the department name
* @param mgrEmpId -
* the manager's employee id for the department
*/
publicDepartment(String deptCode,String deptName,int mgrEm
pId){
this.deptCode = deptCode;
this.deptName = deptName;
this.mgrEmpId = mgrEmpId;
}
/**
* Add an employee to the department's list of employees. In
* addition sets the employee's department and department co
de.
*
* @param employee -
* employee to add to the department
*/
publicvoid addEmployee(Employee employee){
if(!equals(employee.getDepartment())){
employee.setDepartment(this);
13. }
if(!employees.contains(employee)){
employees.add(employee);
}
}
/**
* Remove an employee from the department's list of employ
ees
*
* @param employee - employee to be removed
*/
publicvoid removeEmployee(Employee employee){
if(employees.contains(employee)){
employees.remove(employee);
employee.setDepartment(null);
}
}
/**
* Get the code for the department
*
* @return - the code for the department
*/
publicString getDeptCode(){
return deptCode;
}
/**
* Get the name of the department
*
* @return - the name of the department
*/
14. publicString getDeptName(){
return deptName;
}
/**
* Get the manager of the department. The manager is indicat
ed by the
* mgrEmpId passed on the constructor. The manager must be
an employee of
* the department, otherwise null is returned.
*
* @return - the department manager.
*/
publicEmployee getManager(){
if(manager ==null){
for(Employee emp : employees){
if(emp.getEmployeeNumber()== mgrEmpId){
manager = emp;
break;
}
}
}
return manager;
}
/**
* Get the number of employees in the department
*
* @return - the number of employees in the department
*/
publicint getNoEmployees(){
return employees.size();
}
/**
15. * Get an employee given an index position
*
* @param emp -
* the employee to return
* @return - the employee at the given position
* @throws IndexOutOfBoundsException
* if the index is less that 0 or greater than or equal t
o the
* number of employees.
*/
publicEmployee getEmployee(int index){
return employees.get(index);
}
/**
* Get total number of vacation days of all employees in the
department
*
* @return - the total number of vacation days
*/
publicint getTotalVacationDays(){
int totalVacationDays =0;
for(Employee emp : employees){
totalVacationDays += emp.getVacationDays();
}
return totalVacationDays;
}
publicboolean equals(Object object){
if(object instanceofDepartment){
return deptCode.equals(((Department) object).getDeptCode());
}
returnfalse;
}
16. }
Lab8/edu/iup/cosc210/company/bo/Employee.classpackage
edu.iup.cosc210.company.bo;
publicsynchronizedclass Employee {
private int employeeNumber;
private String firstName;
private String lastName;
private String deptCode;
private Department department;
private java.util.Date hireDate;
private char employeeType;
private double salary;
private double hourlyRate;
private short vacationDays;
private byte training;
privatestatic int nextAvailableEmployeeNumber;
static void <clinit>();
public void Employee(int, String, String, String,
java.util.Date, char, double, double, short, byte);
public int getEmployeeNumber();
publicstatic int getNextAvailableEmployeeNumber();
public String getFirstName();
public String getLastName();
public String getDeptCode();
public Department getDepartment();
public void setDepartment(Department);
public java.util.Date getHireDate();
public char getEmployeeType();
public double getSalary();
public double getHourlyRate();
public short getVacationDays();
public byte getTraining();
public boolean equals(Object);
}
17. Lab8/edu/iup/cosc210/company/bo/Employee.javaLab8/edu/iup/
cosc210/company/bo/Employee.javapackage edu.iup.cosc210.co
mpany.bo;
import java.util.Date;
/**
* An Employee of a Company.
*
* @author David T. Smith
*/
publicclassEmployee{
privateint employeeNumber;
privateString firstName;
privateString lastName;
privateString deptCode;
privateDepartment department;
privateDate hireDate;
privatechar employeeType;
privatedouble salary;
privatedouble hourlyRate;
privateshort vacationDays;
privatebyte training;
privatestaticint nextAvailableEmployeeNumber =0;
/**
* Constructor for Employee
*
* @param employeeNumber
* - the employee's id number
* @param firstName
* - first name of the employee
* @param lastName
18. * - last name of the employee
* @param deptCode
* - department code of the employee's department
* @param hireDate
* - the date the employee was hired
* @param employeeType
* -
indicates if an employee is Exempt ('E'), salaried ('S'),
* or hourly ('H')
* @param salary
* - the employee's salary
* @param hourlyRate
* - the employee's hourlyRate
* @param vacationDays
* - the number of vacation days
* @param training
* -
a byte using bits to indicated the training the employee has
* received
*/
publicEmployee(int employeeNumber,String firstName,String la
stName,
String deptCode,Date hireDate,char employeeType,double salar
y,
double hourlyRate,short vacationDays,byte training){
super();
this.employeeNumber = employeeNumber;
if(employeeNumber >= nextAvailableEmployeeNumber){
nextAvailableEmployeeNumber = employeeNumber +1;
}
this.firstName = firstName;
this.lastName = lastName;
this.deptCode = deptCode;
this.hireDate = hireDate;
19. this.employeeType = employeeType;
this.salary = salary;
this.hourlyRate = hourlyRate;
this.vacationDays = vacationDays;
this.training = training;
}
/**
* Get the employee number
*
* @return - the employee number
*/
publicint getEmployeeNumber(){
return employeeNumber;
}
/**
* Get the next available employee number. This will be one
greater
* than the highest employee numbers of all Employee instan
ces.
*
* @return next available employee number
*/
publicstaticint getNextAvailableEmployeeNumber(){
return nextAvailableEmployeeNumber;
}
/**
* Get the employee's first name
*
* @return - the employee's first name
*/
publicString getFirstName(){
return firstName;
20. }
/**
* Get the employee's last name
*
* @return - the employee's last name
*/
publicString getLastName(){
return lastName;
}
/**
* Get the employee's department code.
*
* @return - the employee's department code
*/
publicString getDeptCode(){
return deptCode;
}
/**
* Get the employee's department.
*
* @return - the employee's department
*/
publicDepartment getDepartment(){
return department;
}
/**
* Set the employee's department.
*
* @param department - the employee's department
*/
publicvoid setDepartment(Department department){
if(this.department !=null&&!this.department.equals(department)
21. ){
this.department.removeEmployee(this);
}
if(department ==null){
department =null;
deptCode ="";
return;
}
boolean doAdd =false;
if(this.department ==null||!this.department.equals(department)){
doAdd =true;
}
this.deptCode = department.getDeptCode();
this.department = department;
if(doAdd){
department.addEmployee(this);
}
}
/**
* Get the employee's hire date as a string of the form mm/dd
/yyyy.
*
* @return - returns the employee's hire date
*/
publicDate getHireDate(){
return hireDate;
}
/**
22. * Get the employee's type E for exempt, S for salaried, H fo
r hourly
*
* @return - the employee's type
*/
publicchar getEmployeeType(){
return employeeType;
}
/**
* Get the employee's salary
*
* @return - the employee's salary
*/
publicdouble getSalary(){
return salary;
}
/**
* Get the employee's hourly rate
*
* @return - the employee's hourly rate
*/
publicdouble getHourlyRate(){
return hourlyRate;
}
/**
* Get the number of vacation days for an employee
*
* @return - the number of vacation days an employee has
*/
publicshort getVacationDays(){
return vacationDays;
}
23. /**
* Get the encoded traning byte.
*
* @return -
a byte whose bits indicate traingin the employee has recieved
*/
publicbyte getTraining(){
return training;
}
publicboolean equals(Object object){
if(object instanceofEmployee){
return employeeNumber ==((Employee) object).getEmployeeNu
mber();
}
returnfalse;
}
}
Lab8/edu/iup/cosc210/company/io/DepartmentReader.classpack
age edu.iup.cosc210.company.io;
publicsynchronizedclass DepartmentReader {
java.io.BufferedReader input;
public void DepartmentReader(String) throws
java.io.FileNotFoundException;
public edu.iup.cosc210.company.bo.Department
readDepartment() throws java.io.IOException;
public void close() throws java.io.IOException;
}
Lab8/edu/iup/cosc210/company/io/DepartmentReader.javaLab8/
edu/iup/cosc210/company/io/DepartmentReader.javapackage ed
u.iup.cosc210.company.io;
24. import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import edu.iup.cosc210.company.bo.Department;
/**
* Helper class to read departments from a comma separated
* department text file. The method readDepartment() returns
* the next department from the department file.
*
* @author David T. Smith
*/
publicclassDepartmentReader{
BufferedReader input;
/**
* Constructor - opens the department file.
* @param fileName - name of the department file
* @throws FileNotFoundException -
in the event the file could not be opened
*/
publicDepartmentReader(String fileName)throwsFileNotFoundE
xception{
input =newBufferedReader(newFileReader(fileName));
}
/**
* Read the next department from the department file.
* @return a department. Returns null in the event the end of
* the department file is reached.
* @throws IOException
*/
publicDepartment readDepartment()throwsIOException{
String line = input.readLine();
25. // Test for end of file
if(line ==null){
returnnull;
}
String[] parts = line.split(",");
String deptCode = parts[0];
String deptName = parts[1];
int mgrEmpId =Integer.parseInt(parts[2]);
returnnewDepartment(deptCode, deptName, mgrEmpId);
}
/**
* Close the department file
* @throws IOException
*/
publicvoid close()throwsIOException{
input.close();
}
}
Lab8/edu/iup/cosc210/company/io/EmployeeInputStream.classp
ackage edu.iup.cosc210.company.io;
publicsynchronizedclass EmployeeInputStream {
private java.io.DataInputStream input;
private byte[] firstNameBytes;
private byte[] lastNameBytes;
private byte[] deptCodeBytes;
public void EmployeeInputStream(String) throws
java.io.FileNotFoundException;
public edu.iup.cosc210.company.bo.Employee
readEmployee() throws java.io.IOException;
public void close() throws java.io.IOException;
}
26. Lab8/edu/iup/cosc210/company/io/EmployeeInputStream.javaLa
b8/edu/iup/cosc210/company/io/EmployeeInputStream.javapack
age edu.iup.cosc210.company.io;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Date;
import edu.iup.cosc210.company.bo.Employee;
/**
* Helper class to read employees from a binary employee file.
* The method readEmployee() returns the next employee from
* the employee file.
*
* @author David T. Smith
*/
publicclassEmployeeInputStream{
privateDataInputStream input;
// declare byte buffers for the ascii fields.
privatebyte[] firstNameBytes =newbyte[10];
privatebyte[] lastNameBytes =newbyte[15];
privatebyte[] deptCodeBytes =newbyte[2];
/**
* Constructor - opens the employee file.
* @param fileName - name of the employee file
* @throws FileNotFoundException -
in the event the file could not be opened
*/
publicEmployeeInputStream(String fileName)throwsFileNotFou
27. ndException{
input =newDataInputStream(newFileInputStream(fileName
));
}
/**
* Read the next employee from the employee file.
* @return an employee. Returns null in the event the end of
* the employee file is reached.
* @throws IOException
*/
@SuppressWarnings("deprecation")
publicEmployee readEmployee()throwsIOException{
// Test for end of file
if(input.available()==0){
returnnull;
}
int employeeNumber = input.readInt();
input.read(firstNameBytes);
String firstName =newString(firstNameBytes).trim();
input.read(lastNameBytes);
String lastName =newString(lastNameBytes).trim();
input.read(deptCodeBytes);
String deptCode =newString(deptCodeBytes);
byte month = input.readByte();
byte day = input.readByte();
short year = input.readShort();
Date hireDate =newDate(year -1900, month -1, day);
char empType =(char) input.readByte();
28. double salary = input.readDouble();
double hourlyRate = input.readDouble();
short vacationDays = input.readShort();
byte training = input.readByte();
Employee employee =newEmployee(employeeNumber, firstNam
e,
lastName, deptCode, hireDate, empType, salary, hour
lyRate, vacationDays, training);
return employee;
}
/**
* Close the employee file
* @throws IOException
*/
publicvoid close()throwsIOException{
input.close();
}
}
COSC 210 – Object Oriented Programming
Assignment 8
The objectives of this assignment are to:
1) Gain an understanding and experience using Swing.
2) Gain an understanding of JFrame, JTable, JDialog,
JOptionPane, JTextField, JRadioBox, JCheckBox, JButton,
JMenu, JMenuBar, Action, AbstractAction, and layout
managers.
3) Modify an existing program to meet new requirements
applying concepts of objectives 1 and 2.
29. 4) Continue to practice good programming techniques.
AFTER YOU HAVE COMPLETED, create a jar file named
[your name]Assignment8.zip file containing your project which
includes sources. Upload your .zip file to Moodle. Printout all
files you created or modified. Provide a screen shot of the
frame and all dialogs. Turn-in all printouts and screen shots.
COSC 210 – Fundamentals of Computer Science
Assignment 8 Problem Statement
In assignments 4 and 6, data for a Company Employee
administration system was loaded into memory. For this
assignment you are required to add a GUI. The GUI enables
user to view the employee data and perform updates. However,
use Lab8 on the tomcat drive as your starting point since it has
a few additional changes. For example the Company now
maintains a list of all employees in addition to a list of
departments.
The GUI to be added is as follows:
On starting your view/edit program, the following frame is to be
displayed:
The menu bar of the frame must have a file and help menu as
shown below:
The actions of the menu items and toolbar are as follows:
New - Display the New Employee dialog to add a new
employee.
Open - Display the Update Employee dialog to edit a selected
employee.
Delete - Delete the selected employee. Note: A Delete
Employee confirmation dialog must first be displayed.
30. Print – Prints the company report as defined in assignment 6.
Exit - Exits the program. The employee file is updated.
Help - Displays the about dialog.
The supporting dialogs are as follows:
Additional specifications:
1) All dialogs are modal.
2) The department combo box must list all the departments
loaded from the Depts.txt file.
3) The ‘X’ on all dialogs are to perform the same actions the
“No”/”Cancel” buttons (“OK” on the about dialog).
4) A new employee added at the end of the display of
employees. The new employee is selected within the display.
5) For a new employee, the employee ID is assigned the next
highest available number. Note there is a static method in
Employee that will get the next available employee number.
6) On updating an employee, update the display in the Company
Employees frame to reflect any changes. The updated employee
is selected in the frame.
Implementation Requirements:
1) All classes for the GUI are to be placed in package
edu.iup.cosc210.company.ui.
2) DO NOT add GUI code to the edu.iup.cosc210.company
classes.
3) Data for the training fields are derived from the training byte
31. as follows:
The left most bit indicates orientation training
The 2nd bit from left indicates management training
The 3rd bit from left indicates technical training
The 4th bit from left indicates operations training
The 5th bit from left indicates administrative training
The 6th bit from left indicates quality control training
The 7th bit from left indicates sales training
The 8th bit from left indicates safety training
4) Use AbstractAction when defining the tool bar and menu bar
buttons and share the action between the corresponding tool bar
and menu bar buttons.
5) ABIDE by good programming practices. Define javadoc,
good formatting, etc.
6) Add your name to the list of authors for whatever files you
change (but not to files you don’t change). For new files make
sure you indicate that you are the author.
7) FOLLOW THE DIRECTIONS ABOVE.
Bonus:
1) Add a filter button to the toolbar of the frame. The filter
button must display a dialog to enable entry of partial words for
the first name and last name. On entering partial words for first
name and last name, the frame is to display only those
employees whose names match (contain a substring) the partial
32. words. (5 points).
2) Have the employees sorted by last name and then first name.
You must be careful to insure that inserted employees and
employees with changed names get placed in the correct
positions. Hint: You need to use Collections.binarySearch. (5
points)