gui.preview package


Package Contract

This package is responsible for constructing a simplified version of an HTML page, that is in the space of pages, for the user to view. It is up to the CloseUp what kind of user actions cause a PagePreview to appear. When the user does choose to view a preview of a page it is the responsibility of classes in this class to construct and display this preview.

Package-Level CRC

Collaborators:
gui
Collaborator classes in package gui
CloseUp

Class-Level CRC

Class PagePreview

A PagePreview is a Frame that contains a rough approximation of what a given chunk of HTML would look like in a web browser. It doesn't display images or allow the user to click on links, and it can't make tables, forms, or frames.
There are no scrollbars to allow the user to see more of the page. Thus, you may want to truncate the HTML you give to a small PagePreview. The end of it will never be seen anyway. When the user closes the window or moves the mouse off it, it makes itself invisible.
This class is the only one in this package not taken from the HTML browser written by: Frans van Gool, Magnoliastraat 7, 2651 TD Berkel en Rodenrijs, The Netherlands. http://www.geocities.com/SiliconValley/Way/7979/
Mr. van Gool apparently doesn't like comments or documentation (perhaps he has an allergy?), so his code was modified only to strip out the parts we don't need.
Variables and Methods:
public pagePreview()
This is the basic constructor.
public pagePreview(String page)
This constructor builds a PagePreview that shows a certain page.
public void showPage(String page)
Shows the given page in the PagePreview. If an error occurs, the title will be changed to "Unable to load page".
public HtmlCanvas getHtmlCanvas()
Return the HtmlCanvas. This will allow other objects to listen for events, change the HtmlDocument being displayed, etc.
The following classes are imported from Mr. van Gool's code:
* HtmlCanvas
* HtmlDocument
* HtmlPager
* HtmlPagerItem
* HtmlPagerLine
* HtmlTokenizer
* IntVector
* StringVector

Message Interactions


This package interacts with class CloseUp in package gui. This class has an instance of the PagePreview that is invoked to display specific page previews depending on the user's activity.
void removePagePreview()
Called by the PagePreview when the user moves the mouse off the PagePreview window.
Stub Functions
public void displayPagePreview(Document documentToView, Location whereLocation)
Opens the PagePreview at the whereLocation to display a simple view of the documentToView.
public void removePagePreview()
Remove the PagePreview from the CloseUp

last | | to sitemap | | up one level | | next