Viewer

Viewer is a simple abstract super class for all external viewers. Basically, it takes a file name and then spawn a new window to display that file. Currently, the only abstract subclass is ImageViewer which delegates to an ImageReader to view different image files such as gif and bitmap files.

Viewer can also acts as an adaptor for other external viewers. A concrete subclass may be a PostScriptViewer which is an adaptor for GhostView.

The only concrete subclass of Viewer existing in HyperTalk is ImageViewer. It reuses ImageReader that takes a filename and then displays that file. Therefore, Viewer also takes a filename as an input argument. However, if there exists more external viewers that can accept inputStream as input, then it might be a good time to evaluate if Viewer should be a subclass of StreamFilter which consumes the inputStream.

Figure 1. Viewer displays a file