Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007
If you are reading this, it is probably because you saw that this was a prefab tutorial. This would imply that you are thinking of using prefab:
The prefab architecture is quite easy to begin to use. It has a handy set-up system where you can simply place widgets then auto-generate code to build it.
- However, you will quickly find that the code generation is very limited. It will generate positions, sizes, tags, text, and sometimes color, but beyond that it does nothing. While this may seem to be enough at first, you will quickly come to realize that you will want to preserve such things as border size, color, and style, being locked, being immobile and many other properties which can be set using the widget menu, but which prefab ignores.
- The second minor problem is coloring. Prefab is designed to use the class methods openInSystemWindow and newInSystemWindow to open your PrefabManager class. The problem is that the window system automatically sets your color to be transparent, so no matter what you do your panel turns white. This makes for very unreadable panels. We found that we could get around this problem by either putting our panels within a holder panel, or by resetting the PrefabManager color to the desired color after its creation (this looks strange though, because the window displays then colors).
- The more severe problem is the limited functionality of the widgets. Examples:
- PrefabListBox: this is the list box class, but it does not allow most functions that are required for list boxes. It does not allow you to redraw the contents. It does not allow you to rearrange the contents. To perform these basic operations you must remove everything, then readd everything. The problem is, there is no way to select an item short of a user click on the item, which means that the selected item cannot be the selected item after a "refresh".
- PrefabScrollBar: Crashes with a ZeroDivide error when associated with an empty PrefabListBox. We just fixed this problem so that we could still use it.
- PrefabRadioButton: there is no way to specify a group, so a select on any prefab radio button deselects all others anywhere in your prefab manager.
- PrefabManager: when opened in a system window, there is no system for notifying the contents when the window is closed.
- These are just a few of the problems with the prefab system. If however, you find yourself in the unfortunate predicament of reading this after making the mistake of using prefab there is still some hope.
- If you have not gone too far to the dark side, you can still save yourself. If you are still in the first three Milestones, just scrap your existing code. Stop using prefab while you still can.
- If you are too far in to stop using it and still be able to produce a working product we offer you this consolation. You can realize this: nothing else in Squeak uses Prefab, so you can do whatever the heck you want with it - this includes rewriting it. While we did not have enough time to make Prefab worthwhile, we did fix a few of the issues. You can file in these files, which include most of the changes we made to the prefab. In encompasses these fixes, and a few small others.
- Call-back when window closes. We have made it so that if you open a PrefabManager in a system window it will call back to your PrefabManager and invoke the "close" method. This will allow you to perform whatever you wish when the window is closed.
- PrefabScrollBar handles empty lists. The problem was poor design, so we fixed it.
- PrefabCheckButton now has many more abilities, such as the ability to set the button checked or unchecked, setting the color, and retrieving the text. These are all features that one would expect to be essential to a GUI workset, but apparently the writer of Prefab didn't think so. Anyway, we added them.
- To use these changes, just file these in after Prefab is already filed in:
The part you want
We figure there is a good chance that you didn't read anything in here, but just are scanning Cases pages for code to snork. Well, we wouldn't want to disappoint you, so here for your viewing pleasure is our final turnin.
Included in the final you will find a readme explaining how to use everything as well as an ECoDE file that will explain how the parts interact; however, in case you are reading this before learning how to use ECoDE, I have included a quick overview of the parts and their interactions.
Just for reference, this page should contain the specs on the Milestones: Milestones
- Geneology Catagory
- Family: Represents a family structure, including family information and family relationships
- Person: Represents the information about a single person
- Geneology: Holds collections of Persons and Familys
- GeneologyWindow: Holds a FamilyPanel and a PersonPanel and allows them to communicate
- PersonPanel: Displays information about a Person
- FamilyPanel: Displays information about a Family
- GeneologyManager: Holds collections of Geneologys
- GeneologyManagerWindow: Displays the available geneologies, and allows the user to interact with them by searching, merging, loading, displaying or closing them.
- GEDCOMParser: An auxilary class for the Geneology class. It is passed a file stream from a GEDCOM file and it parses it into a Geneology.
- GeneologySearching Category
- Search: handles searching a geneology
- WebSearch: extends search and allows searching a website
- SearchPanel: Allows the user to enter his search criteria.
- WebSearchPanel: Extends SearchPanel and allows the user to specify search options for a web search.
- WebParser: parses Geneology sites and retrieves information about a person searched for.
- SearchResults: Organizes results and responds to user inquiries about the results.
- WebSearchResults: Extends SearchResults and allows handling WebSearch results.
- SearchResultsPanel: Provides the user with a way to view the results of a local search.
- WebSearchResultsPanel: Extends SearchResultsPanel and provides user with all the same options as SearchResultsPanel as well as a way to fill in empty fields in a local geneology with data from the web.
- GeneologyBrowser Category
- FamilyTree: Find all the main family relationships and provide that data to the FamilyTreePanel
- FamilyTreePanel: Display the main family relationships for a single person.
- GeneologyMerging Category
- GeneologyComparison: For a given Person in the first geneology, find likely matches from the second geneology
- GeneologyComparisonPanel: Display the matches
- MergeConfirmationWindow: Find out what data to use when merging two people.
- MergeWindow: container for holding the GeneologyComparisonPanel and the PersonMergePanel
- PersonMerge: Handle merging two people and all family relationships recursively
- PersonMergePanel: Allow the user to select two people to merge and begin the merge (or add the people to the new geneology)
- MergedGeneology: Temporarily store information about a geneology being created from the merger of people from two other geneologies.
- MergedGeneologyWindow: Display the geneology created as the people from the Geneologies are merged. Also allows unmerging people.
- MergeInfo: Temporarily set in a Person object to track information about whom the person was merged from.
An important note about Squeak
- VERY IMPORTANT! Always work on the hard drive of a computer, not a network or slower drive because the changes and images files will get out of synch and your code will explode. Also, make absolutly sure the system clock on whatever computer you are using is accuratly set. If you use a computer with a system date of 1990 or something earlier then your last coding session in Squeak, your changes will not be saved because Squeak thinks that if the time stamp is old, the code is old and is not the most recent version. So don't risk losing your code - always check the sysclock.
- Squeak likes to freeze and crash. When Squeak starts Garbage collecting, you will know it. The environment will just freeze for a few seconds but will usually recover. If your actions or code generates a freeze, press Alt + . immediatly. That's like a ctrl + break that can stop an infinite loop or something that would devour memory/cpu resources. Save your image often. Save you image everytime you type something that required thought.
The mac cluster
- The states cluster was often filled during our group meeting times so we primarily used the mac cluster for team coding time and integration. Half the computers in the mac cluster denied our credintials, but we could log into some of them (try to get one with a two button mouse if you can). If you do use a mac, play around with the F9, F10, and F11 keys, they are very useful and just cool to watch if you hold down the shift key before pressing them. The only weird thing about the macs is Apple + ~ is the switching key sequence between windows of the same app and Apple + tab only switches between applications.
- Our team exchanged code by emailing out .st files. This method sort of worked, to my knowledge we only lost one code change before a turnin, but it was very messy way of doing things. If someone sent out an st file for something another person was working on, code would be overwritten and work would be lost. Also, especially since we made modifications to Date and lots of Prefab stuff, not just our Geneology objects, we sometimes had problems keeping track of everything we changed. Put in the effort to explore change sets, they may save you a lot of confusion and grief.
- Before we started implementing code, we had stub methods in our objects. Because a file-in will not delete a method, this would cause problems especially with child objects when a programmer decided to allow a parent to handle some functionality instead of the method we had a stub for because if the stub still exists in your partner's code, it would be used instead of the parent method you want to be using. So before you file in one of your teammate's categories or objects, delete all the methods associated with that object, file it in, then add an instance variable to the object, save that change so that Squeak will recompile the object, then remove the instance variable. This recompile step is very important, if you do not recompile you might get errors that say something about an "obsolete object" being used. You may also have to use the method described to force child objects to recompile.
- Get a CVS repository or at least an FTP server – some common space to put ST files. For group members with clutered inboxes, it was difficult to find the most recent version of an ST file and all the files that were needed. If all ST files were on centeral server, things would be a lot more organized and getting an email every hour from teammates with the subject "Most Recent" or "Fresh Monkey Poo" followed by "Fresher Monkey Poo" is not a very descriptive versioning system.
- If ECode is not required, do not use it unless major upgrades have been made.
- Yes, ECode will generate methods for you based on design, unfortunatly the way in which it generates methods off requirements is not very good. For a requirement we would would want to describe what that requirement is in english but when ECode generated a method for that requirement, the method name would be like 100 characters. So the first step we took after using ECode was deleting all methods in the "Generated by ECode" class category.
- Probably because it's in Squeak, ECode is slow. It takes a long time to open windows for all the little requirements and that makes it annoying to use at 3:00 am the due date of a project when you are updating your design because your code no longer matches the design you made three milestones ago.
- The first think you will probably want to do after using ECode is delete all methods in the category "Generated by ECode" of any objects you told ECode about. The names for methods and instance variables are probably not names you will actually want to use.
- Because only one person can work on an ECode file at a time, it is more difficult to divide up design work. This could be taken as a good thing when starting a project, but bad towards then end when you are just making modifications to reflect a current reality.
- The "Layout" button for the UML generated by ECode will cause Squeak to be unresponsive for a while, but don't panic, just sit back for a few minutes and let ECode do its magic layout alogrithm, you do not need to force quit Squeak.
- The layout of UML classes done by ECode is well, it lays it out, just not in as pretty of a way as a human could. For the second milestone of our Geneology project our UML class diagram was in the shape of a person, now can ECode do that? I think not.
And that's about it.
Link to this Page
- Cases last edited on 30 July 2011 at 2:33 am by r59h132.res.gatech.edu