Project: Intelli

Intelli is a desktop relationship tracker used by private investigators (PI) to manage their information and leads. The PI interacts with it using a CLI, and it has a GUI created with JavaFX and GraphStream. It is written in Java, and has about 6 kLoC.

Code contributed: [Functional code] [Test code]

Enhancement Added: Enhanced find command

External behavior


Start of Extract [from: User Guide]

Locating persons: find

Finds persons whose details contain any of the given keywords.
Format: find KEYWORD [MORE_KEYWORDS]

  • The search is case insensitive. e.g hans will match Hans.

  • The order of the keywords does not matter. e.g. Hans Bo will match Bo Hans.

  • The search works even in the presence of whitespaces.

  • All details, including names, addresses, emails, phones and tags are searched.

  • Partial words will also be matched e.g. Han will match Hans.

  • Persons matching at least one keyword will be returned (i.e. OR search). e.g. Hans Bo will return Hans Gruber, Bo Yang.

  • If a prefix is specified, the scope of the search will be narrowed to a particular detail set (see sections below).

  • If more than one type of prefix is specified, the search will be treated as an invalid search.

Examples:

  • find John
    Returns john and John Doe.

  • find Jo
    Returns john and John Doe.

  • find Betsy Tim John
    Returns any person having names or email addresses containing Betsy, Tim, or John.

  • find 92334266
    Returns any person having phone number/email address/address containing 92334266.

  • find Alice 92334266
    Returns any person having name Alice AND/OR having phone number/email address/address containing 92334266.

Locating persons by name: find n/

Finds persons whose names contain any of the given keywords.
Format: find n/[KEYWORDS]

Examples:

  • find n/John
    Returns john and John Doe.

  • find n/Jo
    Returns john and John Doe.

  • find n/Betsy Tim John
    Returns any person having names Betsy, Tim, or John.

You can find multiple persons with a single name search.

Locating persons by address: find a/

Finds persons whose addresses contain any of the given keywords.
Format: find a/[KEYWORDS]

Examples:

  • find a/Serangoon
    Returns any persons having addresses in Serangoon.

  • find a/seRangOOn
    Returns any persons having addresses in Serangoon.

  • find a/Ser
    Returns any persons having addresses containing the phrase Ser.

  • find a/Serangoon Gardens
    Returns any person having addresses containing the phrase Serangoon AND/OR Gardens.

Locating persons by email: find e/

Finds persons whose emails contain any of the given keywords.
Format: find e/[KEYWORDS]

Examples:

  • find e/alice@example.com
    Returns Alice.

  • find e/AliCE@ExaMPle.com
    Returns Alice.

  • find e/@example.com
    Returns any persons having email addresses containing the suffix @example.com.

  • find e/@example.com @yahoo.com
    Returns any person having email addresses containing the suffix @example.com or @yahoo.com.

Locating persons by phone: find p/

Finds persons whose phone numbers contain any of the given keywords.
Format: find p/[KEYWORDS]

Examples:

  • find p/97734225
    Returns any persons having phone numbers matching 97734225.

  • find p/9773
    Returns any persons having phone numbers containing the sequence 9773.

  • find p/97734225 90329038
    Returns any persons having phone numbers matching 97734225 OR 90329038.

Locating persons by tag: find t/

Finds persons whose tags contain any of the given keywords.
Format: find t/[KEYWORDS]

Examples:

  • find t/friends
    Returns any persons having tags matching friends.

  • find t/FriEndS
    Returns any persons having tags matching friends.

  • find t/frIe
    Returns any persons having tags containing the phrase frie.

  • find t/friends family
    Returns any persons having tags matching friends AND/OR family.

End of Extract ---

Justification


This offers a lot of flexibility for users who wish to find different information, and does not limit them to a simple name search. ---

Implementation


Start of Extract [from: Developer Guide]

Enhanced find command

A basic find command is given in the original codebase which allows persons to be found using their names.

In order to enhance the find command, the find command is extended to support searches by name/email/phone number/address/tag. This is implemented in the style of the add command, and restricts the search to a particular aspect through parsing prefixes (/n, /p, /e, /a, /t). Without a prefix (i.e. find), the search is global, and returns any matches in any aspects (name/email/phone number/address/tag).

Design Considerations

Aspect: Implementation for enhanced find command
Alternative 1 (current choice): Adapt current FindCommand and add new predicates for each new type of search.
Pros: Easier to implement since we can reuse existing resources such as ArgumentTokenizer used in add command.
Cons: Implementation is less modular.
Alternative 2: Add a new subclass inheriting from FindCommand for each new type of search.
Pros: Implementation is more modular, and developers can update code more easily.
Cons: More tedious to implement since we cannot make use of existing resources such as ArgumentTokenizer used in add command.


Aspect: Type of command implemented
Alternative 1 (current choice): find command inherits from Command instead of UndoableCommand.
Pros: Easier to implement since we do not need to keep track of previous searches.
Cons: User has to retype all search fields if user wants to repeat a particular search.
Alternative 2: find command inherits from UndoableCommand.
Pros: find becomes undoable, and user can repeat a find easily by undoing the command.
Cons: It is unlikely that a user will repeat a find multiple times in a short period of time, rendering this option somewhat unnecessary.


Aspect: User input for narrowed search field in enhanced find command
Alternative 1 (current choice): Parse prefix in user input to narrow the search to a particular aspect (e.g. n/).
Pros: Easier for user for learn command since it is similar to the add command format.
Cons: Must remember exact prefix for each search field (i.e. /n, /p, /e, /a, /t).
Alternative 2: Parse full keywords in user input to narrow the search to a particular aspect (e.g. name/).
Pros: More intuitive for users as they can simply type what they want to look for.
Cons: User has to type longer commands.


Aspect: Scope of narrowed search
Alternative 1 (current choice): Users can only search within a single narrowed field, or must search through all possible fields (e.g. cannot search for names and emails only).
Pros: Easier to implement, parser only needs to check for a single prefix type and create corresponding predicate for the prefix type.
Cons: Fewer search choices available for users.
Alternative 2: Users can search within an arbitrary number of narrowed fields (e.g. can search for names and emails only, or search for names, emails, and addresses).
Pros: More search options available for users, more advanced search functions.
Cons: Harder to implement since the parser will have to handle more prefixes.

End of Extract ---

Editing a relationship between two persons: editRelationship

Edits a relationship between two persons in Intelli
Format: editRelationship INDEX_ONE INDEX_TWO [n/NAME] [ce/CONFIDENCE_ESTIMATE]

  • The indexes of the persons are based on the most recent listing shown.

  • The indexes provided does not have to be in a particular order since two persons can maximally have one relationship between them (e.g. editRelationship 1 2 is equivalent to editRelationship 2 1).

  • If only one attribute is updated (e.g. editRelationship 1 2 n/NAME), the other attribute will retain its original value in the pre-edited relationship.

  • NAME, which refers to the name of the relationship can only be alphanumeric.

  • CONFIDENCE_ESTIMATE refers to the confidence estimate the user gives to the relationship. CONFIDENCE_ESTIMATE can only be numbers from 0 to 100 inclusive.

  • The graph does not display confidence estimates that have the value 0.

Examples:

  • editRelationship 1 2

  • editRelationship 1 2 n/friends

  • editRelationship 1 2 ce/3.12082

  • editRelationship 1 2 n/friends ce/3.12082

End of Extract ---

Justification


This allows users to edit relationship attributes using a single operation. This is particularly useful since the target audience is private investigators who are likely to change and update relationship information frequently after they have gathered more intelligence. ---

Implementation


Start of Extract [from: Developer Guide]

editRelationship command

The editRelationship command edits a relationship between two persons in Intelli. Using this command, users can update the names and confidence estimates of relationships existing in Intelli without having to delete and add a new relationship.

Design Considerations

Aspect: Implementation for editRelationship command
Alternative 1 (current choice): The command is implemented internally as deleting an existing relationship and then adding a new relationship with the new name and the new confidence estimate.
Pros: Implementation does not have to access the internal state of a Relationship, and allows for immediate updates to the graph.
Cons: Additional step involved in having to delete and then add a new relationship between the same two persons.
Alternative 2: The command directly accesses and modifies the internal state of a Relationship.
Pros: The command can be completed in a single operation, which may be faster then deleting and adding a new relationship.
Cons: The change cannot be reflected dynamically on the graph after a successful edit.


Aspect: Type of command implemented
Alternative 1 (current choice): editRelationship command extends UndoableCommand instead of Command.
Pros: Users can easily undo their changes if they accidentally update the wrong relationship attribute or have mistakes in the updates (i.e. in the new relationship name/ confidence estimate).
Cons: Additional memory needed for recording the previous stage of the address book.
Alternative 2: editRelationship command extends Command.
Pros: No additional memory needed for recording the previous stage of the address book.
Cons: Users can do another editRelationship command to achieve the undo effect.

End of Extract ---

Enhancement Added: Command autocompletion

External behavior


Start of Extract [from: User Guide]

Autocompleting commands : Tab

Completes a command by filling the command box with the first suggestion shown in the result display.
Format: INPUT, then pressing Tab

CommandBoxPreAndPostAutocomplete
  • Only commands with the first few letters matching the current user input are considered as valid suggestions.

  • Excepting when the application is first started, not keying in any commands/ keying only blank spaces will cause all possible commands to be displayed.

  • By default, the first suggestion is the add command (e.g. keying in a blank space and then pressing Tab will cause add to appear in the command box).

Examples:

  • Type a followed by Tab

  • Type add followed by Tab

Clearing the command box : Control

Clears the command box instantaneously.
Format: Control

End of Extract ---

Justification


Certain commands are lengthy, and users who would like to enter commands quickly will find this a handy feature.

Additionally, users easily see what commands are supported by Intelli since all commands are displayed as valid suggestions if the user does not input any value in the command box.

Implementation


This has been implemented by coupling the command box and the result display. When there is a change to the user input in the command box, the suggestion displayed in the result display will change accordingly.

Enhancement Added: Command information display

External behavior


When the user types in the command box, and the input matches a command word, the corresponding usage information will be displayed in a side panel.

Justification


There are commands which require a number of parameters, and this can be a hassle for users to remember.

Implementation


This is done by adding a new display component to the main window, and binding changes to the command box to this new component.

Enhancement Added: Integrated graph display

External behavior


This ensures that the graph display is successfully integrated into the application instead of opening an additional window.

Justification


The application should be a coherent whole instead of splitting into two unsightly windows.

Implementation


This is done with the help of Java SwingNodes and JComponents. The graph is embedded in a SwingNode and intialised when the application starts up..

Enhancement Added: Enhanced graph display

External behavior


Improves the aesthetics of the integrated graph display.

Justification


This improves the user interface, making it more convenient for users to view their contacts and relationships on the graph.

Additionally, this adds to the aesthetic appeal of the application.

Other contributions

  • Tidy up the user guide