1157 lines · 52.0 KB · Java
RawDownload
     * Paints a 3-D highlighted rectangle filled with the current color.     * The edges of the rectangle will be highlighted so that it appears     * as if the edges were beveled and lit from the upper left corner.     * The colors used for the highlighting effect will be determined from     * the current color.     * @param       x the <i>x</i> coordinate of the rectangle to be filled.     * @param       y the <i>y</i> coordinate of the rectangle to be filled.     * @param       width the width of the rectangle to be filled.     * @param       height the height of the rectangle to be filled.     * @param       raised a boolean value that determines whether the     *                      rectangle appears to be raised above the surface     *                      or etched into the surface.     * @see         java.awt.Graphics#draw3DRect     */    public void fill3DRect(int x, int y, int width, int height,                           boolean raised) {        g.fill3DRect(x, y, width, height, raised);    }     /**     * Draws the outline of an oval.     * The result is a circle or ellipse that fits within the     * rectangle specified by the <code>x</code>, <code>y</code>,     * <code>width</code>, and <code>height</code> arguments.     * <p>     * The oval covers an area that is     * <code>width&nbsp;+&nbsp;1</code> pixels wide     * and <code>height&nbsp;+&nbsp;1</code> pixels tall.     * @param       x the <i>x</i> coordinate of the upper left     *                     corner of the oval to be drawn.     * @param       y the <i>y</i> coordinate of the upper left     *                     corner of the oval to be drawn.     * @param       width the width of the oval to be drawn.     * @param       height the height of the oval to be drawn.     * @see         java.awt.Graphics#fillOval     */    public void drawOval(int x, int y, int width, int height) {        g.drawOval(x, y, width, height);    }     /**     * Fills an oval bounded by the specified rectangle with the     * current color.     * @param       x the <i>x</i> coordinate of the upper left corner     *                     of the oval to be filled.     * @param       y the <i>y</i> coordinate of the upper left corner     *                     of the oval to be filled.     * @param       width the width of the oval to be filled.     * @param       height the height of the oval to be filled.     * @see         java.awt.Graphics#drawOval     */    public void fillOval(int x, int y, int width, int height) {        g.fillOval(x, y, width, height);    }     /**     * Draws the outline of a circular or elliptical arc     * covering the specified rectangle.     * <p>     * The resulting arc begins at <code>startAngle</code> and extends     * for <code>arcAngle</code> degrees, using the current color.     * Angles are interpreted such that 0&nbsp;degrees     * is at the 3&nbsp;o'clock position.     * A positive value indicates a counter-clockwise rotation     * while a negative value indicates a clockwise rotation.     * <p>     * The center of the arc is the center of the rectangle whose origin     * is (<i>x</i>,&nbsp;<i>y</i>) and whose size is specified by the     * <code>width</code> and <code>height</code> arguments.     * <p>     * The resulting arc covers an area     * <code>width&nbsp;+&nbsp;1</code> pixels wide     * by <code>height&nbsp;+&nbsp;1</code> pixels tall.     * <p>     * The angles are specified relative to the non-square extents of     * the bounding rectangle such that 45 degrees always falls on the     * line from the center of the ellipse to the upper right corner of     * the bounding rectangle. As a result, if the bounding rectangle is     * noticeably longer in one axis than the other, the angles to the     * start and end of the arc segment will be skewed farther along the     * longer axis of the bounds.     * @param        x the <i>x</i> coordinate of the     *                    upper-left corner of the arc to be drawn.     * @param        y the <i>y</i>  coordinate of the     *                    upper-left corner of the arc to be drawn.     * @param        width the width of the arc to be drawn.     * @param        height the height of the arc to be drawn.     * @param        startAngle the beginning angle.     * @param        arcAngle the angular extent of the arc,     *                    relative to the start angle.     * @see         java.awt.Graphics#fillArc     */    public void drawArc(int x, int y, int width, int height,                                 int startAngle, int arcAngle) {        g.drawArc(x, y, width, height, startAngle, arcAngle);    }     /**     * Fills a circular or elliptical arc covering the specified rectangle.     * <p>     * The resulting arc begins at <code>startAngle</code> and extends     * for <code>arcAngle</code> degrees.     * Angles are interpreted such that 0&nbsp;degrees     * is at the 3&nbsp;o'clock position.     * A positive value indicates a counter-clockwise rotation     * while a negative value indicates a clockwise rotation.     * <p>     * The center of the arc is the center of the rectangle whose origin     * is (<i>x</i>,&nbsp;<i>y</i>) and whose size is specified by the     * <code>width</code> and <code>height</code> arguments.     * <p>     * The resulting arc covers an area     * <code>width&nbsp;+&nbsp;1</code> pixels wide     * by <code>height&nbsp;+&nbsp;1</code> pixels tall.     * <p>     * The angles are specified relative to the non-square extents of     * the bounding rectangle such that 45 degrees always falls on the     * line from the center of the ellipse to the upper right corner of     * the bounding rectangle. As a result, if the bounding rectangle is     * noticeably longer in one axis than the other, the angles to the     * start and end of the arc segment will be skewed farther along the     * longer axis of the bounds.     * @param        x the <i>x</i> coordinate of the     *                    upper-left corner of the arc to be filled.     * @param        y the <i>y</i>  coordinate of the     *                    upper-left corner of the arc to be filled.     * @param        width the width of the arc to be filled.     * @param        height the height of the arc to be filled.     * @param        startAngle the beginning angle.     * @param        arcAngle the angular extent of the arc,     *                    relative to the start angle.     * @see         java.awt.Graphics#drawArc     */    public void fillArc(int x, int y, int width, int height,                                 int startAngle, int arcAngle) {         g.fillArc(x, y, width, height, startAngle, arcAngle);    }     /**     * Draws a sequence of connected lines defined by     * arrays of <i>x</i> and <i>y</i> coordinates.     * Each pair of (<i>x</i>,&nbsp;<i>y</i>) coordinates defines a point.     * The figure is not closed if the first point     * differs from the last point.     * @param       xPoints an array of <i>x</i> points     * @param       yPoints an array of <i>y</i> points     * @param       nPoints the total number of points     * @see         java.awt.Graphics#drawPolygon(int[], int[], int)     * @since       JDK1.1     */    public void drawPolyline(int xPoints[], int yPoints[],                                      int nPoints) {        g.drawPolyline(xPoints, yPoints, nPoints);    }     /**     * Draws a closed polygon defined by     * arrays of <i>x</i> and <i>y</i> coordinates.     * Each pair of (<i>x</i>,&nbsp;<i>y</i>) coordinates defines a point.     * <p>     * This method draws the polygon defined by <code>nPoint</code> line     * segments, where the first <code>nPoint&nbsp;-&nbsp;1</code>     * line segments are line segments from     * <code>(xPoints[i&nbsp;-&nbsp;1],&nbsp;yPoints[i&nbsp;-&nbsp;1])</code>     * to <code>(xPoints[i],&nbsp;yPoints[i])</code>, for     * 1&nbsp;&le;&nbsp;<i>i</i>&nbsp;&le;&nbsp;<code>nPoints</code>.     * The figure is automatically closed by drawing a line connecting     * the final point to the first point, if those points are different.     * @param        xPoints   a an array of <code>x</code> coordinates.     * @param        yPoints   a an array of <code>y</code> coordinates.     * @param        nPoints   a the total number of points.     * @see          java.awt.Graphics#fillPolygon     * @see          java.awt.Graphics#drawPolyline     */    public void drawPolygon(int xPoints[], int yPoints[],                                     int nPoints) {        g.drawPolygon(xPoints, yPoints, nPoints);    }     /**     * Draws the outline of a polygon defined by the specified     * <code>Polygon</code> object.     * @param        p the polygon to draw.     * @see          java.awt.Graphics#fillPolygon     * @see          java.awt.Graphics#drawPolyline     */    public void drawPolygon(Polygon p) {        g.drawPolygon(p);    }     /**     * Fills a closed polygon defined by     * arrays of <i>x</i> and <i>y</i> coordinates.     * <p>     * This method draws the polygon defined by <code>nPoint</code> line     * segments, where the first <code>nPoint&nbsp;-&nbsp;1</code>     * line segments are line segments from     * <code>(xPoints[i&nbsp;-&nbsp;1],&nbsp;yPoints[i&nbsp;-&nbsp;1])</code>     * to <code>(xPoints[i],&nbsp;yPoints[i])</code>, for     * 1&nbsp;&le;&nbsp;<i>i</i>&nbsp;&le;&nbsp;<code>nPoints</code>.     * The figure is automatically closed by drawing a line connecting     * the final point to the first point, if those points are different.     * <p>     * The area inside the polygon is defined using an     * even-odd fill rule, also known as the alternating rule.     * @param        xPoints   a an array of <code>x</code> coordinates.     * @param        yPoints   a an array of <code>y</code> coordinates.     * @param        nPoints   a the total number of points.     * @see          java.awt.Graphics#drawPolygon(int[], int[], int)     */    public void fillPolygon(int xPoints[], int yPoints[],                                     int nPoints) {        g.fillPolygon(xPoints, yPoints, nPoints);    }     /**     * Fills the polygon defined by the specified Polygon object with     * the graphics context's current color.     * <p>     * The area inside the polygon is defined using an     * even-odd fill rule, also known as the alternating rule.     * @param        p the polygon to fill.     * @see          java.awt.Graphics#drawPolygon(int[], int[], int)     */    public void fillPolygon(Polygon p) {        g.fillPolygon(p);    }     /**     * Draws the text given by the specified string, using this     * graphics context's current font and color. The baseline of the     * leftmost character is at position (<i>x</i>,&nbsp;<i>y</i>) in this     * graphics context's coordinate system.     * @param       str      the string to be drawn.     * @param       x        the <i>x</i> coordinate.     * @param       y        the <i>y</i> coordinate.     * @see         java.awt.Graphics#drawBytes     * @see         java.awt.Graphics#drawChars     */    public void drawString(String str, int x, int y) {        g.drawString(str, x, y);    }     /**     * Draws the text given by the specified iterator, using this     * graphics context's current color. The iterator has to specify a font     * for each character. The baseline of the     * leftmost character is at position (<i>x</i>,&nbsp;<i>y</i>) in this     * graphics context's coordinate system.     * @param       iterator the iterator whose text is to be drawn     * @param       x        the <i>x</i> coordinate.     * @param       y        the <i>y</i> coordinate.     * @see         java.awt.Graphics#drawBytes     * @see         java.awt.Graphics#drawChars     */   public void drawString(AttributedCharacterIterator iterator,                                    int x, int y) {        g.drawString(iterator, x, y);    }     /**     * Draws the text given by the specified character array, using this     * graphics context's current font and color. The baseline of the     * first character is at position (<i>x</i>,&nbsp;<i>y</i>) in this     * graphics context's coordinate system.     * @param data the array of characters to be drawn     * @param offset the start offset in the data     * @param length the number of characters to be drawn     * @param x the <i>x</i> coordinate of the baseline of the text     * @param y the <i>y</i> coordinate of the baseline of the text     * @see         java.awt.Graphics#drawBytes     * @see         java.awt.Graphics#drawString     */    public void drawChars(char data[], int offset, int length, int x, int y) {        g.drawChars(data, offset, length, x, y);    }     /**     * Draws the text given by the specified byte array, using this     * graphics context's current font and color. The baseline of the     * first character is at position (<i>x</i>,&nbsp;<i>y</i>) in this     * graphics context's coordinate system.     * @param data the data to be drawn     * @param offset the start offset in the data     * @param length the number of bytes that are drawn     * @param x the <i>x</i> coordinate of the baseline of the text     * @param y the <i>y</i> coordinate of the baseline of the text     * @see         java.awt.Graphics#drawChars     * @see         java.awt.Graphics#drawString     */    public void drawBytes(byte data[], int offset, int length, int x, int y) {        g.drawBytes(data, offset, length, x, y);    }     /**     * Draws as much of the specified image as is currently available.     * The image is drawn with its top-left corner at     * (<i>x</i>,&nbsp;<i>y</i>) in this graphics context's coordinate     * space. Transparent pixels in the image do not affect whatever     * pixels are already there.     * <p>     * This method returns immediately in all cases, even if the     * complete image has not yet been loaded, and it has not been dithered     * and converted for the current output device.     * <p>     * If the image has not yet been completely loaded, then     * <code>drawImage</code> returns <code>false</code>. As more of     * the image becomes available, the process that draws the image notifies     * the specified image observer.     * @param    img the specified image to be drawn.     * @param    x   the <i>x</i> coordinate.     * @param    y   the <i>y</i> coordinate.     * @param    observer    object to be notified as more of     *                          the image is converted.     * @see      java.awt.Image     * @see      java.awt.image.ImageObserver     * @see      java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int)     */    public boolean drawImage(Image img, int x, int y,                                      ImageObserver observer) {        return g.drawImage(img, x, y, observer);    }     /**     * Draws as much of the specified image as has already been scaled     * to fit inside the specified rectangle.     * <p>     * The image is drawn inside the specified rectangle of this     * graphics context's coordinate space, and is scaled if     * necessary. Transparent pixels do not affect whatever pixels     * are already there.     * <p>     * This method returns immediately in all cases, even if the     * entire image has not yet been scaled, dithered, and converted     * for the current output device.     * If the current output representation is not yet complete, then     * <code>drawImage</code> returns <code>false</code>. As more of     * the image becomes available, the process that draws the image notifies     * the image observer by calling its <code>imageUpdate</code> method.     * <p>     * A scaled version of an image will not necessarily be     * available immediately just because an unscaled version of the     * image has been constructed for this output device.  Each size of     * the image may be cached separately and generated from the original     * data in a separate image production sequence.     * @param    img    the specified image to be drawn.     * @param    x      the <i>x</i> coordinate.     * @param    y      the <i>y</i> coordinate.     * @param    width  the width of the rectangle.     * @param    height the height of the rectangle.     * @param    observer    object to be notified as more of     *                          the image is converted.     * @see      java.awt.Image     * @see      java.awt.image.ImageObserver     * @see      java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int)     */    public boolean drawImage(Image img, int x, int y,                                      int width, int height,                                      ImageObserver observer) {        return g.drawImage(img, x, y, width, height, observer);    }     /**     * Draws as much of the specified image as is currently available.     * The image is drawn with its top-left corner at     * (<i>x</i>,&nbsp;<i>y</i>) in this graphics context's coordinate     * space.  Transparent pixels are drawn in the specified     * background color.     * <p>     * This operation is equivalent to filling a rectangle of the     * width and height of the specified image with the given color and then     * drawing the image on top of it, but possibly more efficient.     * <p>     * This method returns immediately in all cases, even if the     * complete image has not yet been loaded, and it has not been dithered     * and converted for the current output device.     * <p>     * If the image has not yet been completely loaded, then     * <code>drawImage</code> returns <code>false</code>. As more of     * the image becomes available, the process that draws the image notifies     * the specified image observer.     * @param    img    the specified image to be drawn.     * @param    x      the <i>x</i> coordinate.     * @param    y      the <i>y</i> coordinate.     * @param    bgcolor the background color to paint under the     *                         non-opaque portions of the image.     * @param    observer    object to be notified as more of     *                          the image is converted.     * @see      java.awt.Image     * @see      java.awt.image.ImageObserver     * @see      java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int)     */    public boolean drawImage(Image img, int x, int y,                                      Color bgcolor,                                      ImageObserver observer) {        return g.drawImage(img, x, y, bgcolor, observer);    }     /**     * Draws as much of the specified image as has already been scaled     * to fit inside the specified rectangle.     * <p>     * The image is drawn inside the specified rectangle of this     * graphics context's coordinate space, and is scaled if     * necessary. Transparent pixels are drawn in the specified     * background color.     * This operation is equivalent to filling a rectangle of the     * width and height of the specified image with the given color and then     * drawing the image on top of it, but possibly more efficient.     * <p>     * This method returns immediately in all cases, even if the     * entire image has not yet been scaled, dithered, and converted     * for the current output device.     * If the current output representation is not yet complete then     * <code>drawImage</code> returns <code>false</code>. As more of     * the image becomes available, the process that draws the image notifies     * the specified image observer.     * <p>     * A scaled version of an image will not necessarily be     * available immediately just because an unscaled version of the     * image has been constructed for this output device.  Each size of     * the image may be cached separately and generated from the original     * data in a separate image production sequence.     * @param    img       the specified image to be drawn.     * @param    x         the <i>x</i> coordinate.     * @param    y         the <i>y</i> coordinate.     * @param    width     the width of the rectangle.     * @param    height    the height of the rectangle.     * @param    bgcolor   the background color to paint under the     *                         non-opaque portions of the image.     * @param    observer    object to be notified as more of     *                          the image is converted.     * @see      java.awt.Image     * @see      java.awt.image.ImageObserver     * @see      java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int)     */    public boolean drawImage(Image img, int x, int y,                                      int width, int height,                                      Color bgcolor,                                      ImageObserver observer) {         return g.drawImage(img, x, y, width, height, bgcolor, observer);    }     /**     * Draws as much of the specified area of the specified image as is     * currently available, scaling it on the fly to fit inside the     * specified area of the destination drawable surface. Transparent pixels     * do not affect whatever pixels are already there.     * <p>     * This method returns immediately in all cases, even if the     * image area to be drawn has not yet been scaled, dithered, and converted     * for the current output device.     * If the current output representation is not yet complete then     * <code>drawImage</code> returns <code>false</code>. As more of     * the image becomes available, the process that draws the image notifies     * the specified image observer.     * <p>     * This method always uses the unscaled version of the image     * to render the scaled rectangle and performs the required     * scaling on the fly. It does not use a cached, scaled version     * of the image for this operation. Scaling of the image from source     * to destination is performed such that the first coordinate     * of the source rectangle is mapped to the first coordinate of     * the destination rectangle, and the second source coordinate is     * mapped to the second destination coordinate. The subimage is     * scaled and flipped as needed to preserve those mappings.     * @param       img the specified image to be drawn     * @param       dx1 the <i>x</i> coordinate of the first corner of the     *                    destination rectangle.     * @param       dy1 the <i>y</i> coordinate of the first corner of the     *                    destination rectangle.     * @param       dx2 the <i>x</i> coordinate of the second corner of the     *                    destination rectangle.     * @param       dy2 the <i>y</i> coordinate of the second corner of the     *                    destination rectangle.     * @param       sx1 the <i>x</i> coordinate of the first corner of the     *                    source rectangle.     * @param       sy1 the <i>y</i> coordinate of the first corner of the     *                    source rectangle.     * @param       sx2 the <i>x</i> coordinate of the second corner of the     *                    source rectangle.     * @param       sy2 the <i>y</i> coordinate of the second corner of the     *                    source rectangle.     * @param       observer object to be notified as more of the image is     *                    scaled and converted.     * @see         java.awt.Image     * @see         java.awt.image.ImageObserver     * @see         java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int)     * @since       JDK1.1     */    public boolean drawImage(Image img,                                      int dx1, int dy1, int dx2, int dy2,                                      int sx1, int sy1, int sx2, int sy2,                                      ImageObserver observer) {         return g.drawImage(img, dx1, dy1, dx2, dy2,                                  sx1, sy1, sx2, sy2,                                  observer);

Lines 501–1000 of 1157. Previous lines