You are on page 1of 16

PBL PROJECT

DOCUMENTATION

TANISHQ KHETAN [19070122179]


UTKARSH SINGH [19070122186]
UTKARSH TYAGI [19070122187]
A JAVAFX BASES TO-DO LIST APP
USERS:
● New User
● Existing User

USABLE FUNCTIONS:
• Sign up(user)
• Log in(user)
• User Profile(user)
• Access/Update / or Create Events
• Settings

New user needs to sign up and create user account.


Existing user can directly login and use the functions.
Users can only use the functions after they have logged in. Once
logged in, can access all the functions create events, update events, or
delete them according to their choice. Can log out from the app as per
their wish.

Data Base (Administrator side):


It manages the content on the app and updates the features its role is
to maintain the guidelines in the application.
USABLE FUNCTIONS:
• o Authentication during the login
• o Feature Updates(administrator)
Out app is a platform for every age group to that will help the
users to organise their day and increase their productivity. Out app is free and
easy to use.
The functioning of our app is explained using the use case diagram:

 For a new user he needs to sign up (include case) and create a unique
password to register themselves on the app
 Existing user will be able to login directly and use the verify
password(include) for verifying themselves and if they cannot recall their
unique password, they will go through the forgot password case(exclude)
 In the above use case diagram, we have one primary parent actor i.e.,
USER and two primary child actors i.e., NEW USER, EXISTING
USER.
 On the other hand of the system, we have one secondary actor i.e., Data
Base (Administrator)
 The Actor Existing user can communicate with every use case starting
from login and have access to verify password(include) and forgot
password(extend)
 For new user they will have to enter their credentials create an account
(include case) and can use the app
 Use case USER PROFILE has attributes like username, age, DOB i.e.,
Personal details
 Use case SETTINGS provides the user to change his/her special
password, log out from his account, and change settings of the
application.
 Both existing and new user can access all the features of the app they are
ADD EVENT, IMPORTANT TASK, TODAY’s TASK, TOTAL
TASKS.
 Both existing and new user can access setting option to change colour,
appearance and password(all are include case).
 Use case CREATE /DELETE EVENT has features for user to create,
delete, and view the events that need to be completed.
ENTITY - RELATIONSHIP DIAGRAM
Out app is a platform for every age group to that will help the
users to organise their day and increase their productivity. Out app is free and
easy to use.
The functioning of our app is explained using the ER diagram:

 NEW USERS (entity) have a relationship (have to) with SIGN UP


(entity) to and has access to create password(attribute). The relation here
is mandatory one which means the details filled and created are necessary
and will be saved only to the user.
 USERS (entity) have to (mandatory relationship) login and has access to
primary attributes of login as user id and others are username, forgot
password.
 USERS (entity) have (optional many relationship) Add New Event has
access to primary attributes as Title and others are Description create

 USERS (entity) have (optional one relationship) Setting have (optional


many relationship) attributes as change id ,change password, change
background, change appearance.
Here one user can have one setting but settings can have many users

 USERS (entity) have (Mandatory many relationship) list of task has


access to primary attributes as Type of task and others are Mark as
done ,count of task, delete task

 USERS (entity) have (Optional one relationship) Forgot Password has


access to primary attributes as security question and others are enter new
password

Project Screen Shots


CODE SNIPPETS
private void showPassword(ComboBox questions, TextField answer1, TextField
textField1, Statement st, Label errorLabel4, Scene scene4) throws
SQLException {
String query = "Select username , pass , question1 , question2 ,
question3 FROM users";
ResultSet rs = st.executeQuery(query);
boolean correct = false;
String password = null ;

while (rs.next()) {
String username = rs.getString("username");
if (textField1.getText().equals(username)){
if(questions.getValue().equals("What is the name of your
favourite movie?")){
String answer = rs.getString("question1");
if(answer.equals(answer1.getText().strip())){
correct = true;
password = rs.getString("pass");
}
}
else if(questions.getValue().equals("What is the name of your
home town?")){
String answer = rs.getString("question2");
if(answer.equals(answer1.getText().strip())){
correct = true;
password = rs.getString("pass");
}
}
else if(questions.getValue().equals("Which is you favourite
novel?")){
String answer = rs.getString("question3");
if(answer.equals(answer1.getText().strip())){
correct = true;
password = rs.getString("pass");
}
}
}
}

if(correct){
answer1.clear();
textField1.clear();
MessageBox.displayMessage("Your Password is "+password ,"Password"
);
stage.setScene(scene4);
}else{
errorLabel4.setText("Check your answer or account name and try
again");
return;
}
}

private static void createFunction(TextField textField, ListView<HBox>


listView, ListView<HBox> doneEvents , Label completedLabel , BorderPane
borderPane) {
if(textField.getText().strip().equals("")) return;
HBox hBox = new HBox();
Text text = new Text(textField.getText());
text.setFont(Font.font("Helvetica" , FontPosture.REGULAR , 16 ));
text.setFill(Color.WHITE);

VBox vBox2 = new VBox();


vBox2.getChildren().add(text);
Text text1 = new Text();
text1.setText("");
text1.setFill(Color.WHITE);
vBox2.getChildren().add(text1);
text1.setFont(Font.font(10));

RadioButton radioButton = new RadioButton();


hBox.getChildren().add(radioButton);
hBox.getChildren().add(vBox2);
hBox.setSpacing(5);
hBox.setStyle("-fx-background-color : #899968 ; -fx-border-fill:
black");
hBox.setPadding(new Insets(10));
listView.getItems().add(hBox);
radioButton.setOnAction(e->{
if(radioButton.isSelected()){
listView.getItems().remove(hBox);
doneEvents.getItems().add(hBox);
text.setStrikethrough(true);
if(doneEvents.getItems().size()!=0){
completedLabel.setVisible(true);
doneEvents.setMaxHeight(200);
}
}else{
doneEvents.getItems().remove(hBox);
listView.getItems().add(hBox);
text.setStrikethrough(false);
if(doneEvents.getItems().size()==0){
completedLabel.setVisible(false);
}
}
});

textField.clear();
Button details = new Button("Add/View Details");
Button dueDate = new Button("Add Due Date");
Button deleteTask = new Button("Delete Task");
Button close = new Button(" X ");
close.setFont(Font.font(15));
close.setPadding(new Insets(3));
details.setStyle("-fx-background-color : #302f2e ; -fx-text-fill: white
; -fx-background-radius: 0 ; -fx-border-color : white");
details.hoverProperty().addListener((observable, oldValue, newValue) ->
{
if(newValue){
details.setStyle("-fx-background-color : white ; -fx-text-
fill:#302f2e; -fx-background-radius: 0 ; -fx-border-color : white");
}else{
details.setStyle("-fx-background-color : #302f2e ; -fx-text-
fill: white ; -fx-background-radius: 0 ; -fx-border-color : white");
}
});

dueDate.setStyle("-fx-background-color : #302f2e ; -fx-text-fill: white


; -fx-background-radius: 0 ;-fx-border-color : white");
dueDate.hoverProperty().addListener((observable, oldValue, newValue) ->
{
if(newValue){
dueDate.setStyle("-fx-background-color : white ; -fx-text-fill:
#302f2e ; -fx-background-radius: 0 ; -fx-border-color : white");
}else{
dueDate.setStyle("-fx-background-color : #302f2e ; -fx-text-
fill: white ; -fx-background-radius: 0 ; -fx-border-color : white");
}
});

deleteTask.setStyle("-fx-background-color : #302f2e ; -fx-text-fill:


white ; -fx-background-radius: 0 ;-fx-border-color : white");
deleteTask.setMinWidth(175);
deleteTask.hoverProperty().addListener((observable, oldValue, newValue)
-> {
if(newValue){
deleteTask.setStyle("-fx-background-color : white ; -fx-text-
fill:#302f2e ; -fx-background-radius: 0 ; -fx-border-color : white");
}else{
deleteTask.setStyle("-fx-background-color : #302f2e ; -fx-text-
fill: white ; -fx-background-radius: 0 ; -fx-border-color : white");
}
});

Tasks tasks = new Tasks();


tasks.setTask(textField.getText());

int minWidth = 175;


details.setMinWidth(minWidth);
dueDate.setMinWidth(minWidth);
VBox vBox = new VBox();
vBox.setSpacing(10);
vBox.getChildren().add(details);
vBox.getChildren().add(dueDate);
vBox.getChildren().add(deleteTask);

details.setPadding(new Insets(10));
dueDate.setPadding(new Insets(10));
deleteTask.setPadding(new Insets(10));

vBox.setPadding(new Insets(10));
vBox.setStyle("-fx-background-color : #302f2e ; -fx-border-color :
white");
final boolean[] visible = {false};

hBox.setOnMouseClicked(event -> {
borderPane.getChildren().remove(borderPane.getRight());
if(event.getButton() == MouseButton.PRIMARY){
if(!visible[0]){
borderPane.setRight(vBox);
visible[0] = true;
}else{
borderPane.getChildren().remove(vBox);
visible[0] = false;
}
}
});
details.setOnAction(event -> {
int index = vBox.getChildren().indexOf(details);
TextArea textArea = new TextArea();
textArea.setMaxWidth(175);
textArea.setStyle("-fx-control-inner-background: #302f2e ; -fx-
text-fill : white; -fx-background-radius : 0 ");
ObservableList observableList = vBox.getChildren();
for(Object o : observableList){
if(o.getClass().equals(textArea.getClass())){
String string = ((TextArea) o).getText();
vBox.getChildren().remove(o);
tasks.setTaskDescription(string);
return;
}
}
vBox.getChildren().add(index + 1 , textArea);
textArea.setText(tasks.getTaskDescription());
textArea.setWrapText(true);

});

dueDate.setOnAction(event -> {
int index = vBox.getChildren().indexOf(dueDate);
DatePicker datePicker = new DatePicker();
datePicker.setPromptText(tasks.getDueDate());
ObservableList observableList = vBox.getChildren();
for(Object o : observableList){
if(o.getClass().equals(datePicker.getClass())){
if(((DatePicker) o).getValue()!=null) {
String string = ((DatePicker) o).getValue().toString();
tasks.setDueDate(string);
text1.setText("Due Date : " + tasks.getDueDate());
}
vBox.getChildren().remove(o);
return;
}
}
vBox.getChildren().add(index + 1 , datePicker);
});

for(int i = 0 ; i < 10; i++){


Button button = new Button();
button.setStyle("-fx-background-color : #302f2e");
vBox.getChildren().add(button);
}
vBox.setAlignment(Pos.CENTER);
vBox.getChildren().add(close);
close.setStyle("-fx-background-color : #302f2e ; -fx-text-fill: white ;
-fx-background-radius: 100 ; ");
close.setPadding(new Insets(10));
close.hoverProperty().addListener((observable, oldValue, newValue) -> {
if(newValue){
close.setStyle("-fx-background-color : white ; -fx-text-fill:
#302f2e ; -fx-background-radius: 100;");
}else{
close.setStyle("-fx-background-color : #302f2e ; -fx-text-fill:
white ; -fx-background-radius: 100 ;");
}
});

close.setOnAction(event -> {
borderPane.getChildren().remove(vBox);
});

deleteTask.setOnAction(event -> {
listView.getItems().remove(hBox);
doneEvents.getItems().remove(hBox);
borderPane.getChildren().remove(vBox);
});

FUTURE SCOPE

A few more functionalities can be added to the application like moving the task between the different
list.

You might also like