Skip to content
This repository has been archived by the owner on Mar 16, 2020. It is now read-only.

Commit

Permalink
Finalise the name of the program as Bari
Browse files Browse the repository at this point in the history
  • Loading branch information
Parcly-Taxel committed Sep 13, 2019
1 parent f5ec3be commit 74d3cdf
Show file tree
Hide file tree
Showing 29 changed files with 87 additions and 92 deletions.
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# Puke: the working personal assistant chatbot
# Bari, a personal assistant chatbot

[![Build Status](https://travis-ci.com/Parcly-Taxel/duke.svg?branch=master)](https://travis-ci.com/Parcly-Taxel/duke)

## Feedback, Bug Reports

* If you have feedback or bug reports, please post in [se-edu/duke issue tracker](https://github.com/se-edu/duke/issues).
* We welcome pull requests too.
[![Build Status](https://travis-ci.com/Parcly-Taxel/duke.svg?branch=master)](https://travis-ci.com/Parcly-Taxel/duke)
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
id 'org.openjfx.javafxplugin' version '0.0.8'
}

group "puke"
group "bari"
version "0.9.5"

repositories {
Expand All @@ -27,14 +27,14 @@ javafx {
}

shadowJar {
archiveBaseName = "puke"
archiveBaseName = "bari"
archiveVersion = "0.9.5"
archiveClassifier = null
archiveAppendix = null
}

application {
mainClassName = "puke.Main"
mainClassName = "bari.Main"
}

test {
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rootProject.name = "puke"
rootProject.name = "bari"
14 changes: 7 additions & 7 deletions src/main/java/puke/Puke.java → src/main/java/bari/Bari.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package puke;
package bari;

import puke.command.Command;
import puke.command.ResponseStrings;
import puke.storage.Storage;
import puke.task.TaskList;
import bari.command.Command;
import bari.command.ResponseStrings;
import bari.storage.Storage;
import bari.task.TaskList;
import java.io.FileNotFoundException;

import javafx.application.Application;
Expand All @@ -13,7 +13,7 @@
* The main logical class, responsible for initialisation of data structures
* and passing arguments to them for processing.
*/
public class Puke extends Application {
public class Bari extends Application {
private TaskList tasks;
private Storage storage;

Expand All @@ -27,7 +27,7 @@ String getResponse(String cmd) {
}
}

Puke() {
Bari() {
try {
storage = new Storage("tasks.txt");
tasks = new TaskList(storage.read());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package puke;
package bari;

import java.io.IOException;
import java.util.Collections;
Expand Down Expand Up @@ -53,7 +53,7 @@ static DialogBox getUserDialog(String text, Image img) {
return new DialogBox(text, img);
}

static DialogBox getDukeDialog(String text, Image img) {
static DialogBox getBariDialog(String text, Image img) {
var db = new DialogBox(text, img);
db.flip();
return db;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package puke;
package bari;

import javafx.application.Application;

Expand Down
10 changes: 5 additions & 5 deletions src/main/java/puke/Main.java → src/main/java/bari/Main.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package puke;
package bari;

import java.io.IOException;
import javafx.application.Application;
Expand All @@ -8,10 +8,10 @@
import javafx.stage.Stage;

/**
* A GUI for Duke using FXML.
* A GUI for Bari using FXML.
*/
public class Main extends Application {
private Puke puke = new Puke();
private Bari bari = new Bari();

@Override
public void start(Stage stage) {
Expand All @@ -20,8 +20,8 @@ public void start(Stage stage) {
AnchorPane ap = fxmlLoader.load();
Scene scene = new Scene(ap);
stage.setScene(scene);
stage.setTitle("Puke");
fxmlLoader.<MainWindow>getController().setPuke(puke);
stage.setTitle("Bari");
fxmlLoader.<MainWindow>getController().setBari(bari);
stage.show();
} catch (IOException e) {
e.printStackTrace();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package puke;
package bari;

import java.util.Timer;
import java.util.TimerTask;
Expand All @@ -23,32 +23,32 @@ public class MainWindow extends AnchorPane {
@FXML
private Button sendButton;

private Puke puke;
private Bari bari;

private Image userImage = new Image(this.getClass().getResourceAsStream("/images/DaUser.png"));
private Image pukeImage = new Image(this.getClass().getResourceAsStream("/images/DaDuke.png"));
private Image bariImage = new Image(this.getClass().getResourceAsStream("/images/DaDuke.png"));

@FXML
public void initialize() {
scrollPane.vvalueProperty().bind(dialogContainer.heightProperty());
}

public void setPuke(Puke d) {
puke = d;
public void setBari(Bari d) {
bari = d;
}

/**
* Creates two dialog boxes, one echoing user input and the other
* containing Puke's reply and then appends them to the dialog container.
* containing Bari's reply and then appends them to the dialog container.
* Clears the user input after processing.
*/
@FXML
private void handleUserInput() {
String input = userInput.getText();
String response = puke.getResponse(input);
String response = bari.getResponse(input);
dialogContainer.getChildren().addAll(
DialogBox.getUserDialog(input, userImage),
DialogBox.getDukeDialog(response, pukeImage)
DialogBox.getBariDialog(response, bariImage)
);
userInput.clear();
// This response is only produced by an ExitCommand
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package puke.command;
package bari.command;

import puke.storage.Storage;
import puke.task.Task;
import puke.task.TaskList;
import bari.storage.Storage;
import bari.task.Task;
import bari.task.TaskList;

/**
* Class representing a command to add a new task.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package puke.command;
package bari.command;

import puke.storage.Storage;
import puke.task.Deadline;
import puke.task.Event;
import puke.task.TaskList;
import puke.task.Todo;
import bari.storage.Storage;
import bari.task.Deadline;
import bari.task.Event;
import bari.task.TaskList;
import bari.task.Todo;

/**
* Abstract class representing individual commands.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package puke.command;
package bari.command;

import puke.storage.Storage;
import puke.task.TaskList;
import bari.storage.Storage;
import bari.task.TaskList;

/**
* Class representing a command to delete an item from the task list.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package puke.command;
package bari.command;

import puke.storage.Storage;
import puke.task.TaskList;
import bari.storage.Storage;
import bari.task.TaskList;

/**
* Class representing a command to mark an item in the task list as done.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package puke.command;
package bari.command;

import puke.storage.Storage;
import puke.task.TaskList;
import bari.storage.Storage;
import bari.task.TaskList;

/**
* Class representing a command to exit Duke.
* Class representing a command to exit the program.
*/
public class ExitCommand extends Command {
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package puke.command;
package bari.command;

import puke.storage.Storage;
import puke.task.TaskList;
import bari.storage.Storage;
import bari.task.TaskList;

/**
* Class representing a command to find items in the task list matching some keyword,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package puke.command;
package bari.command;

import puke.storage.Storage;
import puke.task.TaskList;
import bari.storage.Storage;
import bari.task.TaskList;

/**
* Class representing a command to list items in a task list.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package puke.command;
package bari.command;

import puke.storage.Storage;
import puke.task.TaskList;
import bari.storage.Storage;
import bari.task.TaskList;
import java.io.IOException;
import java.util.ArrayList;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package puke.command;
package bari.command;

import puke.storage.Storage;
import puke.task.TaskList;
import bari.storage.Storage;
import bari.task.TaskList;

/**
* Class representing a command to sort the task list in-place.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package puke.storage;
package bari.storage;

import java.io.File;
import java.io.FileNotFoundException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package puke.task;
package bari.task;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package puke.task;
package bari.task;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package puke.task;
package bari.task;

/**
* A generic task, which can be marked as done.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package puke.task;
package bari.task;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package puke.task;
package bari.task;

/**
* Class representing a task to be done, but not at any particular time.
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/view/MainWindow.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0"
prefWidth="400.0" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="puke.MainWindow">
fx:controller="bari.MainWindow">
<TextField fx:id="userInput" layoutY="558.0" onAction="#handleUserInput" prefHeight="41.0" prefWidth="324.0"
AnchorPane.bottomAnchor="1.0"/>
<Button fx:id="sendButton" layoutX="324.0" layoutY="558.0" mnemonicParsing="false" onAction="#handleUserInput"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package puke;
package bari;

import puke.command.AddCommand;
import puke.command.Command;
import puke.command.DeleteCommand;
import puke.task.Deadline;
import puke.task.Event;
import puke.task.TaskList;
import puke.task.Todo;
import bari.command.AddCommand;
import bari.command.Command;
import bari.command.DeleteCommand;
import bari.task.Deadline;
import bari.task.Event;
import bari.task.TaskList;
import bari.task.Todo;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;

class PukeTest {
class BariTest {
@Test
void testTask() {
Todo t1 = Todo.parse("dig a trench from the fence to lunchtime");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package puke;
package bari;

import puke.command.ResponseStrings;
import puke.task.TaskList;
import bari.command.ResponseStrings;
import bari.task.TaskList;

public class ResponseStringsStub extends ResponseStrings {
@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package puke;
package bari;

import puke.storage.Storage;
import bari.storage.Storage;

import java.util.ArrayList;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package puke;
package bari;

import puke.task.Task;
import puke.task.TaskList;
import bari.task.Task;
import bari.task.TaskList;

public class TaskListStub extends TaskList {
private boolean isEmpty = true;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package puke;
package bari;

import puke.task.Task;
import bari.task.Task;

class TaskStub extends Task {
TaskStub() {
Expand Down

0 comments on commit 74d3cdf

Please sign in to comment.