Skip to content

Commit

Permalink
Merge d84af66 into eb231a3
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronCQL committed Apr 13, 2020
2 parents eb231a3 + d84af66 commit 804d526
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 64 deletions.
66 changes: 4 additions & 62 deletions docs/diagrams/CommandAutocompleteSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
@startuml
!include style.puml

box UI UI_COLOR_T1
Participant ":CommandBox" as commandBox UI_COLOR
Participant ":TextField" as textField UI_COLOR
Participant ":ResultDisplay" as resultDisplay UI_COLOR
end box
box Logic LOGIC_COLOR_T1
Participant ":Autocomplete" as autoComplete LOGIC_COLOR
' Participant ":Trie" as trie LOGIC_COLOR
' Participant "node:Node" as node LOGIC_COLOR
' Participant "similarWordsResult:SimilarWordsResult" as similarWordsResult LOGIC_COLOR
Participant "acResult:AutocompleteResult" as autoCompleteResult LOGIC_COLOR
end box

-[UI_COLOR]> commandBox : handleTabKey()
activate commandBox UI_COLOR
Expand All @@ -34,65 +35,6 @@ note that the acResult object is
actually created within this ref
end note

' autoComplete -[LOGIC_COLOR]> trie : listAllSimilarWords("gra")
' activate trie LOGIC_COLOR

' trie -[LOGIC_COLOR]> trie : getLongestPrefixNode("gra")
' activate trie LOGIC_COLOR_T1
' trie -[LOGIC_COLOR]-> trie : node
' deactivate trie

' trie -[LOGIC_COLOR]> node : constructWord()
' activate node LOGIC_COLOR

' node -[LOGIC_COLOR]-> trie : "graph"
' deactivate node

' trie -[LOGIC_COLOR]> node : isWordEnd()
' activate node LOGIC_COLOR

' node -[LOGIC_COLOR]-> trie : true
' deactivate node

' create similarWordsResult
' trie -[LOGIC_COLOR]> similarWordsResult : SimilarWordsResult("graph", ["graph"])
' activate similarWordsResult LOGIC_COLOR

' similarWordsResult -[LOGIC_COLOR]-> trie : similarWordsResult
' deactivate similarWordsResult

' trie -[LOGIC_COLOR]-> autoComplete : similarWordsResult
' deactivate trie LOGIC_COLOR

' autoComplete -[LOGIC_COLOR]> similarWordsResult : hasOnlyOneWord()
' activate similarWordsResult LOGIC_COLOR

' similarWordsResult -[LOGIC_COLOR]-> autoComplete : true
' deactivate similarWordsResult

' autoComplete -[LOGIC_COLOR]> similarWordsResult : getSingleWord()
' activate similarWordsResult LOGIC_COLOR

' similarWordsResult -[LOGIC_COLOR]-> autoComplete : "graph"
' deactivate similarWordsResult

' autoComplete -[LOGIC_COLOR]> autoComplete : singleCommandHandler("graph")
' activate autoComplete LOGIC_COLOR_T1

' autoComplete -[LOGIC_COLOR]> autoComplete : generatePrefixesString(GraphCommand.PREFIXES)
' activate autoComplete LOGIC_COLOR_T1
' autoComplete -[LOGIC_COLOR]-> autoComplete : "graph n/ a/ sd/ ed/"
' deactivate autoComplete

' create autoCompleteResult
' autoComplete -[LOGIC_COLOR]> autoCompleteResult : AutocompleteResult("graph n/ a/ sd/ ed/", GraphCommand.MESSAGE_USAGE, 8)
' activate autoCompleteResult LOGIC_COLOR

' autoCompleteResult -[LOGIC_COLOR]-> autoComplete : autoCompleteResult
' deactivate autoCompleteResult
' autoComplete -[LOGIC_COLOR]-> autoComplete : autoCompleteResult
' deactivate autoComplete

autoComplete -[LOGIC_COLOR]-> commandBox : acResult
deactivate autoComplete

Expand Down
2 changes: 2 additions & 0 deletions docs/diagrams/CommandAutocompleteSequenceDiagramRef.puml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
@startuml
!include style.puml

box Logic LOGIC_COLOR_T1
Participant ":Autocomplete" as autoComplete LOGIC_COLOR
Participant ":Trie" as trie LOGIC_COLOR
Participant "node:Node" as node LOGIC_COLOR
Participant "swResult:SimilarWordsResult" as similarWordsResult LOGIC_COLOR
Participant "acResult:AutocompleteResult" as autoCompleteResult LOGIC_COLOR
end box

group get autocomplete result

Expand Down
12 changes: 10 additions & 2 deletions docs/diagrams/CommandHistorySequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
@startuml
!include style.puml

box UI UI_COLOR_T1
Participant ":CommandBox" as commandBox UI_COLOR
Participant ":TextField" as textField UI_COLOR
end box
box Logic LOGIC_COLOR_T1
Participant ":CommandHistory" as commandHistory LOGIC_COLOR
end box
box Model MODEL_COLOR_T1
Participant ":CommandHistoryState" as commandHistoryState MODEL_COLOR
end box
box Storage STORAGE_COLOR_T1
Participant "<<static>>\n:FileUtil" as fileUtil STORAGE_COLOR
end box

-[UI_COLOR]> commandBox : handleCommandEntered()
activate commandBox UI_COLOR
Expand All @@ -32,15 +40,15 @@ commandHistoryState -[MODEL_COLOR]-> commandHistory : List<String> history
deactivate commandHistoryState

commandHistory -[LOGIC_COLOR]> commandHistory : stateListToStorageString(history)
activate commandHistory LOGIC_COLOR_T1
activate commandHistory LOGIC_COLOR_T2
commandHistory -[LOGIC_COLOR]-> commandHistory : lines
deactivate commandHistory

commandHistory -[LOGIC_COLOR]> fileUtil : writeToFile(filePath, lines)
activate fileUtil STORAGE_COLOR

fileUtil -[STORAGE_COLOR]> fileUtil : Overwrites existing file
activate fileUtil STORAGE_COLOR_T1
activate fileUtil STORAGE_COLOR_T2
deactivate fileUtil

fileUtil -[STORAGE_COLOR]-> commandHistory
Expand Down
Binary file modified docs/images/CommandAutocompleteSequenceDiagram.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 modified docs/images/CommandAutocompleteSequenceDiagramRef.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 modified docs/images/CommandHistorySequenceDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 804d526

Please sign in to comment.