-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #67 from CSC207-2022F-UofT/5-feature-1-user-regist…
…ration-&-log-in User registration & log in
- Loading branch information
Showing
34 changed files
with
796 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package entities; | ||
|
||
// Entity Layer | ||
|
||
public class GeneralUserFactory implements UserFactory { | ||
|
||
/** | ||
* @param name the name of this StudentUser | ||
* @param password the password of this StudentUser | ||
* @return a new StudentUser | ||
*/ | ||
|
||
@Override | ||
public StudentUser createStudent(String name, String password) { | ||
return new StudentUser(name, password); | ||
} | ||
|
||
@Override | ||
public InstructorUser createInstructor(String name, String password) { | ||
return new InstructorUser(name, password); | ||
} | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
package entities; | ||
|
||
|
||
// Entity Layer | ||
|
||
public interface UserFactory { | ||
/** | ||
* Creates Users with the specified name and password | ||
* | ||
* @param name the name of this user | ||
* @param password the password of this user | ||
* @return a User object | ||
*/ | ||
User create(String name, String password); | ||
|
||
StudentUser createStudent(String name, String password); | ||
|
||
InstructorUser createInstructor(String name, String password); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
package screens; | ||
|
||
import javax.swing.*; | ||
import java.awt.*; | ||
import java.awt.event.ActionEvent; | ||
import java.awt.event.ActionListener; | ||
|
||
public class InstructorMain extends JPanel implements ActionListener { | ||
|
||
|
||
/** | ||
* The selectable buttons on the main screen | ||
*/ | ||
JButton taskCreate; | ||
JButton calendar; | ||
JButton courses; | ||
JButton scheduleCT; | ||
|
||
JButton logout; | ||
|
||
/** | ||
* Objects for connecting to the other screens | ||
*/ | ||
CardLayout cardLayout; | ||
JPanel screens; | ||
|
||
/** | ||
* The window of the main screen with buttons connecting to each use case | ||
*/ | ||
public InstructorMain(JPanel screens, CardLayout cardLayout) { | ||
|
||
this.cardLayout = cardLayout; | ||
this.screens = screens; | ||
|
||
// Create label for title of screen | ||
JLabel title = new JLabel("32 Things To Do"); | ||
title.setAlignmentX(Component.CENTER_ALIGNMENT); | ||
|
||
// Create buttons | ||
taskCreate = new JButton("New Task"); | ||
calendar = new JButton("Calendar"); | ||
courses = new JButton("Courses"); | ||
// scheduleCT = new JButton("Schedule Collaborative Task"); | ||
logout = new JButton("Logout"); | ||
|
||
taskCreate.addActionListener(this); | ||
calendar.addActionListener(this); | ||
courses.addActionListener(this); | ||
// scheduleCT.addActionListener(this); | ||
logout.addActionListener(this); | ||
|
||
// Create panel for buttons | ||
JPanel buttons = new JPanel(); | ||
buttons.add(taskCreate); | ||
buttons.add(calendar); | ||
buttons.add(courses); | ||
// buttons.add(scheduleCT); | ||
buttons.add(logout); | ||
|
||
// Add all components to the panel | ||
this.add(title); | ||
this.add(buttons); | ||
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); | ||
} | ||
|
||
/** | ||
* Trigger the corresponding use case upon button click | ||
*/ | ||
public void actionPerformed(ActionEvent evt) { | ||
if (evt.getSource() == taskCreate) { | ||
cardLayout.show(screens, "toDoList"); | ||
} | ||
if (evt.getSource() == calendar) { | ||
cardLayout.show(screens, "calendar"); | ||
} | ||
|
||
if (evt.getSource() == courses) { | ||
cardLayout.show(screens, "course"); | ||
} | ||
// if (evt.getSource() == scheduleCT) { | ||
// cardLayout.show(screens, "scheduleCT"); | ||
// } | ||
if (evt.getSource() == logout) { | ||
cardLayout.show(screens, "welcome"); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.