1 /*
2 * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
632 * @see java.awt.Graphics#drawArc
633 */
634 public void fillArc(int x, int y, int width, int height,
635 int startAngle, int arcAngle) {
636
637 g.fillArc(x, y, width, height, startAngle, arcAngle);
638 }
639
640 /**
641 * Draws a sequence of connected lines defined by
642 * arrays of <i>x</i> and <i>y</i> coordinates.
643 * Each pair of (<i>x</i>, <i>y</i>) coordinates defines a point.
644 * The figure is not closed if the first point
645 * differs from the last point.
646 * @param xPoints an array of <i>x</i> points
647 * @param yPoints an array of <i>y</i> points
648 * @param nPoints the total number of points
649 * @see java.awt.Graphics#drawPolygon(int[], int[], int)
650 * @since 1.1
651 */
652 public void drawPolyline(int xPoints[], int yPoints[],
653 int nPoints) {
654 g.drawPolyline(xPoints, yPoints, nPoints);
655 }
656
657 /**
658 * Draws a closed polygon defined by
659 * arrays of <i>x</i> and <i>y</i> coordinates.
660 * Each pair of (<i>x</i>, <i>y</i>) coordinates defines a point.
661 * <p>
662 * This method draws the polygon defined by {@code nPoint} line
663 * segments, where the first <code>nPoint - 1</code>
664 * line segments are line segments from
665 * <code>(xPoints[i - 1], yPoints[i - 1])</code>
666 * to <code>(xPoints[i], yPoints[i])</code>, for
667 * 1 ≤ <i>i</i> ≤ {@code nPoints}.
668 * The figure is automatically closed by drawing a line connecting
669 * the final point to the first point, if those points are different.
670 * @param xPoints a an array of {@code x} coordinates.
671 * @param yPoints a an array of {@code y} coordinates.
672 * @param nPoints a the total number of points.
673 * @see java.awt.Graphics#fillPolygon
674 * @see java.awt.Graphics#drawPolyline
675 */
676 public void drawPolygon(int xPoints[], int yPoints[],
677 int nPoints) {
678 g.drawPolygon(xPoints, yPoints, nPoints);
679 }
680
681 /**
682 * Draws the outline of a polygon defined by the specified
683 * {@code Polygon} object.
684 * @param p the polygon to draw.
685 * @see java.awt.Graphics#fillPolygon
686 * @see java.awt.Graphics#drawPolyline
687 */
688 public void drawPolygon(Polygon p) {
689 g.drawPolygon(p);
690 }
691
692 /**
693 * Fills a closed polygon defined by
694 * arrays of <i>x</i> and <i>y</i> coordinates.
695 * <p>
696 * This method draws the polygon defined by {@code nPoint} line
697 * segments, where the first <code>nPoint - 1</code>
698 * line segments are line segments from
699 * <code>(xPoints[i - 1], yPoints[i - 1])</code>
700 * to <code>(xPoints[i], yPoints[i])</code>, for
701 * 1 ≤ <i>i</i> ≤ {@code nPoints}.
702 * The figure is automatically closed by drawing a line connecting
703 * the final point to the first point, if those points are different.
704 * <p>
705 * The area inside the polygon is defined using an
706 * even-odd fill rule, also known as the alternating rule.
707 * @param xPoints a an array of {@code x} coordinates.
708 * @param yPoints a an array of {@code y} coordinates.
709 * @param nPoints a the total number of points.
710 * @see java.awt.Graphics#drawPolygon(int[], int[], int)
711 */
712 public void fillPolygon(int xPoints[], int yPoints[],
713 int nPoints) {
714 g.fillPolygon(xPoints, yPoints, nPoints);
715 }
716
717 /**
718 * Fills the polygon defined by the specified Polygon object with
719 * the graphics context's current color.
720 * <p>
721 * The area inside the polygon is defined using an
722 * even-odd fill rule, also known as the alternating rule.
723 * @param p the polygon to fill.
724 * @see java.awt.Graphics#drawPolygon(int[], int[], int)
725 */
726 public void fillPolygon(Polygon p) {
727 g.fillPolygon(p);
728 }
729
730 /**
731 * Draws the text given by the specified string, using this
732 * graphics context's current font and color. The baseline of the
755 * @see java.awt.Graphics#drawChars
756 */
757 public void drawString(AttributedCharacterIterator iterator,
758 int x, int y) {
759 g.drawString(iterator, x, y);
760 }
761
762 /**
763 * Draws the text given by the specified character array, using this
764 * graphics context's current font and color. The baseline of the
765 * first character is at position (<i>x</i>, <i>y</i>) in this
766 * graphics context's coordinate system.
767 * @param data the array of characters to be drawn
768 * @param offset the start offset in the data
769 * @param length the number of characters to be drawn
770 * @param x the <i>x</i> coordinate of the baseline of the text
771 * @param y the <i>y</i> coordinate of the baseline of the text
772 * @see java.awt.Graphics#drawBytes
773 * @see java.awt.Graphics#drawString
774 */
775 public void drawChars(char data[], int offset, int length, int x, int y) {
776 g.drawChars(data, offset, length, x, y);
777 }
778
779 /**
780 * Draws the text given by the specified byte array, using this
781 * graphics context's current font and color. The baseline of the
782 * first character is at position (<i>x</i>, <i>y</i>) in this
783 * graphics context's coordinate system.
784 * @param data the data to be drawn
785 * @param offset the start offset in the data
786 * @param length the number of bytes that are drawn
787 * @param x the <i>x</i> coordinate of the baseline of the text
788 * @param y the <i>y</i> coordinate of the baseline of the text
789 * @see java.awt.Graphics#drawChars
790 * @see java.awt.Graphics#drawString
791 */
792 public void drawBytes(byte data[], int offset, int length, int x, int y) {
793 g.drawBytes(data, offset, length, x, y);
794 }
795
796 /**
797 * Draws as much of the specified image as is currently available.
798 * The image is drawn with its top-left corner at
799 * (<i>x</i>, <i>y</i>) in this graphics context's coordinate
800 * space. Transparent pixels in the image do not affect whatever
801 * pixels are already there.
802 * <p>
803 * This method returns immediately in all cases, even if the
804 * complete image has not yet been loaded, and it has not been dithered
805 * and converted for the current output device.
806 * <p>
807 * If the image has not yet been completely loaded, then
808 * {@code drawImage} returns {@code false}. As more of
809 * the image becomes available, the process that draws the image notifies
810 * the specified image observer.
811 * @param img the specified image to be drawn.
812 * @param x the <i>x</i> coordinate.
|
1 /*
2 * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
632 * @see java.awt.Graphics#drawArc
633 */
634 public void fillArc(int x, int y, int width, int height,
635 int startAngle, int arcAngle) {
636
637 g.fillArc(x, y, width, height, startAngle, arcAngle);
638 }
639
640 /**
641 * Draws a sequence of connected lines defined by
642 * arrays of <i>x</i> and <i>y</i> coordinates.
643 * Each pair of (<i>x</i>, <i>y</i>) coordinates defines a point.
644 * The figure is not closed if the first point
645 * differs from the last point.
646 * @param xPoints an array of <i>x</i> points
647 * @param yPoints an array of <i>y</i> points
648 * @param nPoints the total number of points
649 * @see java.awt.Graphics#drawPolygon(int[], int[], int)
650 * @since 1.1
651 */
652 public void drawPolyline(int[] xPoints, int[] yPoints,
653 int nPoints) {
654 g.drawPolyline(xPoints, yPoints, nPoints);
655 }
656
657 /**
658 * Draws a closed polygon defined by
659 * arrays of <i>x</i> and <i>y</i> coordinates.
660 * Each pair of (<i>x</i>, <i>y</i>) coordinates defines a point.
661 * <p>
662 * This method draws the polygon defined by {@code nPoint} line
663 * segments, where the first <code>nPoint - 1</code>
664 * line segments are line segments from
665 * <code>(xPoints[i - 1], yPoints[i - 1])</code>
666 * to <code>(xPoints[i], yPoints[i])</code>, for
667 * 1 ≤ <i>i</i> ≤ {@code nPoints}.
668 * The figure is automatically closed by drawing a line connecting
669 * the final point to the first point, if those points are different.
670 * @param xPoints a an array of {@code x} coordinates.
671 * @param yPoints a an array of {@code y} coordinates.
672 * @param nPoints a the total number of points.
673 * @see java.awt.Graphics#fillPolygon
674 * @see java.awt.Graphics#drawPolyline
675 */
676 public void drawPolygon(int[] xPoints, int[] yPoints,
677 int nPoints) {
678 g.drawPolygon(xPoints, yPoints, nPoints);
679 }
680
681 /**
682 * Draws the outline of a polygon defined by the specified
683 * {@code Polygon} object.
684 * @param p the polygon to draw.
685 * @see java.awt.Graphics#fillPolygon
686 * @see java.awt.Graphics#drawPolyline
687 */
688 public void drawPolygon(Polygon p) {
689 g.drawPolygon(p);
690 }
691
692 /**
693 * Fills a closed polygon defined by
694 * arrays of <i>x</i> and <i>y</i> coordinates.
695 * <p>
696 * This method draws the polygon defined by {@code nPoint} line
697 * segments, where the first <code>nPoint - 1</code>
698 * line segments are line segments from
699 * <code>(xPoints[i - 1], yPoints[i - 1])</code>
700 * to <code>(xPoints[i], yPoints[i])</code>, for
701 * 1 ≤ <i>i</i> ≤ {@code nPoints}.
702 * The figure is automatically closed by drawing a line connecting
703 * the final point to the first point, if those points are different.
704 * <p>
705 * The area inside the polygon is defined using an
706 * even-odd fill rule, also known as the alternating rule.
707 * @param xPoints a an array of {@code x} coordinates.
708 * @param yPoints a an array of {@code y} coordinates.
709 * @param nPoints a the total number of points.
710 * @see java.awt.Graphics#drawPolygon(int[], int[], int)
711 */
712 public void fillPolygon(int[] xPoints, int[] yPoints,
713 int nPoints) {
714 g.fillPolygon(xPoints, yPoints, nPoints);
715 }
716
717 /**
718 * Fills the polygon defined by the specified Polygon object with
719 * the graphics context's current color.
720 * <p>
721 * The area inside the polygon is defined using an
722 * even-odd fill rule, also known as the alternating rule.
723 * @param p the polygon to fill.
724 * @see java.awt.Graphics#drawPolygon(int[], int[], int)
725 */
726 public void fillPolygon(Polygon p) {
727 g.fillPolygon(p);
728 }
729
730 /**
731 * Draws the text given by the specified string, using this
732 * graphics context's current font and color. The baseline of the
755 * @see java.awt.Graphics#drawChars
756 */
757 public void drawString(AttributedCharacterIterator iterator,
758 int x, int y) {
759 g.drawString(iterator, x, y);
760 }
761
762 /**
763 * Draws the text given by the specified character array, using this
764 * graphics context's current font and color. The baseline of the
765 * first character is at position (<i>x</i>, <i>y</i>) in this
766 * graphics context's coordinate system.
767 * @param data the array of characters to be drawn
768 * @param offset the start offset in the data
769 * @param length the number of characters to be drawn
770 * @param x the <i>x</i> coordinate of the baseline of the text
771 * @param y the <i>y</i> coordinate of the baseline of the text
772 * @see java.awt.Graphics#drawBytes
773 * @see java.awt.Graphics#drawString
774 */
775 public void drawChars(char[] data, int offset, int length, int x, int y) {
776 g.drawChars(data, offset, length, x, y);
777 }
778
779 /**
780 * Draws the text given by the specified byte array, using this
781 * graphics context's current font and color. The baseline of the
782 * first character is at position (<i>x</i>, <i>y</i>) in this
783 * graphics context's coordinate system.
784 * @param data the data to be drawn
785 * @param offset the start offset in the data
786 * @param length the number of bytes that are drawn
787 * @param x the <i>x</i> coordinate of the baseline of the text
788 * @param y the <i>y</i> coordinate of the baseline of the text
789 * @see java.awt.Graphics#drawChars
790 * @see java.awt.Graphics#drawString
791 */
792 public void drawBytes(byte[] data, int offset, int length, int x, int y) {
793 g.drawBytes(data, offset, length, x, y);
794 }
795
796 /**
797 * Draws as much of the specified image as is currently available.
798 * The image is drawn with its top-left corner at
799 * (<i>x</i>, <i>y</i>) in this graphics context's coordinate
800 * space. Transparent pixels in the image do not affect whatever
801 * pixels are already there.
802 * <p>
803 * This method returns immediately in all cases, even if the
804 * complete image has not yet been loaded, and it has not been dithered
805 * and converted for the current output device.
806 * <p>
807 * If the image has not yet been completely loaded, then
808 * {@code drawImage} returns {@code false}. As more of
809 * the image becomes available, the process that draws the image notifies
810 * the specified image observer.
811 * @param img the specified image to be drawn.
812 * @param x the <i>x</i> coordinate.
|