Skip to content

Commit

Permalink
Fix merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
blimyj committed Oct 31, 2019
2 parents d05b7a9 + 3936e50 commit f0b008d
Show file tree
Hide file tree
Showing 21 changed files with 23 additions and 48 deletions.
3 changes: 1 addition & 2 deletions src/main/java/seedu/elisa/logic/commands/AddCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ public boolean equals(Object other) {

@Override
public void reverse(ItemModel model) throws CommandException {
model.removeItem(toAdd);
model.getItemStorage().remove(toAdd);
model.deleteItem(toAdd);

if (toAdd.hasAutoReschedule()) {
Event event = toAdd.getEvent().get(); // if autoReschedule is present, item definitely has an event.
Expand Down
33 changes: 5 additions & 28 deletions src/main/java/seedu/elisa/model/ItemModelManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -249,40 +249,22 @@ public String getJoke() {
* @return the item that was removed
*/
public Item removeItem(int index) {
Item item = visualList.removeItemFromList(index);
Item item = visualList.get(index);
return removeItem(item);
}

/**
* remove the given item from the list(s)
* */

public Item removeItem(Item item) {
Item removedItem = visualList.removeItemFromList(item);
if (visualList instanceof TaskList) {
taskList.removeItemFromList(removedItem);
} else if (visualList instanceof EventList) {
eventList.removeItemFromList(removedItem);
} else if (visualList instanceof ReminderList) {
reminderList.removeItemFromList(removedItem);
} else {
// never reached here as there are only three variants for the visualList
}
activeReminders.remove(item);
futureReminders.remove(item);
return removedItem;
}

/**
* Removes an item from a list. Used for edit command to remove the old item.
* @param item the item to be removed from the list
* @return the item that is removed.
*/
private Item removeFromSeparateList(Item item) {
public Item removeItem(Item item) {
visualList.remove(item);
taskList.remove(item);
eventList.remove(item);
reminderList.remove(item);
futureReminders.remove(item);
activeReminders.remove(item);
return item;
}

Expand Down Expand Up @@ -311,13 +293,8 @@ public Item deleteItem(int index) {
* @return the item that was deleted from the program
*/
public Item deleteItem(Item item) {
visualList.removeItemFromList(item);
itemStorage.remove(item);
taskList.removeItemFromList(item);
eventList.removeItemFromList(item);
reminderList.removeItemFromList(item);
activeReminders.remove(item);
futureReminders.remove(item);
removeItem(item);
if (priorityMode.getValue()) {
getNextTask();
}
Expand Down
21 changes: 10 additions & 11 deletions src/main/java/seedu/elisa/model/JokeList.java
Original file line number Diff line number Diff line change
@@ -1,34 +1,33 @@
package seedu.elisa.model;

import java.io.File;
import java.io.FileNotFoundException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Random;
import java.util.Scanner;

/**
* List of jokes to pick and display
* */

public class JokeList {
private Path jokeFile = Paths.get("data", "jokes.txt");
private InputStream jokeFile = JokeList.class.getResourceAsStream("/documents/jokes.txt");
private ArrayList<String> jokes;
private Random rng;

public JokeList() {
jokes = new ArrayList<>();
rng = new Random();

File file = jokeFile.toFile();
BufferedReader r = new BufferedReader(new InputStreamReader(jokeFile));

try {
Scanner sc = new Scanner(file);
while (sc.hasNext()) {
jokes.add(sc.nextLine());
String l;
while ((l = r.readLine()) != null) {
jokes.add(l);
}
} catch (FileNotFoundException e) {
} catch (IOException e) {
e.printStackTrace();
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/elisa/model/UserPrefs.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
public class UserPrefs implements ReadOnlyUserPrefs {

private GuiSettings guiSettings = new GuiSettings();
private Path addressBookFilePath = Paths.get("data" , "addressbook.json");
private Path addressBookFilePath = Paths.get("data" , "itemstorage.json");

/**
* Creates a {@code UserPrefs} with default values.
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/seedu/elisa/ui/MainWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ public class MainWindow extends UiPart<Stage> {

private final Logger logger = LogsCenter.getLogger(getClass());
private final Image redElisa = new Image(getClass().getClassLoader()
.getResource("images/FocusElisa.png").toString());
.getResource("images/FocusElisa.PNG").toString());
private final Image blueElisa = new Image(getClass().getClassLoader()
.getResource("images/ElisaImageWithoutWords.png").toString());
.getResource("images/ElisaImageWithoutWords.PNG").toString());

private Stage primaryStage;
private Logic logic;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/elisa/ui/UiManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class UiManager implements Ui {
public static final String ALERT_DIALOG_PANE_FIELD_ID = "alertDialogPane";

private static final Logger logger = LogsCenter.getLogger(UiManager.class);
private static final String ICON_APPLICATION = "/images/ElisaIcon.png";
private static final String ICON_APPLICATION = "/images/ElisaIcon.PNG";

private Logic logic;
private MainWindow mainWindow;
Expand Down
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
4 changes: 2 additions & 2 deletions src/main/resources/view/MainWindow.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<fx:root minHeight="600.0" minWidth="314.0" onCloseRequest="#handleExit" title="ELISA" type="javafx.stage.Stage" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1">
<icons>
<Image url="@/images/ElisaImageWithoutWords.png" />
<Image url="@/images/ElisaImageWithoutWords.PNG" />
</icons>
<scene>
<Scene fx:id="scene">
Expand All @@ -35,7 +35,7 @@
<children>
<ImageView fx:id="elisaImage" fitHeight="80.0" fitWidth="90.0" layoutX="12.0" layoutY="9.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../images/ElisaImageWithoutWords.png" />
<Image url="@../images/ElisaImageWithoutWords.PNG" />
</image>
</ImageView>
<Text fx:id="elisaDescription" fill="#8de7fd" layoutX="80.0" layoutY="65.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Exceptionally Loud n' Intelligent">
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/seedu/elisa/commons/util/AppUtilTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class AppUtilTest {

@Test
public void getImage_exitingImage() {
assertNotNull(AppUtil.getImage("/images/address_book_32.png"));
assertNotNull(AppUtil.getImage("/images/address_book_32.PNG"));
}

@Test
Expand Down

0 comments on commit f0b008d

Please sign in to comment.