< prev index next >

src/java.desktop/share/classes/sun/print/ProxyGraphics2D.java

Print this page


   1 /*
   2  * Copyright (c) 1998, 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


 645      * @see         java.awt.Graphics#drawArc
 646      * @since       1.0
 647      */
 648     public void fillArc(int x, int y, int width, int height,
 649                         int startAngle, int arcAngle) {
 650         mGraphics.fillArc(x, y, width, height, startAngle, arcAngle);
 651     }
 652 
 653     /**
 654      * Draws a sequence of connected lines defined by
 655      * arrays of <i>x</i> and <i>y</i> coordinates.
 656      * Each pair of (<i>x</i>,&nbsp;<i>y</i>) coordinates defines a point.
 657      * The figure is not closed if the first point
 658      * differs from the last point.
 659      * @param       xPoints an array of <i>x</i> points
 660      * @param       yPoints an array of <i>y</i> points
 661      * @param       nPoints the total number of points
 662      * @see         java.awt.Graphics#drawPolygon(int[], int[], int)
 663      * @since       1.1
 664      */
 665     public void drawPolyline(int xPoints[], int yPoints[],
 666                              int nPoints) {
 667         mGraphics.drawPolyline(xPoints, yPoints, nPoints);
 668     }
 669 
 670     /**
 671      * Draws a closed polygon defined by
 672      * arrays of <i>x</i> and <i>y</i> coordinates.
 673      * Each pair of (<i>x</i>,&nbsp;<i>y</i>) coordinates defines a point.
 674      * <p>
 675      * This method draws the polygon defined by {@code nPoint} line
 676      * segments, where the first <code>nPoint&nbsp;-&nbsp;1</code>
 677      * line segments are line segments from
 678      * <code>(xPoints[i&nbsp;-&nbsp;1],&nbsp;yPoints[i&nbsp;-&nbsp;1])</code>
 679      * to <code>(xPoints[i],&nbsp;yPoints[i])</code>, for
 680      * 1&nbsp;&le;&nbsp;<i>i</i>&nbsp;&le;&nbsp;{@code nPoints}.
 681      * The figure is automatically closed by drawing a line connecting
 682      * the final point to the first point, if those points are different.
 683      * @param        xPoints   a an array of {@code x} coordinates.
 684      * @param        yPoints   a an array of {@code y} coordinates.
 685      * @param        nPoints   a the total number of points.
 686      * @see          java.awt.Graphics#fillPolygon
 687      * @see          java.awt.Graphics#drawPolyline
 688      * @since        1.0
 689      */
 690     public void drawPolygon(int xPoints[], int yPoints[],
 691                             int nPoints) {
 692         mGraphics.drawPolygon(xPoints, yPoints, nPoints);
 693     }
 694 
 695     /**
 696      * Fills a closed polygon defined by
 697      * arrays of <i>x</i> and <i>y</i> coordinates.
 698      * <p>
 699      * This method draws the polygon defined by {@code nPoint} line
 700      * segments, where the first <code>nPoint&nbsp;-&nbsp;1</code>
 701      * line segments are line segments from
 702      * <code>(xPoints[i&nbsp;-&nbsp;1],&nbsp;yPoints[i&nbsp;-&nbsp;1])</code>
 703      * to <code>(xPoints[i],&nbsp;yPoints[i])</code>, for
 704      * 1&nbsp;&le;&nbsp;<i>i</i>&nbsp;&le;&nbsp;{@code nPoints}.
 705      * The figure is automatically closed by drawing a line connecting
 706      * the final point to the first point, if those points are different.
 707      * <p>
 708      * The area inside the polygon is defined using an
 709      * even-odd fill rule, also known as the alternating rule.
 710      * @param        xPoints   a an array of {@code x} coordinates.
 711      * @param        yPoints   a an array of {@code y} coordinates.
 712      * @param        nPoints   a the total number of points.
 713      * @see          java.awt.Graphics#drawPolygon(int[], int[], int)
 714      * @since        1.0
 715      */
 716     public void fillPolygon(int xPoints[], int yPoints[],
 717                             int nPoints) {
 718         mGraphics.fillPolygon(xPoints, yPoints, nPoints);
 719     }
 720 
 721     /**
 722      * Draws the text given by the specified string, using this
 723      * graphics context's current font and color. The baseline of the
 724      * first character is at position (<i>x</i>,&nbsp;<i>y</i>) in this
 725      * graphics context's coordinate system.
 726      * @param       str      the string to be drawn.
 727      * @param       x        the <i>x</i> coordinate.
 728      * @param       y        the <i>y</i> coordinate.
 729      * @see         java.awt.Graphics#drawBytes
 730      * @see         java.awt.Graphics#drawChars
 731      * @since       1.0
 732      */
 733     public void drawString(String str, int x, int y) {
 734         mGraphics.drawString(str, x, y);
 735     }
 736 


   1 /*
   2  * Copyright (c) 1998, 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


 645      * @see         java.awt.Graphics#drawArc
 646      * @since       1.0
 647      */
 648     public void fillArc(int x, int y, int width, int height,
 649                         int startAngle, int arcAngle) {
 650         mGraphics.fillArc(x, y, width, height, startAngle, arcAngle);
 651     }
 652 
 653     /**
 654      * Draws a sequence of connected lines defined by
 655      * arrays of <i>x</i> and <i>y</i> coordinates.
 656      * Each pair of (<i>x</i>,&nbsp;<i>y</i>) coordinates defines a point.
 657      * The figure is not closed if the first point
 658      * differs from the last point.
 659      * @param       xPoints an array of <i>x</i> points
 660      * @param       yPoints an array of <i>y</i> points
 661      * @param       nPoints the total number of points
 662      * @see         java.awt.Graphics#drawPolygon(int[], int[], int)
 663      * @since       1.1
 664      */
 665     public void drawPolyline(int[] xPoints, int[] yPoints,
 666                              int nPoints) {
 667         mGraphics.drawPolyline(xPoints, yPoints, nPoints);
 668     }
 669 
 670     /**
 671      * Draws a closed polygon defined by
 672      * arrays of <i>x</i> and <i>y</i> coordinates.
 673      * Each pair of (<i>x</i>,&nbsp;<i>y</i>) coordinates defines a point.
 674      * <p>
 675      * This method draws the polygon defined by {@code nPoint} line
 676      * segments, where the first <code>nPoint&nbsp;-&nbsp;1</code>
 677      * line segments are line segments from
 678      * <code>(xPoints[i&nbsp;-&nbsp;1],&nbsp;yPoints[i&nbsp;-&nbsp;1])</code>
 679      * to <code>(xPoints[i],&nbsp;yPoints[i])</code>, for
 680      * 1&nbsp;&le;&nbsp;<i>i</i>&nbsp;&le;&nbsp;{@code nPoints}.
 681      * The figure is automatically closed by drawing a line connecting
 682      * the final point to the first point, if those points are different.
 683      * @param        xPoints   a an array of {@code x} coordinates.
 684      * @param        yPoints   a an array of {@code y} coordinates.
 685      * @param        nPoints   a the total number of points.
 686      * @see          java.awt.Graphics#fillPolygon
 687      * @see          java.awt.Graphics#drawPolyline
 688      * @since        1.0
 689      */
 690     public void drawPolygon(int[] xPoints, int[] yPoints,
 691                             int nPoints) {
 692         mGraphics.drawPolygon(xPoints, yPoints, nPoints);
 693     }
 694 
 695     /**
 696      * Fills a closed polygon defined by
 697      * arrays of <i>x</i> and <i>y</i> coordinates.
 698      * <p>
 699      * This method draws the polygon defined by {@code nPoint} line
 700      * segments, where the first <code>nPoint&nbsp;-&nbsp;1</code>
 701      * line segments are line segments from
 702      * <code>(xPoints[i&nbsp;-&nbsp;1],&nbsp;yPoints[i&nbsp;-&nbsp;1])</code>
 703      * to <code>(xPoints[i],&nbsp;yPoints[i])</code>, for
 704      * 1&nbsp;&le;&nbsp;<i>i</i>&nbsp;&le;&nbsp;{@code nPoints}.
 705      * The figure is automatically closed by drawing a line connecting
 706      * the final point to the first point, if those points are different.
 707      * <p>
 708      * The area inside the polygon is defined using an
 709      * even-odd fill rule, also known as the alternating rule.
 710      * @param        xPoints   a an array of {@code x} coordinates.
 711      * @param        yPoints   a an array of {@code y} coordinates.
 712      * @param        nPoints   a the total number of points.
 713      * @see          java.awt.Graphics#drawPolygon(int[], int[], int)
 714      * @since        1.0
 715      */
 716     public void fillPolygon(int[] xPoints, int[] yPoints,
 717                             int nPoints) {
 718         mGraphics.fillPolygon(xPoints, yPoints, nPoints);
 719     }
 720 
 721     /**
 722      * Draws the text given by the specified string, using this
 723      * graphics context's current font and color. The baseline of the
 724      * first character is at position (<i>x</i>,&nbsp;<i>y</i>) in this
 725      * graphics context's coordinate system.
 726      * @param       str      the string to be drawn.
 727      * @param       x        the <i>x</i> coordinate.
 728      * @param       y        the <i>y</i> coordinate.
 729      * @see         java.awt.Graphics#drawBytes
 730      * @see         java.awt.Graphics#drawChars
 731      * @since       1.0
 732      */
 733     public void drawString(String str, int x, int y) {
 734         mGraphics.drawString(str, x, y);
 735     }
 736 


< prev index next >