The structure of a dvi page is captured in a hierarchy of Block objects. This hierarchy is built by a PageParser object, which reads tokens from an idvi.dvi.DVITokenizer object. This structure is independent of the choice of colors or scale factor which will be used to display the page.
Consistency within a hierarchy of Block objects is maintained through the use of a BlockLock object. This maintains a util.ReadWriteLock on the whole Block hierarchy. Anything which modifies the state of the hierarchy first obtains a write lock. This is done at a very fine-grained level, so that painting can occur while a hierarchy is being constructed.
Top-level information about a Block hierarchy is held by a BlockRoot object. A BlockRoot object contains a BlockLock object, a single Block object, and a list of named Blocks.
A Block hierarchy or part of a Block hierarchy is displayed on the screen using a ViewPanel object. ViewPanel extends java.awt.Panel, and so is where mouse events and update requests are handled.
ZoomPanel extends ViewPanel, and allows drag-panning and prevents further zooming. This is used to provide the magnifier pane in the DVI Controls window.
ViewPanel and ZoomPanel use a hierarchy of View objects to maintain the state of their display. The hierarchy of View objects mirrors the hierarchy of Block objects. Views are similar to java.awt.Components, but are much more lightweight since they carry no platform-specific baggage.