Hi all! As promised in class, Quiz #1 is now online. Head over to the "main" course website, and see the latest post under "Assignments."
Regarding today's class, I'd like to hear your thoughts about how the "undo" method should work, and what exactly the HistListOp subclasses should provide in terms of methods to cause the correct behavior for undoing add, get and set operations. This will really test your understanding of what methods are for.
For a bit of related supplemental reading, go into the Java API, and check out the package javax.swing.undo. The obvious question you should be asking as you read about this is, "Could we use this framework instead of 'rolling our own' for HistList?" Can you answer it?
I await your posts on these topics or anything else related to recent class material. Please, no spoilers related to the Quiz.
Regarding today's class, I'd like to hear your thoughts about how the "undo" method should work, and what exactly the HistListOp subclasses should provide in terms of methods to cause the correct behavior for undoing add, get and set operations. This will really test your understanding of what methods are for.
For a bit of related supplemental reading, go into the Java API, and check out the package javax.swing.undo. The obvious question you should be asking as you read about this is, "Could we use this framework instead of 'rolling our own' for HistList?" Can you answer it?
I await your posts on these topics or anything else related to recent class material. Please, no spoilers related to the Quiz.
Dean Dominguez:
ReplyDeleteFrom the *.*.undo API it seems the Interface UndoableEdit stores similar variables (steps) that our history list from class stores. The methods in the interface also seem to allow for the functionality that we need; undo, redo, Etc.
It appears that the javax.swing.undo framework is not designed to be general purpose, based solely on the package name, which implies that it has something to do with a GUI.
ReplyDeleteAfter skimming the API, the *.undo framework is designed to be used in conjunction with the UndoManager class, which manages a list of UndoableEdits. Further, an UndoableEdit object is generated by an action listener, which is a Swing design concept. Basically a Swing component which takes user input can have an UndoableEditListener which generates an UndoableEdit (like a HistListOP). So we can use the design pattern of *.undo as inspiration, and not as an implementation.
Also, I love how you (Professor Hayes) used the phrase "roll your own".
Rob, you are absolutely right that the documentation strongly suggests that the Swing Undo framework was not meant to be used for general purpose applications, but rather for editing documents. Props for reading the API carefully!
DeleteOn the other hand, it doesn't follow that we CANNOT use the Swing Undo implementation to make our HistList work the way we want. So, my question still stands. If the answer is to be YES, then basically what is needed is a mapping between the various concepts/classes/methods defined in the Swing Undo framework and the corresponding ideas in the HistList context. In particular, we need to understand the concept of a "document" and whether we can treat a List as a kind of document.
how can you access file from different packages for example the powerdisplay lab uses render which is in the package
ReplyDeleteedu.unm.cs.cs251spr12.MacroSoft
Copy and paste the package into your repository. Then import it like you would other packages.
Delete