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
23 * questions.
24 */
25
26package sun.java2d.pipe;
27
28import java.awt.Color;
29import java.awt.Image;
30import java.awt.Shape;
31import java.awt.geom.AffineTransform;
32import java.awt.image.BufferedImage;
33import java.awt.image.BufferedImageOp;
34import java.awt.image.ImageObserver;
35import java.awt.font.GlyphVector;
36import sun.java2d.SunGraphics2D;
37
38/**
39 * This is a class that implements all of the basic pixel rendering
40 * methods as NOPs.
41 * This class is useful for installing as the pipeline when the
42 * clip is determined to be empty or when the composite operation is
43 * determined to have no effect (i.e. rule == SRC_OVER, extraAlpha == 0.0).
44 */
45public class NullPipe
46    implements PixelDrawPipe, PixelFillPipe, ShapeDrawPipe, TextPipe,
47    DrawImagePipe
48{
49    public void drawLine(SunGraphics2D sg,
50                         int x1, int y1, int x2, int y2) {
51    }
52
53    public void drawRect(SunGraphics2D sg,
54                         int x, int y, int width, int height) {
55    }
56
57    public void fillRect(SunGraphics2D sg,
58                         int x, int y, int width, int height) {
59    }
60
61    public void drawRoundRect(SunGraphics2D sg,
62                              int x, int y, int width, int height,
63                              int arcWidth, int arcHeight) {
64    }
65
66    public void fillRoundRect(SunGraphics2D sg,
67                              int x, int y, int width, int height,
68                              int arcWidth, int arcHeight) {
69    }
70
71    public void drawOval(SunGraphics2D sg,
72                         int x, int y, int width, int height) {
73    }
74
75    public void fillOval(SunGraphics2D sg,
76                         int x, int y, int width, int height) {
77    }
78
79    public void drawArc(SunGraphics2D sg,
80                        int x, int y, int width, int height,
81                        int startAngle, int arcAngle) {
82    }
83
84    public void fillArc(SunGraphics2D sg,
85                        int x, int y, int width, int height,
86                        int startAngle, int arcAngle) {
87    }
88
89    public void drawPolyline(SunGraphics2D sg,
90                             int xPoints[], int yPoints[],
91                             int nPoints) {
92    }
93
94    public void drawPolygon(SunGraphics2D sg,
95                            int xPoints[], int yPoints[],
96                            int nPoints) {
97    }
98
99    public void fillPolygon(SunGraphics2D sg,
100                            int xPoints[], int yPoints[],
101                            int nPoints) {
102    }
103
104    public void draw(SunGraphics2D sg, Shape s) {
105    }
106
107    public void fill(SunGraphics2D sg, Shape s) {
108    }
109
110    public void drawString(SunGraphics2D sg, String s, double x, double y) {
111    }
112
113    public void drawGlyphVector(SunGraphics2D sg, GlyphVector g,
114                                float x, float y) {
115    }
116
117    public void drawChars(SunGraphics2D sg,
118                                char data[], int offset, int length,
119                                int x, int y) {
120    }
121
122    public boolean copyImage(SunGraphics2D sg, Image img,
123                             int x, int y,
124                             Color bgColor,
125                             ImageObserver observer) {
126        return false;
127    }
128    public boolean copyImage(SunGraphics2D sg, Image img,
129                             int dx, int dy, int sx, int sy, int w, int h,
130                             Color bgColor,
131                             ImageObserver observer) {
132        return false;
133    }
134    public boolean scaleImage(SunGraphics2D sg, Image img, int x, int y,
135                              int w, int h,
136                              Color bgColor,
137                              ImageObserver observer) {
138        return false;
139    }
140    public boolean scaleImage(SunGraphics2D sg, Image img,
141                              int dx1, int dy1, int dx2, int dy2,
142                              int sx1, int sy1, int sx2, int sy2,
143                              Color bgColor,
144                              ImageObserver observer) {
145        return false;
146    }
147    public boolean transformImage(SunGraphics2D sg, Image img,
148                                  AffineTransform atfm,
149                                  ImageObserver observer) {
150        return false;
151    }
152    public void transformImage(SunGraphics2D sg, BufferedImage img,
153                               BufferedImageOp op, int x, int y) {
154    }
155}
156