< prev index next >

src/java.desktop/share/classes/sun/java2d/pipe/ValidatePipe.java

Print this page


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


 109         }
 110     }
 111 
 112     public void drawArc(SunGraphics2D sg,
 113                         int x, int y, int width, int height,
 114                         int startAngle, int arcAngle) {
 115         if (validate(sg)) {
 116             sg.drawpipe.drawArc(sg, x, y, width, height, startAngle, arcAngle);
 117         }
 118     }
 119 
 120     public void fillArc(SunGraphics2D sg,
 121                         int x, int y, int width, int height,
 122                         int startAngle, int arcAngle) {
 123         if (validate(sg)) {
 124             sg.fillpipe.fillArc(sg, x, y, width, height, startAngle, arcAngle);
 125         }
 126     }
 127 
 128     public void drawPolyline(SunGraphics2D sg,
 129                              int xPoints[], int yPoints[],
 130                              int nPoints) {
 131         if (validate(sg)) {
 132             sg.drawpipe.drawPolyline(sg, xPoints, yPoints, nPoints);
 133         }
 134     }
 135 
 136     public void drawPolygon(SunGraphics2D sg,
 137                             int xPoints[], int yPoints[],
 138                             int nPoints) {
 139         if (validate(sg)) {
 140             sg.drawpipe.drawPolygon(sg, xPoints, yPoints, nPoints);
 141         }
 142     }
 143 
 144     public void fillPolygon(SunGraphics2D sg,
 145                             int xPoints[], int yPoints[],
 146                             int nPoints) {
 147         if (validate(sg)) {
 148             sg.fillpipe.fillPolygon(sg, xPoints, yPoints, nPoints);
 149         }
 150     }
 151 
 152     public void draw(SunGraphics2D sg, Shape s) {
 153         if (validate(sg)) {
 154             sg.shapepipe.draw(sg, s);
 155         }
 156     }
 157 
 158     public void fill(SunGraphics2D sg, Shape s) {
 159         if (validate(sg)) {
 160             sg.shapepipe.fill(sg, s);
 161         }
 162     }
 163     public void drawString(SunGraphics2D sg, String s, double x, double y) {
 164         if (validate(sg)) {
 165             sg.textpipe.drawString(sg, s, x, y);
 166         }
 167     }
 168     public void drawGlyphVector(SunGraphics2D sg, GlyphVector g,
 169                                 float x, float y) {
 170         if (validate(sg)) {
 171             sg.textpipe.drawGlyphVector(sg, g, x, y);
 172         }
 173     }
 174     public void drawChars(SunGraphics2D sg,
 175                                 char data[], int offset, int length,
 176                                 int x, int y) {
 177         if (validate(sg)) {
 178             sg.textpipe.drawChars(sg, data, offset, length, x, y);
 179         }
 180     }
 181     public boolean copyImage(SunGraphics2D sg, Image img,
 182                              int x, int y,
 183                              Color bgColor,
 184                              ImageObserver observer) {
 185         if (validate(sg)) {
 186             return sg.imagepipe.copyImage(sg, img, x, y, bgColor, observer);
 187         } else {
 188             return false;
 189         }
 190     }
 191     public boolean copyImage(SunGraphics2D sg, Image img,
 192                              int dx, int dy, int sx, int sy, int w, int h,
 193                              Color bgColor,
 194                              ImageObserver observer) {
 195         if (validate(sg)) {


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


 109         }
 110     }
 111 
 112     public void drawArc(SunGraphics2D sg,
 113                         int x, int y, int width, int height,
 114                         int startAngle, int arcAngle) {
 115         if (validate(sg)) {
 116             sg.drawpipe.drawArc(sg, x, y, width, height, startAngle, arcAngle);
 117         }
 118     }
 119 
 120     public void fillArc(SunGraphics2D sg,
 121                         int x, int y, int width, int height,
 122                         int startAngle, int arcAngle) {
 123         if (validate(sg)) {
 124             sg.fillpipe.fillArc(sg, x, y, width, height, startAngle, arcAngle);
 125         }
 126     }
 127 
 128     public void drawPolyline(SunGraphics2D sg,
 129                              int[] xPoints, int[] yPoints,
 130                              int nPoints) {
 131         if (validate(sg)) {
 132             sg.drawpipe.drawPolyline(sg, xPoints, yPoints, nPoints);
 133         }
 134     }
 135 
 136     public void drawPolygon(SunGraphics2D sg,
 137                             int[] xPoints, int[] yPoints,
 138                             int nPoints) {
 139         if (validate(sg)) {
 140             sg.drawpipe.drawPolygon(sg, xPoints, yPoints, nPoints);
 141         }
 142     }
 143 
 144     public void fillPolygon(SunGraphics2D sg,
 145                             int[] xPoints, int[] yPoints,
 146                             int nPoints) {
 147         if (validate(sg)) {
 148             sg.fillpipe.fillPolygon(sg, xPoints, yPoints, nPoints);
 149         }
 150     }
 151 
 152     public void draw(SunGraphics2D sg, Shape s) {
 153         if (validate(sg)) {
 154             sg.shapepipe.draw(sg, s);
 155         }
 156     }
 157 
 158     public void fill(SunGraphics2D sg, Shape s) {
 159         if (validate(sg)) {
 160             sg.shapepipe.fill(sg, s);
 161         }
 162     }
 163     public void drawString(SunGraphics2D sg, String s, double x, double y) {
 164         if (validate(sg)) {
 165             sg.textpipe.drawString(sg, s, x, y);
 166         }
 167     }
 168     public void drawGlyphVector(SunGraphics2D sg, GlyphVector g,
 169                                 float x, float y) {
 170         if (validate(sg)) {
 171             sg.textpipe.drawGlyphVector(sg, g, x, y);
 172         }
 173     }
 174     public void drawChars(SunGraphics2D sg,
 175                                 char[] data, int offset, int length,
 176                                 int x, int y) {
 177         if (validate(sg)) {
 178             sg.textpipe.drawChars(sg, data, offset, length, x, y);
 179         }
 180     }
 181     public boolean copyImage(SunGraphics2D sg, Image img,
 182                              int x, int y,
 183                              Color bgColor,
 184                              ImageObserver observer) {
 185         if (validate(sg)) {
 186             return sg.imagepipe.copyImage(sg, img, x, y, bgColor, observer);
 187         } else {
 188             return false;
 189         }
 190     }
 191     public boolean copyImage(SunGraphics2D sg, Image img,
 192                              int dx, int dy, int sx, int sy, int w, int h,
 193                              Color bgColor,
 194                              ImageObserver observer) {
 195         if (validate(sg)) {


< prev index next >