Affordable web design - 622 Graphics and Java2D Chapter 11 arc width
622 Graphics and Java2D Chapter 11 arc width height (x, y) arc height width Fig. 11.15The arc width and arc height for rounded rectangles. 11.15 The drawOvaland fillOvalmethods take the same four arguments. The first two arguments specify the top-left coordinate of the bounding rectangle that contains the oval. The last two arguments specify the widthand heightof the bounding rectangle, respectively. Figure 11.16 shows an oval bounded by a rectangle. Note that the oval touches the center of all four sides of the bounding rectangle (the bounding rectangle is not displayed on the screen). 11.6 Drawing Arcs An arc is a portion of a oval. Arc angles are measured in degrees. Arcs sweep from a starting angle the number of degrees specified by their arc angle. The starting angle indicates in degrees where the arc begins. The arc angle specifies the total number of degrees through which the arc sweeps. Figure 11.17 illustrates two arcs. The left set of axes shows an arc sweeping from zero degrees to approximately 110 degrees. Arcs that sweep in a counterclockwise direction are measured in positive degrees. The right set of axes shows an arc sweeping from zero degrees to approximately 110 degrees. Arcs that sweep in a clockwise direction are measured in negative degrees. Notice the dashed boxes around the arcs in Fig. 11.17. When drawing an arc, we specify a bounding rectangle for an oval. The arc will sweep along part of the oval. The Graphicsmethods drawArcand fillArcfor drawing arcs are summarized in Fig. 11.18. (x, y) height width Fig. 11.16An oval bounded by a rectangle. 11.16 Copyright 1992 2002 by Deitel & Associates, Inc. All Rights Reserved. 7/7/01