Java Reference
In-Depth Information
int x, int y,
int align)
drawRect (int x,
int y,
int w, int h)
Draws an empty rectangle with the upper-left corner at the given
(x,y)coordinate, with the given width and a height. The next section
e xplains why the rectangle is one pixel larger than you might expect.
drawRoundRect
(int x, int y,
int w, int h,
int r)
Like drawRect() , except that an additional radius is given for
rounded corners of the rectangle.
drawLine (int
x0, int y0,
int x1, int y1)
Draws a line from (x0,y0) to (x1,y1).
drawArc (int x,
int y,
int w, int h,
int startAng,
int arcArc)
Draws the outline of a circular or elliptical arc covering the specified
rectangle, using the current color and stroke style. The resulting arc
begins at startAng and extends for arcAng degrees. Angles are
interpreted such that 0 degrees is at the 3 o'clock position. A positive
value indicates a counter-clockwise rotation while a negative value
i ndicates a clockwise rotation.
fillRect (int x,
int y, int w,
int h)
Similar to drawRect() , but fills the given area with the current color.
fillRoundRect
(int x, int y,
int w, int h,
int startAng,
int endAng);
Related to fillRect() as drawRoundRect() is related to
drawRect() .
fillArc (int x,
int y,
int w, int h,
int startAng,
int endAng);
Like drawArc() , but fills the corresponding region.
Coordinate System and Clipping
In the drawing example, we already have used screen coordinates without explaining what they
actually mean. You might know that the device display consists of little picture elements (pixels). Each
of these pixels is addressed by its position on the screen, measured from the upper-left corner of the
device, which is the origin of the coordinate system. Figure 3.10 shows the lcdui coordinate system.
Figure 3.10. The lcdui coordinate system.
 
Search WWH ::




Custom Search