Rect

The Rect class is used to represent the rectangular area described by four points of a graphic. In the enterprise framework, we have seen how the SimpleGraph class uses an instance of Rect to describe the container area on which graphs are displayed, as well as the area outside the container of the parent graphic. The constructor and class member code for Rect are shown in Figure 15-17.

Rect is instantiated based on four relative points, which combine to form a rectangle. The {constructor} simply takes these Distance arguments and stores the values in class member fields.

Figure 15-17. Rect.constructor method listing.
 {define-class final public Rect field public x1:Distance, y1:Distance, x2:Distance, y2:Distance {constructor public {default ...

Get Enterprise Curl now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.