1 - © 2010 by Spencer Rugaber Ungraded Inclass Exercise...

Info iconThis preview shows pages 1–14. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: © 2010 by Spencer Rugaber Ungraded Inclass Exercise TextBrowser © 2010 by Spencer Rugaber Scenario • Imagine the problem of browsing the text in a computer file • Imagine that no GUI (Graphical User Interface) toolkit supplied a single widget to do this • Imagine that you would like to devise a cleanly structured solution © 2010 by Spencer Rugaber Scenario - 2 • From what components would you build your TextBrowser? © 2010 by Spencer Rugaber FileManager • You need some way to access the file's contents – Assume that you cannot hold the entire file contents in memory – Assume that you have, at the operating system level, line- oriented access to the file Data Once upon a midnight dreary, while I pondered weak and weary, Over many a quaint and curious volume of forgotten lore— While I nodded, nearly napping, suddenly there came a tapping, As of someone gently rapping, rapping at my chamber door. "'Tis some visitor," I muttered, "tapping at my chamber door— Only this and nothing more." • You need to provide a module that, when requested can retrieve a limited length, consecutive subsequence of the file's lines – Don't worry about file opening or closing © 2010 by Spencer Rugaber ViewPort • You need to be able to display the textual content graphically – Assume the ViewPort displays an integer number of lines – Assume the ViewPort can be resized to be of any length between 1 to 100 lines – Assume that all text is in the same font and has the same point size © 2010 by Spencer Rugaber ScrollBar • You need to give the user some way to access different parts of the file if it all can't fit on the screen simultaneously – Assume a vertical ScrollBar with a movable handle that sits in a tray – The handle position should denote that part of the file that should be displayed in the viewport – The size of the handle (in proportion to the size of the tray) should denote what portion of the file is visible © 2010 by Spencer Rugaber Question 1 • What use cases apply? © 2010 by Spencer Rugaber Question 1 • What use cases apply? – User displays file © 2010 by Spencer Rugaber Question 1 • What use cases apply? – User displays file – User moves cursor © 2010 by Spencer Rugaber Question 1 • What use cases apply? – User displays file – User moves cursor – User resizes viewport © 2010 by Spencer Rugaber Question 1 • What use cases apply? – User displays file – User moves cursor – User resizes viewport – ... © 2010 by Spencer Rugaber Question 2 • Draw a UML class model diagram presenting these requirements – That is, it should be an analysis model and not a design model – Include the three classes, their externally visible operations ( resizeWindow , moveCursor ) and their externally visible attributes – Include labeled associations – Do not include any further detail such as cardinality, navigation or role names © 2010 by Spencer Rugaber Classes • Coming up with the classes should be easy – FileManager – ViewPort – ScrollBar...
View Full Document

This note was uploaded on 05/03/2010 for the course SA 5010 taught by Professor Spen during the Spring '10 term at Asian Institute of Management.

Page1 / 44

1 - © 2010 by Spencer Rugaber Ungraded Inclass Exercise...

This preview shows document pages 1 - 14. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online