Home

CS2101 CS2103 [w15

image

Contents

1. 4 4 1 Mira peeve ii 5 A 5 w15 2j VO 5 4 4 2 Seana PARETA ccscavecsstacvapecausvscpiinca ts ceshavsepsiniety Mayadhepsanchdy lacaveee 20 4 4 3 LOBICTOU be Eat leds cd RRRA 21 4 4 4 NattyParserWrapper iii iaa atril 21 A A 22 6 Known Ilse vicodin ied Aen diene 22 6 1 Command line issues cio aia A aa doves 22 6 2 GUUISSUGS 22 E aes SRA ET ie a iia eS ies BE A a T i AS 23 6 3 Keyboard SHO CUES di A ves AA A AAA 23 TE FURUFO Work ciie iinei anaia AA AAA Ati 23 7 1 Google Calendar and Tasks integratiON coococccccncncconononnnnnnnonnnnnnnnnnononnnnnnnnnnnnnnnnnncnnanannnnnanoss 23 7 2 Password protected database ccononococccnnonononononnnnnnnonnnnnnnnnnnnnnnnnnonannononnnnnnnnnnnnornnnnnncninanones 23 7 3 Internationialisation iii ctas ia ed 23 8 Appendiks ponie inae a Pepe ee 24 8 1 E E E A E E ese tends oes etd ee eee 24 8 2 Code example for Undo SUPPO E iconoclasta a aiea pART 24 w15 2j VO 5 Dolt User Manual Welcome to Dolt Dolt is an easy to use task organization program Just type in what you have on your mind and Dolt will put it on your schedule making it easy for you to manage your life 1 System Requirements Dolt requires the following e Windows XP or later e Java runtime environment 7 Download it from http www java com download 2 Running Dolt No installation is required Just double click on the downloaded program s icon to launch the program Dolt also supports a complet
2. lt b gt d lt b gt all Deletes lt b gt EACH AND EVERY lt b gt task in your schedule gt lt usage gt lt command gt lt command gt lt name gt lt CDATA lt h1 gt Postpone lt h1 gt gt lt name gt lt summary gt Postpones a task lt summary gt lt usage gt lt CDATA lt b gt postpone lt b gt index time parameter gt lt usage gt lt usage gt lt CDATA lt b gt postpone lt b gt 1 3 hours postpones task at index 1 by 3 hours gt lt usage gt lt extra gt This command has no effect on floating tasks Start and End times for timed tasks will shift together lt extra gt lt command gt lt hint gt 8 2 Code example for Undo Support protected void updateDatabaseNSendToUndoStack throws NoSuchElementException IOException WillNotWriteToCorruptFileException List lt Task gt copyCurrentTaskList super getCurrentTaskList dataBase update toBeDoneSerial copy String taskDetails taskToString copy String undoMessage marking of task taskDetails as done super pushUndoStatMesNTaskList undoMessage copyCurrentTaskList 24
3. new value To get index see the note under viewing tasks edit 1 name fix cupboard edit 2 start 1800 on 10 Sep You can combine multiple things to edit in the same command Also note that shortcuts e g s can be used edit 3 name fix shoe rack s 1800 10 Sept If no date is specified the previous date will be kept This also applies to the time edit 5 e 2100 Postponing tasks postpone index by duration Postpones the task specified by index by duration ending time and date is shifted accordingly so that the task duration remains the same postpone 1 by 1 hour w15 2j VO 5 Marking tasks as done undone done index Marks the task specified by index as done 1 done To get index see the note under viewing tasks undone index Marks the task specified by index as undone 1 not yet done Undo changes undo Undo the last change you have made undo Getting command help help Show a list of all possible commands help help command List the possible usage for command help add w15 2j VO 5 Dolt Developer Guide 1 Introduction Welcome to the developer guide for Dolt In case you do not know yet Dolt is a simple and easy to use task list management software Dolt is distinct from other task management software as it allows complete control via the keyboard This document aims to help developers like you to understand Dolt s desi
4. 4 2 3 Command Handlers Command handlers act on a particular command they are designed to handle Every command handler must extend the CommandHandler abstract class which specifies that the handler must implement an execute method Note that each command handler is expected to repeat the same action if the execute method of a handler object is called again Its constructor must also accept a String parameter which is the arguments given for that command The instantiation of its associated parser should also be done in the constructor See the CommandParser section for more details Only Command Handlers will have the view over Database object This view has been obtained referenced via this variable protected static Database dataBase Input Output Requirements The return type of the execute command is a LogicToUi object All exceptions are expected to be caught by the handlers An appropriate return message must be generated after by every handler and stored to the LogicToUi object A possible list of return messages are stored as protected constants in the CommandHandler Refer to the LogicToUi section for more details Supporting undo operations Support for the undo operation is only required for handlers which modify the database like add and delete Commands like list and search should not be added to the undo history In order to provide the undo functionality the CommandHandler will maintain a stack implemented as a Link
5. HTML encoding and return a normal help string if it is called through getNoHTMLHelp Refer to appendix for example snippets of the format 1 http www jroller com santhosh date 20050620Hfile path autocompletion 12 w15 2j VO 5 4 2 Logic This is where the commands from the user interface are processed and the relevant action taken ES Logic Attributes database Database CommandHandler Operations Logic Handler z uiCommunicator String LogicToUi Attributes determineCommandType String CommandType 1 Operations parseCommand String CommandType execute String LogicToUi getCurrentTaskList List lt Task gt pushUndoStatusMessageAndTaskList undoMessage Stri A AddHandler UpdateHandler DeleteHandler This diagram shows only a subset of the ListHandler Attributes Attributes Attributes Attributes handlers there is one for each command Operations Operations Operations Operations AddParser 2 UpdateParser DeleteParser ListParser Attributes Attributes Attributes Attributes Operations Operations Operations Operations CommandParser ka LogicToUi Attributes Attributes display List lt Tasks gt output String Operations parse String Operations LogicToUi List lt Task gt String Figure 4 Class diagram for Logic Component 4 2 1 Important APIs The most
6. method at the earliest opportunity to verify read and write permissions Task locateATask int serial Locates an existing task in the database that has serial 18 w15 2 VO 5 readAl1 java util List lt Task gt Returns a List lt Task gt of all the tasks in the database search shared SearchTerms terms java util List lt Task gt Returns a List lt Task gt of all the tasks that match the search term update int originalSerial Task updated oid nae E vos Updates an existing task in the database File Permissions A private method verifyFilewritingAbility exists to help check that the database has write permissions for the database file It will throw the exceptions listed below Every public facing method that involves a change to the database content must call this method at the earliest opportunity before proceeding with its job This is to ensure that the database operation can be performed successfully Exceptions Any methods above that involve a change in the database may throw the following exceptions 1 java io IOException is thrown if the Database class is unable to write to the file due to some permission issues 2 storage WillNotWriteToCorruptFileException is thrown if the file can be accessed but is corrupt As the name implies the Database class will not write to the file to prevent corrupting the text file further 3 java util NoSuchElementException is thrown
7. respective variables protected static CommandHandler latestRefreshHandlerForuI protected static CommandHandler latestSortHandlerForUI All viewing filter commands are required to store a reference of themselves into one of these variables should they require the GUI to maintain that view after a refresh The refresh command will execute the latest sort handler which will in turn execute the latest list search handler This is to ensure a seamless viewing experience as the sorting will be kept across different view commands During program launch these variables will be initialised with default list and sort handlers The former will list all tasks and the latter will sort the tasks by start dates deadline with floating tasks at the back 4 2 4 Command Parsers Command Parsers exist to aid command Handlers in processing each command They parse the arguments provided by the user Since each command is unique you have considerable leeway in the implementation but the following are the basic guidelines 1 All parsers must extend the CommandParser abstract class and implement the parse method Similar to the CommandHandler its constructor must accept a String parameter which is the argument for that command 2 The parser must not modify the database in any way For example if a task is to be added to the database the parser should only generate the required fields of the task and not add the task itself to the database 3 For argume
8. update this with any new package test suites Updates to test cases You should update the test cases whenever a bug has been detected and fixed Simply add your test case to the relevant test classes Exceptional Cases 1 Classes in the Logic package are tested differently To avoid duplicate testing of the handlers parsers and the Logic class itself the test command should be sent directly to the Logic uiCommunicator method and the result retrieved from the LogicToUI object 2 FileManagementTest is excluded from the suites and has to be run independently This is due to the corruption test which will render the file unusable during the duration of the test run The text file database on disk may be irreversibly modified during the automated testing y Possible Loss of Database data during and after tests procedure You should do a backup of the text file before the commencement of any test if you want to keep the contents of the database 6 Known Issues 6 1 Command line issues If the user has gt 1000 tasks the CLI index column will shift A 3 digit limit for the index number is hardcoded on the assumption that few users have 1000 tasks and to balance against the limited console width CliWithJline requires at least a terminal width of 67 characters Display behaviour on consoles smaller than this minimum is not defined 22 w15 2j VO 5 6 2 GUI issues Agenda view can be quite s
9. w15 2j VO 5 Dolt Manual By 12 21pm 1 Tasks with no date are placed here Welcome to Dolt Type help in the box below to see a list of possible commands 2 Finished this Tick this box gt gt gt By 12 22pm Use the delete all command to remove all 3 This task is finished these and start using Dolt 4 Double click on me to edit me By 3 00pm 3 Send letter by 3pm tomorrow z 5 You can use the calendar below to jump to a selected date 5 00pm to 8 00pm 4 Dinner with James from 6pm to 8pm tomorrow O By this day 5 You have to finish this report by tomorrow 2 Starts at 10 00am 6 Overseas trip 2 days later from 10am in Day 1 to OU 11pm in Day 3 All day 6 Overseas trip 2 days later from 10am in Day 1 to i O 11pm in Day 3 i LA Nguyen Hien Linh Yeo Kheng Meng Yeow Kai Yao Team lead Deadline watcher GUI design architect testing lead programmer documentation w15 2j VO 5 Credits Dolt would not be possible without the following software libraries e Joda Time date and time handler http joda time sourceforge net e Natty natural language date parser http natty joestelmach com e Jintellitype for global binding of keyboard shortcuts https code google com p jintellit e JLine console library https github com jline jline2 The Dolt development team would also like to acknowledge the us
10. Operations GuiTrayIcon I GuiPreferences GuiHelp Attributes Attributes Operations Operations Attributes Operations Figure 3 Class diagram for UI Component 4 1 2 Important Methods of the UI Abstract Class runuI This method is the starting point of every Ul it is called when the Ul is to be run abstract void sendCommandToLogic String command LogicToUi Passes command to logic to be processed Returns a LogicToUi object comprising a String message or a String and a List lt Task gt depending on command 11 w15 2j VO 5 checkFilePermissions Sends a filestatus command to logic to check for the database file String permissions Returns a string containing the status of the file It is important for the UI class to call this method before beginning any user interaction so that the user will be warned of a read only or file lock situation getHTMLHelp String command getNoHTMLHelp String command String To get command specific help for display to the user See Hint Class for more details 4 13 GuiCommandBox This class implements a basic command box in a GUI with pop up hints and command history Pop up boxes are implemented using a JEditorPane in a JPopupMenu a technique used in 4 1 4 GuiMain The GuiMain subclass holds the code for the main window of Dolt s graphical user interface 4 1 5 GuiQuick Subclass i I wi
11. String String taskName Copy Current State of Database A getCurrentTaskList List lt Task gt Exception if error encountered Push Undo Message and Task List to Undo Stack Add Created Task to Database add t Task i pushUndoStatusMessageAndTaskList undoMessage String currentTaskList List lt Task gt Create Return Object LogicToUi List lt Task gt Figure 5 Sequence Diagram showing the process of adding a task 17 4 3 Storage w15 2j VO 5 The storage component handles the writing and reading of tasks to the text file storage component on the disk This component is implemented with two classes Database and FileManagement deleteAll getAll List lt Task gt getFileAttributes Database getInstance Database locateATask serial Integer search terms SearchTerms setAll tasks List lt Task gt Database ES Shared Task Attributes i z Attributes Operations add t Task Database Task Operations delete serial Integer becomeThis t Task delete serial List lt Integer gt 1 changeDeadline DateTime changeStartAndEndDate DateTime DateTime changeToDeadline DateTime changeToFloating clashes WithRange DateTime DateTime Boolean contains Term String Boolean A A unlockFileToExit update originalSerial Integer 4 3 1 Da
12. VALID_DATE_FIELD DateTime object will be returned int getSerial Gets the serial number of the task for the purposes of deletion and updating String getTaskName getType Task TaskType Returns the type of task boolean tsbones Returns true if the task has been marked as done isFloatingTask isDeadlineTask isTimedTask boolean s Returns true if the task is of the type requested clashesWithRange DateTime startRange DateTime endRange boolean Returns true if the time of the task overlaps the date range provided Floating tasks will always return false to this containsTerm String term boolean j mF Returns true if the task contains the term provided Case insensitive isEqualTo Task toCompare boolean Returns true if the given task toCompare has exactly the same attributes as the current Task The serial number is also compared showInfo String Returns the entire contents of the Task object as a String For debugging and testing purposes only becomeThis Task updated void Copies all the attributes including the serial number from the updated Task object to this Task object compareTo Task t Compares the current task with another task Ordering is by start time for timed tasks and by deadline for deadline tasks Floating tasks are always considered bigger than timed or int deadline tasks If the tasks have the same start time they are ordered lexicographically by the task name Re
13. ask gt List lt Task gt List lt Task gt Po nee ee ee Show list of tasks Figure 2 Sequence diagram for adding a new task and viewing tasks 10 w15 2j VO 5 4 Components Now that you have seen an overview of the various components in Dolt as well as how they interact you are probably interested in some more details of a component or two You can get more details about your component of interest in this section 4 1 Ul This is the place to look for if you want to modify the user interface or develop an alternative user interface 4 1 1 Classes The Ul in Dolt is designed as a UI abstract class from which actual concrete user interfaces can be extended from It is thus easy to add an alternative user interface Several classes inherit from UI including GuiCommandBox that implements a GUI command box with hints and command history support as well as Cli that implements a terminal interface to Dolt Attributes Operations runUl checkFilePermissions String currentTimeInLongerForm String dateTimeToLongerString DateTime String dateTimeToString DateTime String sendCommandToLogic String LogicToUi iam gt gt GuiCommandBox cli Attributes Attributes Operations Operations l GuiMain GuiQuickAdd 2 CliWithJline Attributes Attributes Attributes Operations Operations
14. e command line based interface Run Dolt with the cli argument to do so 3 Using Dolt 3 1 Dolt Main Y Dolt 63 Home 2 Undo z nda View Li 2 Preferences 4 Help By5 19pm 1 Tasks with no date are placed here Welcome to Dolt Type help in the box below a toso t oh possible Comneno 2 Finished this Tick this box gt gt gt By 5 20pm Use the delete all command to remove all a 3 This task is finished these and start using Dolt 4 Double click on me to edit me By 3 00pm Your deadline E a Send letter by 3pm tomorow 5 You can use the calendar below to and timed 5 00pm to 8 00pm jump to a selected date Your floating tasks are Dinner with James from 6pm to 8pm tomorrow tasks are shownihere By this day Pay Phone Bill of 30 51 shown here You have to finish this report by tomorrow Read Harry Potter hook Starts at 10 00am lt December 2012 13 Overseas trip 2 days later from 10am in Day 1 to a M w T 11pm in Day 3 26 2 2 a3 3 6 The status of E Aday 10 R 83 the last 14 Overseas trip 2 days later from 10am in Day 1 to a 17 19 20 7 nov212 11pm in Day 3 24 2 2 command is 3 shown here 1 00pm to 2 00pm J 31 2 covered by add the hint in this Add picture Adds a task to database Usage Examples Type your commands here Refer to the command reference add read a book section to know about the commands you can type add school camp from 3pm today to Spm t
15. e of the following e Nuvola icons http www icon king com projects nuvola for Dolt s icon e FamFamFam Silk icons http www famfamfam com lab icons silk for icons in Dolt s toolbar w15 2j VO 5 Contents Credits User Manual 1 System Requirements ccccoccccnonononononononononononononononononns 2 Running Dolls 3 Using Doll nuncio 3 1 Dolt Malicia 3 2 QUICK Add icons 3 3 Command line Interface ooonnnccninccononcnnncnnnancnnnns 4 Supported Task TYpes ccccccccccccessssssssseceecessesssssaeees 5 Command ReferenCe cccnnccnnocicnnoccnonccononnnononcnnnncnnanenonns Developer Guide T A i aa 2 A aeaa kiaiii iiia 3 Understanding the Command FlOW ccconncccccccnncnnnn 4 COMPONENES rskr aaae 4 1 Ulsa tada T 4 1 1 ClASSOS iia dada 4 1 2 Important Methods of the Ul Abstract Class 4 1 3 GUICOMMANABOX ccccococcconcncnoncnononcnnananinnaninnnos 4 1 4 GUIM Msi 4 1 5 GuiQuick SUDCIASS sssr 4 1 6 Cli Supla SSe kiirenes denr aeiia 4 1 7 CliWithJline Subclass 4 1 8 Hint Cla S Siini 4 2 e E EEE ERE 4 2 1 Important APIS ooooooocococccnnnnnnnnnnnnnnnnnnnnnononnns 4 2 2 LastShownToUli ccccocccononiconcccnoncnononcnnnacnnnnnnonns 4 2 3 Command Handlers 4 2 4 Command Parsels sses 4 2 5 Sequence Diagram ccccncccncncncnnncncneneneneneninenos 4 3 Ocio dis 4 3 1 Database ClaSS oooccocccinoniconcccnonnnononnnnnacnnnnnnnnns 4 4 Shared COMPONENMS cccccccccessessssececeeecessessaeees
16. edList of database clones and their associated undo messages They are only accessible through the protected methods in the CommandHandler How to support undo in the handler To ensure the consistent saving of every undo step follow the following steps Place the following statements into a method named updateDatabaseNSendToUndoStack refer to Appendix for a sample Then call this method just before LogicToUi is returned 14 w15 2 VO 5 1 At the top of the method place the following line to create a copy of the current database state before your modifications List lt task gt currentTaskList super getCurrentTaskList 2 Perform the necessary modification operations on the database At the bottom of the method place the line below The undoMessage is the message shown to the user when your command is undone and will be displayed in this manner The undoMes sage has been undone so phrase your message accordingly super pushUndoStatusMessageAndTaskList undoMessage currentTaskList If any exceptions are thrown by the database during the modification of the database in statement 2 statement 3 will not be executed and thus nothing will be pushed to the undo stack When the database throws an exception your operation will not be committed and thus there is no need to rewrite to the database Supporting refresh operations The CommandHandler will store the last view and sort operations with the help of these
17. gn and how you can extend it So let s get started 2 Architecture Dolt is separated into various components Ul Logic Storage and some shared components as illustrated in the overview diagram below In the code this is made distinct by having one package for each major component Ul Logic Database Command Command File Handlers Parsers Management Shared Components Search Terms Logic to UI Figure 1 Architecture of Dolt w15 2j VO 5 3 Understanding the Command Flow In Dolt all actions are initiated by the user and correspondingly the user interface that is all actions start with the user doing something The Ul sends the command to the Logic component The Logic component parses the command and then takes the appropriate action usually invoking the Storage component The response then goes back to the user via the method s return style This is reflected in the sequence diagrams add some task l Refer to sequence Send command diagram under Logic 5 uCommunicator String Lo Internal processing Add task to storage add Task t Exception if error encountered Status string Show add task sucess failure lt a Refer to sequence Send command diagram uiCommunicator String Lo Internal Processing under Logic Y Get list of tasks getAl List lt T
18. if the database cannot locate one or more tasks it is required to read modify To preserve database integrity the HashMap lt Integer Task gt in the Database class will not be modified if any of the above exceptions occur 4 4 Shared Components 4 4 1 Task The task object is the main data type used by Dolt Each task object holds one task Constructors The class has 6 constructors allowing you to create the 3 different types of tasks floating deadline and timed and 3 more that allow you to set the boolean done status of the task when creating the object To instantiate an undone floating task Task java lang String name Example new Task This is an undone floating task To instantiate an undone deadline task Task java lang String name org joda time DateTime deadline Example new Task This is an undone deadline task new DateTime 2011 9 5 23 59 To instantiate an undone timed task 19 w15 2j VO 5 Task java lang String name org joda time DateTime startTime org joda time DateTime endTime Example new Task This is a timed task new DateTime 2011 9 5 23 59 new DateTime 2013 12 31 00 00 Important APIs done boolean newDoneStatus volg Marks the task as done or undone getDeadline getStartTime getEndTime DateTime Gets the relevant times of the task If the field is not applicable a public constant Task IN
19. important interface to Logic is the uiCommunicator String method which serves as the entry point to the entire Logic component Logic and serial numbers in tasks The Logic component holds a complete representation of the tasks currently shown to the user This is needed because the index number shown in the Ul is different from the serial number in the tasks The Logic is responsible for holding the mapping between them 4 2 2 LastShownToui This class holds the last list of tasks that was sent to the Ul to be shown to the user The use of certain commands requires the user to provide the index number of the task they wish to work with However a mapping between the index number and the actual task it is referring to is needed for the command to work Therefore the Logic component will maintain the latest list of tasks given to the UI This last shown list is stored in this class for easy accessibility by the command handlers parsers 13 w15 2 VO 5 This class applies the Singleton pattern to ensure consistency among the handlers parsers An instance of LastShownToul class has been pre acquired and referenced in the handlers parsers via this protected variable protected static LastShownToUI lastShownObject To retrieve the list of last shown tasks use this LastShownToUL getLastShownList To update the LastShownToUl instance with the new list use this LastShownToUI setLastShownList List lt Task gt newList
20. low if a very large number thousands of tasks are to be shown 6 3 Keyboard shortcuts Keyboard shortcuts are currently only available if Dolt for the Windows platform This feature is still not supported in Mac OS and Linux 7 Future Work 7 1 Google Calendar and Tasks integration Dolt currently does not integrate with Google services However there exist some users that would prefer this functionality so they can use Google features like SMS and email reminders 7 2 Password protected database The database file is stored in plaintext format A password lock with a suitable encryption scheme is envisioned to cater to more security conscious users 7 3 Internationalisation The interface of Dolt and the commands it accepts is currently only limited to the English language To cater to a greater group of users support for more languages is intended 23 w15 2j VO 5 8 Appendix 8 1 Help xml sample amp xml version 1 0 lt hint gt lt command gt lt name gt lt CDATA lt h1 gt Delete lt h1 gt gt lt name gt lt summary gt Deletes task s from your schedule lt summary gt lt usage gt lt CDATA lt b gt delete lt b gt index Deletes the task at index gt lt usage gt lt usage gt lt CDATA lt b gt delete done lt b gt Delete all completed tasks gt lt usage gt lt usage gt lt CDATA lt b gt del lt b gt over Delete all tasks before this moment gt lt usage gt lt usage gt lt CDATA
21. ndow of Dolt WindowBuilder has been occasionally noted aae Citi to give parsing errors for code mat is still valid So check the design view often so that development of the GUI in WindowBuilder continues to work This subclass implements the quick add i GUI Coding and WindowBuilder This subclass implements a plain Jane command line interface that works using standard Java I O 4 1 7 CliWithJline Subclass This subclass extends the Cli subclass and implements an enhanced command line interface that uses the Jline console library to implement features such as Tab Completion and support for a resizable terminal window Note that the Jline library interfaces natively with the terminal of the underlying operating system and as such does not work when a full terminal is not available for instance in the Eclipse console 4 1 8 Hint Class This class provides some help text for each of the commands Its methods are not accessible directly to get the help text use getHTMLHelp or getNoHTMLHelp in the UI class Help Text File help xml The help text is stored in the XML format at src main resource help xml The hint class will accept only one name and summary field The name field should be enclosed in lt h1 gt HTML tags to allow for custom styling by the GUI Usage of lt b gt tags is encouraged to emphasise a specific aspect of a command Multiple usage and extra tags are allowed The hint class will strip away the
22. nts which have an index the parser should obtain the relevant Task object from the LastShownToui list to extract its serial number This serial number is then returned to its associated handler 4 Exceptions can be thrown from the parser and are expected to be caught by its associated handler 15 w15 2j VO 5 The creation of a parser for each handler is not mandated but highly recommended for possible sharing of similar parsers in future 4 2 5 Sequence Diagram The following is a sequence diagram of the process in the Logic class when adding a task Note that the diagram is largely similar for other commands except 1 the AddHandler class is replaced by the appropriate command handler 2 Add created task to database is replaced by the corresponding call to Database and 3 calls to AddParser are replaced by calls to the corresponding command parser 16 Command uiCommunicator String w15 2j VO 5 Parse Command parseCommand String CommandType Determine Command Type detemineCommandType String CommandType Instantiate Correct Handler for Command B executeCommand CommandT a gt String LogicTovi Execute Command execute String LogicToUi Get Task Type getTaskType String TaskType taskType Get Start Time getBeginTime String DateTime startDateTime Get End Time gelEndTime String DateTime endDateTime Get Task Description getTaskName
23. ome modifications to this library For example the date format interpreted by Natty has been changed from the MM DD YY format to the DD MM YY format 21 5 Testing w15 2 VO 5 Testing is an integral part of the development of Dolt You are encouraged to employ test driven development TDD whenever feasible Automated testing is carried out using test cases based on the JUnit4 framework The entire code base must pass all test cases by the AllTests test suite before you commit to the repository These are the conventions set out for the development of Dolt Where to put my test files src test Package Name Package Name has to be identical to the package of the class under test How to name test classes The test classes have to be named Class Name Test For example to test the Database class name the test class DatabaseTest How to name test methods The test methods should ideally be named test name of method under test However this is not strictly mandated as testing of a particular behaviour may require several methods Package level Test Suite Every package has a Test Suite named Package name Tests which allows automated testing of the entire package You should update this with any new test cases Main Test Suite The root of the test directory contains the A11Tests test suite which will run all of these package level test suites This will in effect be testing everything You should
24. omorrow a hand in homework by Monday 6pm a is a shortcut for add If Dolt misinterprets the task name as the time put inverted commas around task name fi he helpful hi add read book from page 1000 to 1100 by Friday di Or you can refer to the helpful popup hints can be disabled by typing help off w15 2j VO 5 3 2 Quick Add Pressing Win A you can change that in the preferences will launch the quick add dialog box Simply type your new task into the box to add it to your task list Dolt Quick Add Type your command below The syntax follows that of the main window 3 3 Command line Interface Launch Dolt in a terminal with the cli argument Then just add type your commands into the prompts Dolt s command line interface supports some handy shortcuts press tab to have Dolt complete your commands and press up down to view your command history It also supports different terminal sizes so feel free to resize your terminal window to whatever size you like 4 Supported Task Types Dolt supports 3 distinct types of tasks Floating tasks Tasks that have no specific time E g Write report Deadline tasks Tasks that have to be done by a specific time Example Write report by 2pm on 5 Sept 2012 3 Timed tasks Tasks that have a specific start and end time Example Write report from 12pm 5 Sept 2012 to 2pm 5 Command Reference Dolt s keyboard commands are easy to use The
25. orted in ascending order If nothing is specified the tasks are sorted by start date deadline in ascending order sort name sort start sort done descending search keyword keyword List tasks with the keywords search cupboard search cupboard shoe refresh List tasks based on previous list search command refresh When viewing tasks an index number is displayed next to each task The index number changes when different arguments are used with the list or search command and when tasks are added or removed When required by a command the index number used corresponds to the index number shown with the latest list command In the command line interface the list is not automatically refreshed after each modification If you have made any changes to the tasks do a refresh or list to update the index numbers Delete delete index index Deletes the task s with number index delete 1 delete 2 3 4 delete done completed finished Deletes all tasks that has been marked as done delete done delete all Deletes all tasks delete all delete over Deletes tasks that ended before the current time Both done and undone tasks will be deleted delete over Edit tasks edit index name n new name start s new start time start date end e new end time end date Changes the name start time end time of the task specified by index to the
26. tabase class FileManagement done done Boolean Database FileManagement getDeadline DateTime 1 Attributes getEndDate DateTime E Operations getSerial Integer getStartDate DateTime getTaskName String getType Task TaskType inWithinDateRange DateTime DateTime Boolean isDeadlineTask Boolean isDone Boolean isFloatingTask Boolean isTimedTask Boolean Figure 6 Class Diagram for Storage Component Upon instantiation the Database class reads in the text file of the tasks through the FileManagement class and stores the tasks ina HashMap lt Integer Task gt where Integer is the serial number of the Task The database will do a deep copy clone for every List or Task object that travels in or out of its public APIs This is to prevent modification of the tasks stored internally via external references Important APIs add Task newTask veta Adds a new task to database delete int serial Void delete int serial Deletes an existing task s in database The serial number can be obtained from the Task object you want to delete Void deleteAll Deletes all tasks in database Database DB File Status getFileAttributes Gets the file permissions of the database file One of the following values will be returned FILE_ALL_OK FILE_READ_ ONLY FILE_IS LOCKED FILE PERMISSIONS UNKNOWN FILE_IS CORRUPT You are strongly suggested to call this
27. tartRange new DateTime 2012 12 27 00 00 endRange new DateTime 2012 12 27 23 59 44 3 LogicToui The LogicToUi object is a container for passing results from the CommandHandlers to the UI It is required because handlers will return a multitude of different things It holds the following attributes that can be set in the constructors Attribute Description output String A message for the UI to display to the user display List lt Task gt A list of tasks for the Ul to display to the user filters SearchTerms The search terms used to obtain the list of tasks currentSorting SortStatus The parameter used for sorting the list of tasks sortReverse boolean If true indicates that sorting is in descending order lastChangedSerial int The serial number for the last changed task The UI can use this to highlight the last change made Every LogicToUi object is expected to carry a return message to be displayed by the UI after every command This is enforced by the constructors The other attributes are optional 4 4 4 NattyParserWrapper Dolt uses the open source date parser library Natty written primarily by Joe Stelmach Instantiating Natty may incur a noticeable delay Since the Natty API is used many times the delay can be frustrating Therefore the Natty library is enclosed in this wrapper as a singleton object A dummy command is sent to it at the beginning to perform the instantiation only once We have made s
28. turns 0 is they are equal 1 if the current task is smaller than the task provided and if it is larger 4 4 2 SearchTerms The SearchTerms object is a container for passing search terms It is used by the list and search commands to pass search terms from Logic to Storage It can also be used to pass search terms from Logic to Ul through the LogicToUi class for display purposes for example to notify the user on the search terms used in the current view 20 w15 2j VO 5 It holds the following attributes that can be set in the constructor Attribute Description If the attribute is set to true completedTasks boolean Only completed tasks will be matched incompleteTasks boolean Only incomplete tasks will be matched timedTasks boolean Only timed tasks will be matched deadlineTasks boolean Only deadline tasks will be matched floatingTasks boolean Only floating tasks will be matched startRange DateTime and If specified matches only tasks that overlaps the time period of endRange DateTime startRange to endRange inclusive keywords String If specified matches only tasks that contain all the strings in the array Keywords are case insensitive Attributes can be combined For example e Get incomplete timed tasks incomplete true timed true e Get deadline tasks with market and home keywords deadlineTask true String keywords home market e Get tasks that happen on 27 Dec 2012 s
29. y start with a keyword for the action to take following by some details about the action Note the following formatting used for the command syntax descriptions below e Bold keyword type exactly e Italics replace with appropriate argument e Item in square brackets optional argument e a b use aor b you cannot use them together Syntax Description Example Adding tasks add task name Add new floating task add fix cupboard add task name by Add deadline task add fix cupboard by date time 2pm on 5 Sep add task name from Add timed task with specific start and add fix cupboard from start date to end date end time and date 2pm on 5 Sept to 4pm on 6 Sept If Dolt is getting your task names mistaken as dates just enclose the task name in double inverted commands e g add fix cupboard Viewing tasks list Lists all tasks in order of due date list w15 2j VO 5 list complete incomplete done undone floating deadline timed today tomorrow overdue List all tasks that meet the criteria specified Note that you can use more than one criteria only tasks that match all the criteria will be shown list complete floating sort type done start end name descending reverse Sorts the tasks based on criteria specified Only one criteria is allowed except for descending reverse If descending is not specified the tasks are s

Download Pdf Manuals

image

Related Search

Related Contents

Speck SeeThru iMac 24"    取扱説明書  Helios - Migros  CLAMPEX® KTR 150 Instrucciones de montaje KTR  1756-PM010C-EN-P, Logix5000 Controllers Add  DeLOCK USB 3.0 19-pin - 2 x USB 3.0-A  manttis  Istruzioni d`uso e di installazione Essiccatoio a sfiato PT 7186 Vario  PSEE-10/22 - Metalúrgica Siemsen Ltda  

Copyright © All rights reserved.
Failed to retrieve file