1. DVIRectangle

    DVIRectangle is a utility class which is used throughout IDVI instead of the class java.awt.Rectangle. Its main advantage is that it maintains a flag indicating whether it has ever been initialized. An uninitialized rectangle is considered to be completely empty. This is quite distinct from a rectangle which contains a single point but no pixel, or which contains a horizontal or vertical line of width zero.

  2. The union of an unset rectangle with another rectangle is the other rectangle.

  3. The intersection of an unset rectangle with another rectangle is an unset rectangle.

  4. This behavior makes it easy to take the union of a list of rectangles -- just create a new rectangle, and union the others into it in a loop. There is no special case for a list of zero rectangles or special case for the first rectangle in the list.

  5. Rectangles containing a zero-height line are useful for handling an outline section which is collapsed. It is still present, and still needs to be included in bounds computations for an enclosing object. But it does not actually have any area, and never needs to be redrawn.