forked from nus-cs2103-AY1920S1/addressbook-level3
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
474 additions
and
217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
@startuml | ||
start | ||
:User executes `savepdf` command; | ||
|
||
:Checks if there is tasks | ||
assigned for the day; | ||
|
||
'Since the beta syntax does not support placing the condition outside the | ||
'diamond we place it as the true branch instead. | ||
|
||
if () then ([has tasks assigned for the day]) | ||
if () then ([file path does | ||
not exists]) | ||
:Create file path; | ||
else ([else]) | ||
endif | ||
:Generates a task summary | ||
in PDF format; | ||
:Save PDF document | ||
in the file path; | ||
else ([else]) | ||
:Notify user that no tasks | ||
are assigned for the day; | ||
stop | ||
endif | ||
|
||
stop | ||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
@startuml | ||
!include style.puml | ||
|
||
box Model MODEL_COLOR_T1 | ||
participant ":Model" as Model MODEL_COLOR | ||
participant ":PdfCreator" as PdfCreator MODEL_COLOR | ||
participant ":TaskManager" as TaskManager MODEL_COLOR | ||
participant ":PdfWrapperLayout" as PdfWrapperLayout MODEL_COLOR | ||
end box | ||
|
||
|
||
[-> Model : saveDriverTaskPdf( \n FILEPATH*, 5/11/2019) | ||
note right: FILEPATH*: "./data/DeliveryTasks 2019-11-5".pdf" | ||
activate Model | ||
|
||
create PdfCreator | ||
Model -> PdfCreator : new PdfCreator(FILEPATH*) | ||
activate PdfCreator | ||
|
||
PdfCreator --> Model | ||
deactivate PdfCreator | ||
|
||
Model -> TaskManager : getList() | ||
activate TaskManager | ||
|
||
TaskManager --> Model: tasks | ||
deactivate TaskManager | ||
|
||
Model -> TaskManager : getDriversFromTasks() | ||
activate TaskManager | ||
|
||
TaskManager --> Model: drivers | ||
deactivate TaskManager | ||
|
||
Model -> PdfCreator : saveDriverTaskPdf(tasks, drivers, 5/11/2019) | ||
activate PdfCreator | ||
|
||
PdfCreator -> PdfCreator ++: createDocument() | ||
PdfCreator --> PdfCreator --: document | ||
|
||
PdfCreator -> PdfCreator ++: insertCoverPage(document, 5/11/2019) | ||
PdfCreator --> PdfCreator -- | ||
|
||
PdfCreator -> PdfCreator ++: insertDriverTask(document, 5/11/2019) | ||
|
||
create PdfWrapperLayout | ||
PdfCreator -> PdfWrapperLayout : new PdfWrapperLayout(document) | ||
activate PdfWrapperLayout | ||
|
||
PdfWrapperLayout --> PdfCreator | ||
deactivate PdfWrapperLayout | ||
|
||
PdfCreator -> PdfWrapperLayout : populateDocumentWithTasks(tasks, 5/11/2019); | ||
activate PdfWrapperLayout | ||
|
||
PdfWrapperLayout --> PdfCreator | ||
deactivate PdfWrapperLayout | ||
|
||
PdfCreator --> PdfCreator -- | ||
|
||
PdfCreator --> Model | ||
deactivate PdfCreator | ||
|
||
[<-- Model | ||
deactivate Model | ||
|
||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
@startuml | ||
!include style.puml | ||
|
||
box Logic LOGIC_COLOR_T1 | ||
participant ":LogicManager" as LogicManager LOGIC_COLOR | ||
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR | ||
participant ":SavePdfCommandParser" as SavePdfCommandParser LOGIC_COLOR | ||
participant "p:SavePdfCommand" as SavePdfCommand LOGIC_COLOR | ||
participant ":CommandResult" as CommandResult LOGIC_COLOR | ||
end box | ||
|
||
box Model MODEL_COLOR_T1 | ||
participant ":Model" as Model MODEL_COLOR | ||
end box | ||
|
||
[-> LogicManager : execute(\n"savepdf 5/11/2019") | ||
activate LogicManager | ||
|
||
LogicManager -> AddressBookParser : parseCommand(\n"savepdf 5/11/2019") | ||
activate AddressBookParser | ||
|
||
create SavePdfCommandParser | ||
AddressBookParser -> SavePdfCommandParser : SavePdfCommandParser() | ||
activate SavePdfCommandParser | ||
|
||
SavePdfCommandParser --> AddressBookParser | ||
deactivate SavePdfCommandParser | ||
|
||
AddressBookParser -> SavePdfCommandParser : parse("savepdf 5/11/2019") | ||
activate SavePdfCommandParser | ||
|
||
create SavePdfCommand | ||
SavePdfCommandParser -> SavePdfCommand : SavePdfCommand(5/11/2019) | ||
activate SavePdfCommand | ||
|
||
SavePdfCommand --> SavePdfCommandParser : p | ||
deactivate SavePdfCommand | ||
|
||
SavePdfCommandParser --> AddressBookParser : p | ||
deactivate SavePdfCommandParser | ||
|
||
'Hidden arrow to position the destroy marker below the end of the activation bar. | ||
SavePdfCommandParser -[hidden]-> AddressBookParser | ||
destroy SavePdfCommandParser | ||
|
||
AddressBookParser --> LogicManager : p | ||
deactivate AddressBookParser | ||
|
||
LogicManager -> SavePdfCommand : execute() | ||
activate SavePdfCommand | ||
|
||
|
||
note right : FILEPATH*: "./data/DeliveryTasks 2019-11-05.pdf" | ||
SavePdfCommand -> Model : saveDriverTaskPdf(FILEPATH*, 5/11/2019) | ||
activate Model | ||
|
||
Model --> SavePdfCommand | ||
deactivate Model | ||
|
||
create CommandResult | ||
SavePdfCommand -> CommandResult | ||
activate CommandResult | ||
|
||
CommandResult --> SavePdfCommand | ||
deactivate CommandResult | ||
|
||
SavePdfCommand --> LogicManager : result | ||
deactivate SavePdfCommand | ||
|
||
[<--LogicManager | ||
deactivate LogicManager | ||
|
||
@enduml |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.