Skip to content

Commit

Permalink
Merge branch 'master' into mo/update-documents
Browse files Browse the repository at this point in the history
  • Loading branch information
moziliar committed Nov 11, 2019
2 parents 3f05916 + 1401320 commit 2613b48
Show file tree
Hide file tree
Showing 41 changed files with 743 additions and 113 deletions.
4 changes: 2 additions & 2 deletions docs/AboutUs.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ Responsibilities: Meme Creation
'''

=== Bill Chee
image::livingonedge.jpg[width="150", align="left"]
{empty}[http://github.com/LivingOnEdge[github]] [<<LivingOnEdge#, portfolio>>]
image::livingonedge.png[width="150", align="left"]
{empty}[http://github.com/LivingOnEdge[github]] [<<livingonedge#, portfolio>>]

Role: Developer +
Responsibilities: Import/Export
Expand Down
27 changes: 27 additions & 0 deletions docs/DeveloperGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ By: `CS2103-T16-3`      Since: `September 2019`      Licence: `MIT`

Refer to the guide <<SettingUp#, here>>.

****
We recommend a minimum resolution of 1920x1080 with at maximum 150% scaling for best usage. Weme requires a resolution that provides at least 750 pixels in height and 1000 pixels in width for smooth usage.
****

== Design

[[Design-Architecture]]
Expand Down Expand Up @@ -482,6 +486,7 @@ extracted in runtime.

// end::stats2[]


// tag::export/import[]

=== Export/Import feature
Expand Down Expand Up @@ -713,6 +718,28 @@ image::TabSwitchSequenceDiagram.png[]

// end::tabs[]


// tag::view[]

=== [Miscellaneous] View feature

This feature allows the user to view a meme as an enlarged picture. This also allows
for long descriptions to be seen.

image::ViewClassDiagram.png[]

Using the above class diagram as a reference, VersionedWeme has a SimpleObjectProperty<Meme> attribute
(initially contains a null meme) which sets the Meme for the ViewPanel to view. The Meme is retrieved
as an ObservableValue<Meme> object in the model by MainWindow, which is
passed into the ViewPanel to set the meme to display.

The meme is viewed by using the ViewCommand in the memes context. The execution of the command firstly
sets the meme to view based on the given index which is picked up by the listener which sets
the meme details in the ViewPanel. Subsequently, the model context is set to the view context
which switches the MemeGridPanel to ViewPanel, hence displaying the meme.

// end::view[]

// tag::dataencryption[]
=== [Proposed] Data Encryption

Expand Down
24 changes: 20 additions & 4 deletions docs/UserGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ e.g. typing *`help`* and pressing kbd:[Enter] will open the help window.

. Refer to <<Features>> for details of each command.

****
We recommend a minimum resolution of 1920x1080 with at maximum 150% scaling for best usage. Weme requires a resolution that provides at least 750 pixels in height and 1000 pixels in width for smooth usage.
****

[[Features]]
== Features

Expand Down Expand Up @@ -239,6 +243,17 @@ Format: `archive INDEX`
Unarchives a meme at the specified index. +
Format: `unarchive INDEX`


==== Viewing a meme: `view`
Views the meme at the specified index. +
Format: `view INDEX`

****
* To exit the view, simply switch to another tab using the tab command.
For example, `tab memes` will bring the user back to the memes tab.
****


// tag::templates[]
=== Templates Tab
Templates are meme prototypes.
Expand Down Expand Up @@ -532,18 +547,18 @@ immediately without pressing kbd:[Enter] key. This does not account for invalid
no meme of index 5.

Example 1: +
When user types in "a" in the meme context, the following suggestions will appear: +
When user types in `a` in the meme context, the following suggestions will appear: +
`add: adds a meme to Weme. +
archive: archive a meme by index. +
archives: list all archived memes.` +
If kbd:[Tab] is pressed, "a" in the command box will be replaced by "add".
If kbd:[Tab] is pressed, `a` in the command box will be replaced by `add`.

Example 2: +
When user types in "add p/pathToMeme t/c", the following suggestions will appear: +
When user types in `add p/pathToMeme t/c`, the following suggestions will appear: +
`CS +
cute +
CS2103` +
If kbd:[Tab] is pressed, "c" in the command box will be replaced by "CS".
If kbd:[Tab] is pressed, `c` in the command box will be replaced by `CS`.

// end::command-suggestion[]

Expand Down Expand Up @@ -588,6 +603,7 @@ e.g. `add p//Users/Me/Downloads/dgirl_oof.jpg d/Disaster Girl t/Funny`
** *List Archived Memes* : `archives`
** *Archive Meme* : `archive INDEX`
** *Unarchive Meme* : `unarchive INDEX`
** *View Meme* : `view INDEX`

* *Commands for the Templates Tab* :
** *Add Template* : `add n/NAME p/PATH`
Expand Down
6 changes: 3 additions & 3 deletions docs/diagrams/ImportExportObjectDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ ExportCommand ..> stagedList
ImportCommand ..> importList
ImportCommand ..> filteredList

model *-- stagedList
model *-- importList
model *-- filteredList
model *--> stagedList
model *--> importList
model *--> filteredList

@enduml
49 changes: 49 additions & 0 deletions docs/diagrams/ViewClassDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
@startuml
!include style.puml
skinparam arrowThickness 1.1
skinparam arrowColor MODEL_COLOR
skinparam classBackgroundColor MODEL_COLOR

Package Model <<Rectangle>>{

Class ModelManager


ModelManager o--> VersionedWeme

Class ModelContext<<enumeration>>

ModelManager o--> "1" ModelContext : context

VersionedWeme --> "0..1" Meme : viewableMeme


}

Package Logic <<Rectangle>>{

Class LogicManager

LogicManager --> ModelManager

}

Package Main <<Rectangle>>{

Class MainWindow

}

Package Ui <<Rectangle>>{

MainWindow --> ViewPanel

MainWindow --> LogicManager

Class ViewPanel

ViewPanel ..> Meme : observableMeme

}

@enduml
Binary file modified docs/images/ImportExportObjectDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/ViewClassDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/images/livingonedge.jpg
Binary file not shown.
Binary file added docs/images/livingonedge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 18 additions & 16 deletions docs/team/livingonedge.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

== Summary of contributions

* *Major enhancement*: added *commands to stage, unstage, load, import and export memes*.
* *Major enhancement*: added *commands to stage, unstage, load, import and export memes* [https://github.com/AY1920S1-CS2103-T16-3/main/commit/ce54203d886a948e62906bbacb7bedc3c89a54db[#77]].
** What it does: Allows the user to import their own memes into the application. It also allows for user to export memes from the application
to their own personal folder.
** Justification: This feature provides a platform for the user to manage memes between the application
Expand All @@ -26,35 +26,34 @@ more commands need to be introduced to support the export and import tabs, which
For example, support commands such as edit, delete and clear commands have to be separately created for the import tab.

* *Minor enhancement*:
** Added a preferences tab for the user to view his or her user preferences of the application, which is configurable in preferences.json.
** Added Edit and Load commands for memes in the import tab.
** Added Clear commands for both export and import tab.
** Added a preferences tab for the user to view his or her user preferences of the application, which is configurable in preferences.json [https://github.com/AY1920S1-CS2103-T16-3/main/commit/9984517448d90e019e7d6d68fa16e59122319325[#105]].
** Added Edit and Load commands for memes in the import tab [https://github.com/AY1920S1-CS2103-T16-3/main/commit/5bcfa70c5681960bd0ba0e32f64afe79e2e23268[#128]].
** Added Clear commands for both export and import tab [https://github.com/AY1920S1-CS2103-T16-3/main/commit/5bcfa70c5681960bd0ba0e32f64afe79e2e23268[#128]].
** Added a View command for the memes tab [https://github.com/AY1920S1-CS2103-T16-3/main/commit/fb90681581c5d62ed16465348a859309ffa76fa3[#241]].

* *Code contributed*: [https://nus-cs2103-ay1920s1.github.io/tp-dashboard/#search=livingonedge&sort=groupTitle&sortWithin=title&since=2019-09-06&timeframe=commit&mergegroup=false&groupSelect=groupByRepos&breakdown=false[Functional code and Test code]]

* *Other contributions*:

** Project management:
*** Managed release `v1.3` (1 release) on GitHub
*** Contributed to initial morphing from AddressBook to Weme (Change Address field to Description): (Pull Request https://github.com/AY1920S1-CS2103-T16-3/main/commit/299753ded0eb95c47b56af3e773d2323cbb50a71[#36])
*** Contributed to initial morphing from AddressBook to Weme (Change Address field to Description): (Pull Request [https://github.com/AY1920S1-CS2103-T16-3/main/commit/299753ded0eb95c47b56af3e773d2323cbb50a71[#36]])
** Enhancements to existing features:
*** Added preferences tab (Pull request https://github.com/AY1920S1-CS2103-T16-3/main/commit/9984517448d90e019e7d6d68fa16e59122319325[#105])
*** Added preferences tab (Pull request [https://github.com/AY1920S1-CS2103-T16-3/main/commit/9984517448d90e019e7d6d68fa16e59122319325[#105]])
** Documentation:
*** Updated User Stories for Developer Guide https://github.com/AY1920S1-CS2103-T16-3/main/commit/791f7149f336ac4e4c13ecabe6a334b4de00230a[#31]
*** Major update to User Guide for v1.3 release: https://github.com/AY1920S1-CS2103-T16-3/main/commit/f0773ea9194ee7fa731bc3ce708e234c4642df78[#153]
*** Updated User Stories for Developer Guide [https://github.com/AY1920S1-CS2103-T16-3/main/commit/791f7149f336ac4e4c13ecabe6a334b4de00230a[#31]].
*** Major update to User Guide for v1.3 release: [https://github.com/AY1920S1-CS2103-T16-3/main/commit/f0773ea9194ee7fa731bc3ce708e234c4642df78[#153]].
** Tools:
*** Added support for TestFX [https://github.com/AY1920S1-CS2103-T16-3/main/pull/234[#234]]
*** Added support for TestFX [https://github.com/AY1920S1-CS2103-T16-3/main/pull/234[#234]].
** Community:
*** PRs reviewed (trivial): https://github.com/AY1920S1-CS2103-T16-3/main/pull/68[#68],
*** PRs reviewed (trivial): [https://github.com/AY1920S1-CS2103-T16-3/main/pull/68[#68],
https://github.com/AY1920S1-CS2103-T16-3/main/pull/49[#49],
https://github.com/AY1920S1-CS2103-T16-3/main/pull/38[#38],
https://github.com/AY1920S1-CS2103-T16-3/main/pull/159[#159]
https://github.com/AY1920S1-CS2103-T16-3/main/pull/159[#159]].
*** PRs reviewed (non-trivial):
https://github.com/AY1920S1-CS2103-T16-3/main/pull/71[#71],
https://github.com/AY1920S1-CS2103-T16-3/main/pull/76[#76]
*** Reported bugs and suggestions for other teams in the class (examples: https://github.com/LivingOnEdge/ped[1])

_{you can add/remove categories in the list above}_
[https://github.com/AY1920S1-CS2103-T16-3/main/pull/71[#71],
https://github.com/AY1920S1-CS2103-T16-3/main/pull/76[#76]].
*** Reported bugs and suggestions for other teams in the class (examples: [https://github.com/LivingOnEdge/ped[1]]).

== Contributions to the User Guide

Expand All @@ -72,3 +71,6 @@ include::../UserGuide.adoc[tag=export/import]

include::../DeveloperGuide.adoc[tag=export/import]

include::../DeveloperGuide.adoc[tag=view]


4 changes: 2 additions & 2 deletions src/main/java/seedu/weme/commons/core/GuiSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
*/
public class GuiSettings implements Serializable {

private static final double DEFAULT_HEIGHT = 600;
private static final double DEFAULT_WIDTH = 740;
private static final double DEFAULT_HEIGHT = 680;
private static final double DEFAULT_WIDTH = 1000;

private final double windowWidth;
private final double windowHeight;
Expand Down
13 changes: 7 additions & 6 deletions src/main/java/seedu/weme/commons/util/FileUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.InvalidPathException;
import java.nio.file.LinkOption;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
Expand Down Expand Up @@ -90,7 +91,7 @@ private static void recursiveLoad(List<Path> imageList, DirectoryPath directoryP
if (fileEntry.isDirectory()) {
recursiveLoad(imageList, new DirectoryPath(fileEntry.getPath())); // recursive call
} else if (isFileExists(fileEntry.toPath())
&& isValidImageExtension(fileEntry.toPath())) {
&& isValidImageFile(fileEntry.toPath())) {
imageList.add(Paths.get(fileEntry.getPath()));
}
}
Expand All @@ -105,7 +106,7 @@ && isValidImageExtension(fileEntry.toPath())) {
* @param initialPath The initial path of the file.
* @return
*/
private static String buildFilePath(Path newDirectoryPath, String fileLabel, Path initialPath) {
public static String buildFilePath(Path newDirectoryPath, String fileLabel, Path initialPath) {
StringBuilder newFilePath = new StringBuilder();
newFilePath
.append(newDirectoryPath)
Expand All @@ -121,7 +122,7 @@ private static int incrementFileLabel(int fileLabel) {
}

/**
* Returns true if {@code path} can be converted into a {@code Path} via {@link Paths#get(String)},
* Returns true if {@code path} can be converted into a {@code Path} via {@link Paths#get(String, String...)}},
* otherwise returns false.
* @param path A string representing the file path. Cannot be null.
*/
Expand All @@ -135,8 +136,8 @@ public static boolean isValidPath(String path) {
}

/**
* Returns true if {@code path} can be converted into a {@code Path} via {@link Paths#get(String)}
* and {@link Files#exists(Path)}, otherwise returns false.
* Returns true if {@code path} can be converted into a {@code Path} via {@link Paths#get(String, String...)}
* and {@link Files#exists(Path, LinkOption...)}, otherwise returns false.
* @param path A string representing the file path. Cannot be null.
*/
public static boolean isValidDirectoryPath(String path) {
Expand Down Expand Up @@ -257,7 +258,7 @@ public static File toFile(DirectoryPath directoryPath) {
* @return True if the file is a valid image file path.
* @throws IOException Unexpected error encountered from probeContentType().
*/
public static boolean isValidImageExtension(Path filePath) throws IOException {
public static boolean isValidImageFile(Path filePath) throws IOException {
return !(new Image(filePath.toUri().toURL().toString()).isError());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static seedu.weme.logic.parser.contextparser.WemeParser.ARGUMENTS;
import static seedu.weme.logic.parser.contextparser.WemeParser.BASIC_COMMAND_FORMAT;
import static seedu.weme.logic.parser.contextparser.WemeParser.COMMAND_WORD;
import static seedu.weme.logic.prompter.util.PrompterUtil.COMMAND_DELIMITER;
import static seedu.weme.logic.prompter.util.PrompterUtil.CREATE_COMMANDS;
import static seedu.weme.logic.prompter.util.PrompterUtil.CREATE_COMMANDS_DESCRIPTION_MAP;
import static seedu.weme.logic.prompter.util.PrompterUtil.GENERAL_COMMANDS;
Expand Down Expand Up @@ -40,7 +41,7 @@ public CommandPrompt promptCommand(Model model, String userInput) throws PromptE
.map(command -> CREATE_COMMANDS_DESCRIPTION_MAP.get(command))
.reduce((x, y) -> x + '\n' + y)
.orElse(""),
CREATE_COMMANDS.stream().sorted().findFirst().orElse(""));
CREATE_COMMANDS.stream().sorted().findFirst().orElse("") + COMMAND_DELIMITER);
}

final String commandWord = matcher.group(COMMAND_WORD);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static seedu.weme.logic.parser.contextparser.WemeParser.ARGUMENTS;
import static seedu.weme.logic.parser.contextparser.WemeParser.BASIC_COMMAND_FORMAT;
import static seedu.weme.logic.parser.contextparser.WemeParser.COMMAND_WORD;
import static seedu.weme.logic.prompter.util.PrompterUtil.COMMAND_DELIMITER;
import static seedu.weme.logic.prompter.util.PrompterUtil.EXPORT_COMMANDS;
import static seedu.weme.logic.prompter.util.PrompterUtil.EXPORT_COMMANDS_DESCRIPTION_MAP;
import static seedu.weme.logic.prompter.util.PrompterUtil.GENERAL_COMMANDS;
Expand Down Expand Up @@ -35,7 +36,7 @@ public CommandPrompt promptCommand(Model model, String userInput) throws PromptE
.map(command -> EXPORT_COMMANDS_DESCRIPTION_MAP.get(command))
.reduce((x, y) -> x + '\n' + y)
.orElse(""),
EXPORT_COMMANDS.stream().sorted().findFirst().orElse(""));
EXPORT_COMMANDS.stream().sorted().findFirst().orElse("") + COMMAND_DELIMITER);
}

final String commandWord = matcher.group(COMMAND_WORD);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static seedu.weme.logic.parser.contextparser.WemeParser.ARGUMENTS;
import static seedu.weme.logic.parser.contextparser.WemeParser.BASIC_COMMAND_FORMAT;
import static seedu.weme.logic.parser.contextparser.WemeParser.COMMAND_WORD;
import static seedu.weme.logic.prompter.util.PrompterUtil.COMMAND_DELIMITER;
import static seedu.weme.logic.prompter.util.PrompterUtil.GENERAL_COMMANDS;
import static seedu.weme.logic.prompter.util.PrompterUtil.IMPORT_COMMANDS;
import static seedu.weme.logic.prompter.util.PrompterUtil.IMPORT_COMMANDS_DESCRIPTION_MAP;
Expand Down Expand Up @@ -38,7 +39,7 @@ public CommandPrompt promptCommand(Model model, String userInput) throws PromptE
.map(command -> IMPORT_COMMANDS_DESCRIPTION_MAP.get(command))
.reduce((x, y) -> x + '\n' + y)
.orElse(""),
IMPORT_COMMANDS.stream().sorted().findFirst().orElse(""));
IMPORT_COMMANDS.stream().sorted().findFirst().orElse("") + COMMAND_DELIMITER);
}

final String commandWord = matcher.group(COMMAND_WORD);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static seedu.weme.logic.parser.contextparser.WemeParser.ARGUMENTS;
import static seedu.weme.logic.parser.contextparser.WemeParser.BASIC_COMMAND_FORMAT;
import static seedu.weme.logic.parser.contextparser.WemeParser.COMMAND_WORD;
import static seedu.weme.logic.prompter.util.PrompterUtil.COMMAND_DELIMITER;
import static seedu.weme.logic.prompter.util.PrompterUtil.GENERAL_COMMANDS;
import static seedu.weme.logic.prompter.util.PrompterUtil.MEME_COMMANDS;
import static seedu.weme.logic.prompter.util.PrompterUtil.MEME_COMMANDS_DESCRIPTION_MAP;
Expand Down Expand Up @@ -53,7 +54,7 @@ public CommandPrompt promptCommand(Model model, String userInput) throws PromptE
.map(command -> MEME_COMMANDS_DESCRIPTION_MAP.get(command))
.reduce((x, y) -> x + '\n' + y)
.orElse(""),
MEME_COMMANDS.stream().sorted().findFirst().orElse(""));
MEME_COMMANDS.stream().sorted().findFirst().orElse("") + COMMAND_DELIMITER);
}

final String commandWord = matcher.group(COMMAND_WORD);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static seedu.weme.logic.parser.contextparser.WemeParser.ARGUMENTS;
import static seedu.weme.logic.parser.contextparser.WemeParser.BASIC_COMMAND_FORMAT;
import static seedu.weme.logic.parser.contextparser.WemeParser.COMMAND_WORD;
import static seedu.weme.logic.prompter.util.PrompterUtil.COMMAND_DELIMITER;
import static seedu.weme.logic.prompter.util.PrompterUtil.GENERAL_COMMANDS;
import static seedu.weme.logic.prompter.util.PrompterUtil.PREFERENCES_COMMANDS;
import static seedu.weme.logic.prompter.util.PrompterUtil.PREFERENCES_COMMANDS_DESCRIPTION_MAP;
Expand All @@ -30,7 +31,8 @@ public CommandPrompt promptCommand(Model model, String userInput) throws PromptE
.map(command -> PREFERENCES_COMMANDS_DESCRIPTION_MAP.get(command))
.reduce((x, y) -> x + '\n' + y)
.orElse(""),
PREFERENCES_COMMANDS.stream().sorted().findFirst().orElse(""));
PREFERENCES_COMMANDS.stream().sorted().findFirst().orElse("")
+ COMMAND_DELIMITER);
}

final String commandWord = matcher.group(COMMAND_WORD);
Expand Down
Loading

0 comments on commit 2613b48

Please sign in to comment.