diff --git a/docs/diagrams/CommandHistorySequenceDiagram.puml b/docs/diagrams/CommandHistorySequenceDiagram.puml new file mode 100644 index 00000000000..9121dd777d9 --- /dev/null +++ b/docs/diagrams/CommandHistorySequenceDiagram.puml @@ -0,0 +1,49 @@ +@startuml +!include style.puml +skinparam ArrowFontStyle plain + +box UI UI_COLOR_T1 +participant ":CommandBox" as CommandBox UI_COLOR +participant ":CommandExecutor" as CommandExecutor UI_COLOR +end box + +box Logic LOGIC_COLOR_T1 +participant ":LogicManager" as LogicManager LOGIC_COLOR +participant ":CommandHistory" as CommandHistory LOGIC_COLOR +end box + +'box JavaFX JAVAFX_COLOR_T1 +participant ":TextField" as TextField JAVAFX_COLOR +'end box + +-> CommandBox : handleKeyPressed(event) +activate CommandBox + +CommandBox -> CommandExecutor : getPreviousCommandText() +activate CommandExecutor + +CommandExecutor -> LogicManager : getPreviousCommandText() +activate LogicManager + +LogicManager -> CommandHistory : getPrevious() +activate CommandHistory + +CommandHistory --> LogicManager : commandText +deactivate CommandHistory + +LogicManager --> CommandExecutor : commandText +deactivate LogicManager + +CommandExecutor --> CommandBox : commandText +deactivate CommandExecutor + +CommandBox -> TextField : setText(commandText) +activate TextField + +TextField --> CommandBox +deactivate TextField + +<-- CommandBox +deactivate CommandBox + +@enduml