Skip to content

Commit

Permalink
Merge 9d95a2f into 839989b
Browse files Browse the repository at this point in the history
  • Loading branch information
jietung committed Oct 3, 2019
2 parents 839989b + 9d95a2f commit c308654
Show file tree
Hide file tree
Showing 150 changed files with 882 additions and 882 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ plugins {
}

// Specifies the entry point of the application
mainClassName = 'seedu.address.Main'
mainClassName = 'seedu.exercise.Main'

sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
Expand Down
2 changes: 1 addition & 1 deletion docs/SettingUp.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Do not disable them. If you have disabled them, go to `File` > `Settings` > `Plu

== Verifying the setup

. Run the `seedu.address.Main` and try a few commands
. Run the `seedu.exercise.Main` and try a few commands
. <<Testing#,Run the tests>> to ensure they all pass.

== Configurations to do before writing code
Expand Down
6 changes: 3 additions & 3 deletions docs/Testing.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ See <<UsingGradle#, UsingGradle.adoc>> for more info on how to run tests using G
We have three types of tests:

. _Unit tests_ targeting the lowest level methods/classes. +
e.g. `seedu.address.commons.StringUtilTest`
e.g. `seedu.exercise.commons.StringUtilTest`
. _Integration tests_ that are checking the integration of multiple code units (those code units are assumed to be working). +
e.g. `seedu.address.storage.StorageManagerTest`
e.g. `seedu.exercise.storage.StorageManagerTest`
. Hybrids of unit and integration tests. These test are checking multiple code units as well as how the are connected together. +
e.g. `seedu.address.logic.LogicManagerTest`
e.g. `seedu.exercise.logic.LogicManagerTest`


== Troubleshooting Testing
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/RemovingFields.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Fortunately, the IntelliJ IDEA provides a robust refactoring tool that can ident
Let's try to use it as much as we can.

=== Assisted refactoring
The `address` field in `Person` is actually an instance of the `seedu.address.model.person.Address` class.
The `address` field in `Person` is actually an instance of the `seedu.exercise.model.person.Address` class.
Since removing the `Address` class will break the application, we start by identifying ``Address``'s usages.
This allows us to see code that depends on `Address` to function properly and edit them on a case-by-case basis.
Right-click the `Address` class and select `Refactor` > `Safe Delete` through the menu.
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/TracingCode.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ However, the execution path through a GUI is often somewhat obscure due to vario
used by GUI frameworks, which happens to be the case here too. Therefore, let us put the breakpoint where the UI transfers
control to the Logic component. According to the sequence diagram, the UI component yields control to the Logic component
through a method named `execute`. Searching through the code base for `execute()` yields a promising candidate in
`seedu.address.ui.CommandBox.CommandExecutor`.
`seedu.exercise.ui.CommandBox.CommandExecutor`.

.Using the `Search for target by name` feature. `Navigate` > `Symbol`.
image::Execute.png[]
Expand Down
17 changes: 0 additions & 17 deletions src/main/java/seedu/address/model/ReadOnlyExerciseBook.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package seedu.address;
package seedu.exercise;

import java.nio.file.Path;
import java.nio.file.Paths;
Expand All @@ -7,8 +7,8 @@
import java.util.logging.Logger;

import javafx.application.Application;
import seedu.address.commons.core.LogsCenter;
import seedu.address.commons.util.FileUtil;
import seedu.exercise.commons.core.LogsCenter;
import seedu.exercise.commons.util.FileUtil;

/**
* Represents the parsed command-line parameters given to the application.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package seedu.address;
package seedu.exercise;

import javafx.application.Application;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package seedu.address;
package seedu.exercise;

import java.io.IOException;
import java.nio.file.Path;
Expand All @@ -7,29 +7,29 @@

import javafx.application.Application;
import javafx.stage.Stage;
import seedu.address.commons.core.Config;
import seedu.address.commons.core.LogsCenter;
import seedu.address.commons.core.Version;
import seedu.address.commons.exceptions.DataConversionException;
import seedu.address.commons.util.ConfigUtil;
import seedu.address.commons.util.StringUtil;
import seedu.address.logic.Logic;
import seedu.address.logic.LogicManager;
import seedu.address.model.ExerciseBook;
import seedu.address.model.Model;
import seedu.address.model.ModelManager;
import seedu.address.model.ReadOnlyExerciseBook;
import seedu.address.model.ReadOnlyUserPrefs;
import seedu.address.model.UserPrefs;
import seedu.address.model.util.SampleDataUtil;
import seedu.address.storage.ExerciseBookStorage;
import seedu.address.storage.JsonExerciseBookStorage;
import seedu.address.storage.JsonUserPrefsStorage;
import seedu.address.storage.Storage;
import seedu.address.storage.StorageManager;
import seedu.address.storage.UserPrefsStorage;
import seedu.address.ui.Ui;
import seedu.address.ui.UiManager;
import seedu.exercise.commons.core.Config;
import seedu.exercise.commons.core.LogsCenter;
import seedu.exercise.commons.core.Version;
import seedu.exercise.commons.exceptions.DataConversionException;
import seedu.exercise.commons.util.ConfigUtil;
import seedu.exercise.commons.util.StringUtil;
import seedu.exercise.logic.Logic;
import seedu.exercise.logic.LogicManager;
import seedu.exercise.model.ExerciseBook;
import seedu.exercise.model.Model;
import seedu.exercise.model.ModelManager;
import seedu.exercise.model.ReadOnlyExerciseBook;
import seedu.exercise.model.ReadOnlyUserPrefs;
import seedu.exercise.model.UserPrefs;
import seedu.exercise.model.util.SampleDataUtil;
import seedu.exercise.storage.ExerciseBookStorage;
import seedu.exercise.storage.JsonExerciseBookStorage;
import seedu.exercise.storage.JsonUserPrefsStorage;
import seedu.exercise.storage.Storage;
import seedu.exercise.storage.StorageManager;
import seedu.exercise.storage.UserPrefsStorage;
import seedu.exercise.ui.Ui;
import seedu.exercise.ui.UiManager;

/**
* Runs the application.
Expand Down Expand Up @@ -69,19 +69,19 @@ public void init() throws Exception {
}

/**
* Returns a {@code ModelManager} with the data from {@code storage}'s address book and {@code userPrefs}. <br>
* The data from the sample address book will be used instead if {@code storage}'s address book is not found,
* or an empty address book will be used instead if errors occur when reading {@code storage}'s address book.
* Returns a {@code ModelManager} with the data from {@code storage}'s exercise book and {@code userPrefs}. <br>
* The data from the sample exercise book will be used instead if {@code storage}'s exercise book is not found,
* or an empty exercise book will be used instead if errors occur when reading {@code storage}'s exercise book.
*/
private Model initModelManager(Storage storage, ReadOnlyUserPrefs userPrefs) {
Optional<ReadOnlyExerciseBook> addressBookOptional;
Optional<ReadOnlyExerciseBook> exerciseBookOptional;
ReadOnlyExerciseBook initialData;
try {
addressBookOptional = storage.readExerciseBook();
if (!addressBookOptional.isPresent()) {
exerciseBookOptional = storage.readExerciseBook();
if (!exerciseBookOptional.isPresent()) {
logger.info("Data file not found. Will be starting with a sample ExerciseBook");
}
initialData = addressBookOptional.orElseGet(SampleDataUtil::getSampleExerciseBook);
initialData = exerciseBookOptional.orElseGet(SampleDataUtil::getSampleExerciseBook);
} catch (DataConversionException e) {
logger.warning("Data file not in the correct format. Will be starting with an empty ExerciseBook");
initialData = new ExerciseBook();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package seedu.address.commons.core;
package seedu.exercise.commons.core;

import java.nio.file.Path;
import java.nio.file.Paths;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package seedu.address.commons.core;
package seedu.exercise.commons.core;

import java.awt.Point;
import java.io.Serializable;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package seedu.address.commons.core;
package seedu.exercise.commons.core;

import java.io.IOException;
import java.util.Arrays;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package seedu.address.commons.core;
package seedu.exercise.commons.core;

/**
* Container for user visible messages.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package seedu.address.commons.core;
package seedu.exercise.commons.core;

import java.util.regex.Matcher;
import java.util.regex.Pattern;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package seedu.address.commons.core.index;
package seedu.exercise.commons.core.index;

/**
* Represents a zero-based or one-based index.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package seedu.address.commons.exceptions;
package seedu.exercise.commons.exceptions;

/**
* Represents an error during conversion of data from one format to another
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package seedu.address.commons.exceptions;
package seedu.exercise.commons.exceptions;

/**
* Signals that some given data does not fulfill some constraints.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package seedu.address.commons.util;
package seedu.exercise.commons.util;

import static java.util.Objects.requireNonNull;

import javafx.scene.image.Image;
import seedu.address.MainApp;
import seedu.exercise.MainApp;

/**
* A container for App specific utility functions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package seedu.address.commons.util;
package seedu.exercise.commons.util;

import static java.util.Objects.requireNonNull;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package seedu.address.commons.util;
package seedu.exercise.commons.util;

import java.io.IOException;
import java.nio.file.Path;
import java.util.Optional;

import seedu.address.commons.core.Config;
import seedu.address.commons.exceptions.DataConversionException;
import seedu.exercise.commons.core.Config;
import seedu.exercise.commons.exceptions.DataConversionException;

/**
* A class for accessing the Config File.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package seedu.address.commons.util;
package seedu.exercise.commons.util;

import java.io.IOException;
import java.nio.file.Files;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package seedu.address.commons.util;
package seedu.exercise.commons.util;

import static java.util.Objects.requireNonNull;

Expand All @@ -20,8 +20,8 @@
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;

import seedu.address.commons.core.LogsCenter;
import seedu.address.commons.exceptions.DataConversionException;
import seedu.exercise.commons.core.LogsCenter;
import seedu.exercise.commons.exceptions.DataConversionException;

/**
* Converts a Java object instance to JSON and vice versa
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package seedu.address.commons.util;
package seedu.exercise.commons.util;

import static java.util.Objects.requireNonNull;
import static seedu.address.commons.util.AppUtil.checkArgument;
import static seedu.exercise.commons.util.AppUtil.checkArgument;

import java.io.PrintWriter;
import java.io.StringWriter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package seedu.address.logic;
package seedu.exercise.logic;

import java.nio.file.Path;

import javafx.collections.ObservableList;
import seedu.address.commons.core.GuiSettings;
import seedu.address.logic.commands.CommandResult;
import seedu.address.logic.commands.exceptions.CommandException;
import seedu.address.logic.parser.exceptions.ParseException;
import seedu.address.model.ReadOnlyExerciseBook;
import seedu.address.model.exercise.Exercise;
import seedu.exercise.commons.core.GuiSettings;
import seedu.exercise.logic.commands.CommandResult;
import seedu.exercise.logic.commands.exceptions.CommandException;
import seedu.exercise.logic.parser.exceptions.ParseException;
import seedu.exercise.model.ReadOnlyExerciseBook;
import seedu.exercise.model.exercise.Exercise;

/**
* API of the Logic component
Expand All @@ -26,19 +26,19 @@ public interface Logic {
/**
* Returns the ExerciseBook.
*
* @see seedu.address.model.Model#getAllData()
* @see seedu.exercise.model.Model#getAllData()
*/
ReadOnlyExerciseBook getAddressBook();
ReadOnlyExerciseBook getExerciseBook();

/** Returns an unmodifiable view of the filtered list of persons */
ObservableList<Exercise> getFilteredExerciseList();

ObservableList<Exercise> getSortedExerciseList();

/**
* Returns the user prefs' address book file path.
* Returns the user prefs' exercise book file path.
*/
Path getAddressBookFilePath();
Path getExerciseBookFilePath();

/**
* Returns the user prefs' GUI settings.
Expand Down
Loading

0 comments on commit c308654

Please sign in to comment.