Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007
Milestone 2: Create Simple GUI (Time Management Application)
Blake Bausser: gtg780g
Chris Sidi: gtg303m
Benjamin Donahue: gtg324a
Pritesh Patel: gtg423g
I) Milestone 1 involved created the model code for the calendar. The Model code included:
- ScheduledEvent - Class that can be instantiated to represent a timed event on a certain date.
- ToDoItem - Class that can be instantiated to represent an activity to be performed on a certain date.
- Calendar - Class that is used to organize, add, delete, and store ScheduledEvents and ToDoItem by date.
II) Which brings us to Milestone 2. For this milestone, we had to create a simple GUI representation for our Model create in
Milestone 1. Specific requirements:
- Users should be able to display the GUI by executing Calendar show.
- Users should be able to add new todo items and scheduled events to a day and edit existing ones.
- Users should be able to delete todo items or scheduled events from a day.
- Users should be able to view a calendar showing their todo items and scheduled events a day at a time. The calendar day view should show the scheduled events organized by the time they start, should effectively communicate how long the events last, and should display any todo items that are due that day.
MILESTONE 2 DETAILS
- To run the program, upload the .st file that is included in the zip.
- (To upload into squeak ... a) In the squeak environment, left click. b) World menu should open up, choose 'open'. c) the open menu should open up, choose 'file list'. d) a Pink file Browser should open up, from here just browse and choose the file. e) After choosen, click the fileIn button. f) That's it.)
- After uploading, in a WorkSpace, type Calendar show and press 'alt D' The program should run.
- (To open a workspace, left click in the squeak environment, go to open, then go to workspace and a workspace screen will pop up.)
- Once running, working the program is pretty self explanatory. I will explain the GUI coding aspects of the design.
- The entire window is a SystemWindow - this will include the minimizing and close buttons.
- The first from the top is a RectangleMorph. In this RectangleMorph we added other RectangleMorphs with lists which make up the DateBox. This code is in the ToolBar class. Start at the initialize method and follow to the makeDateBox method.
- In this first RectangleMorph we added two PluggableButtonMorphs which are coded in the initialize method for the ToolBar class.
- Below are two RectangleMorphs, one to hold the ToDoItem components and the other for the ScheduledEvent components. The code for these two RectangleMorphs is in GeneralCalendarPanel, and two subclasses ToDoItemPanel and ScheduledEventPanel.
- In these RectangleMorphs, we added a label at the top which are just TextMorphs. The code is in the initialize method.
- Below the Label we added a PluggableListMorph which is also in the initialize method of the GeneralCalendarPanel.
- The last is the buttonPanel which is a RectangleMorph with PluggableButtonMorphs in them. This code is also in the initialize method of GeneralCalendarPanel.
FIRST TIME MORPHIC USERS
- As I started to code this GUI based milestone, having experience with Java GUIs ... I knew NOTHING about how to start coding Squeak GUIs! Well, I only thought I didn't. As you probably already know, to get the hang of something new in CS, one has to try it out. After a few initial little code tryouts, I realized that these GUIs are not much different from Java GUIs.
- In java, one is used to the API and google for answers on how to do things. As you probably have been told, there are not many google answers for Morphic(GUIs in Squeak) and there is no well organized and documented API. To find answers, googling helps a bit, but the best is to just dig into the classes that are defined in squeak. You can look at the classes that exist and see all the code. After initial learning curve, finding answers by just looking at the classes through the system browser in squeak is the easiest.
- SUGGESTION: a) Open up the System Browser in squeak. This browser allows one to dig through all the classes. Take a look around. To search for a class, right click in the first scrollable list on the system browser and select 'find class'. b) I have listed below a few classes that might be useful for your morphic projects. Try using them. Try using them one at a time. First instantiate it and view it. To view any morph, just instantiate it and pass it the message "openInWorld". Use the System Browser to look at its methods and try using them to see something different happen. Most methods do not have comments but the method name usually gives away what the method does. c) After this initial exposure, start looking at other peoples code in the CASES! You well start to see how things are done! After step c), we understood how to START coding the project and finished it with ease.
USEFUL MORPHIC CLASSES
- SystemWindow - Like a frame in Java. It is used to hold all the components for a window look. Has the traditional x and so forth ...
- RectangleMorph - Just what it says. Can make it any size, can add other components to it including other rectangles. Usually used for organization.
- PluggableButtonMorph - Like a JButton in Java. Can be added anywhere and can size it any way you want.
- PluggableListMorph - Like a JList in Java.
- StringMorph - morph instantiated with the message 'contents: ...' that just show the wording that is given to contents. It can be added anywhere just like other morphs.
- ScrollPane - Exactly what it says. One side note on this. If you want to add something large but want only a part of it to be shown on the screen and the other part should be scrollable... you have to access the 'scroll' from the instantiated ScrollPane and then add stuff to it. The stuff that is added should have its bounds(size) set!
Link to this Page
- Cases last edited on 30 July 2011 at 2:33 am by r59h132.res.gatech.edu