Path: blob/master/src/java.desktop/share/classes/sun/java2d/pipe/NullPipe.java
41159 views
/*1* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package sun.java2d.pipe;2627import java.awt.Color;28import java.awt.Image;29import java.awt.Shape;30import java.awt.geom.AffineTransform;31import java.awt.image.BufferedImage;32import java.awt.image.BufferedImageOp;33import java.awt.image.ImageObserver;34import java.awt.font.GlyphVector;35import sun.java2d.SunGraphics2D;3637/**38* This is a class that implements all of the basic pixel rendering39* methods as NOPs.40* This class is useful for installing as the pipeline when the41* clip is determined to be empty or when the composite operation is42* determined to have no effect (i.e. rule == SRC_OVER, extraAlpha == 0.0).43*/44public class NullPipe45implements PixelDrawPipe, PixelFillPipe, ShapeDrawPipe, TextPipe,46DrawImagePipe47{48public void drawLine(SunGraphics2D sg,49int x1, int y1, int x2, int y2) {50}5152public void drawRect(SunGraphics2D sg,53int x, int y, int width, int height) {54}5556public void fillRect(SunGraphics2D sg,57int x, int y, int width, int height) {58}5960public void drawRoundRect(SunGraphics2D sg,61int x, int y, int width, int height,62int arcWidth, int arcHeight) {63}6465public void fillRoundRect(SunGraphics2D sg,66int x, int y, int width, int height,67int arcWidth, int arcHeight) {68}6970public void drawOval(SunGraphics2D sg,71int x, int y, int width, int height) {72}7374public void fillOval(SunGraphics2D sg,75int x, int y, int width, int height) {76}7778public void drawArc(SunGraphics2D sg,79int x, int y, int width, int height,80int startAngle, int arcAngle) {81}8283public void fillArc(SunGraphics2D sg,84int x, int y, int width, int height,85int startAngle, int arcAngle) {86}8788public void drawPolyline(SunGraphics2D sg,89int[] xPoints, int[] yPoints,90int nPoints) {91}9293public void drawPolygon(SunGraphics2D sg,94int[] xPoints, int[] yPoints,95int nPoints) {96}9798public void fillPolygon(SunGraphics2D sg,99int[] xPoints, int[] yPoints,100int nPoints) {101}102103public void draw(SunGraphics2D sg, Shape s) {104}105106public void fill(SunGraphics2D sg, Shape s) {107}108109public void drawString(SunGraphics2D sg, String s, double x, double y) {110}111112public void drawGlyphVector(SunGraphics2D sg, GlyphVector g,113float x, float y) {114}115116public void drawChars(SunGraphics2D sg,117char[] data, int offset, int length,118int x, int y) {119}120121public boolean copyImage(SunGraphics2D sg, Image img,122int x, int y,123Color bgColor,124ImageObserver observer) {125return false;126}127public boolean copyImage(SunGraphics2D sg, Image img,128int dx, int dy, int sx, int sy, int w, int h,129Color bgColor,130ImageObserver observer) {131return false;132}133public boolean scaleImage(SunGraphics2D sg, Image img, int x, int y,134int w, int h,135Color bgColor,136ImageObserver observer) {137return false;138}139public boolean scaleImage(SunGraphics2D sg, Image img,140int dx1, int dy1, int dx2, int dy2,141int sx1, int sy1, int sx2, int sy2,142Color bgColor,143ImageObserver observer) {144return false;145}146public boolean transformImage(SunGraphics2D sg, Image img,147AffineTransform atfm,148ImageObserver observer) {149return false;150}151public void transformImage(SunGraphics2D sg, BufferedImage img,152BufferedImageOp op, int x, int y) {153}154}155156157