Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / libjava / classpath / gnu / java / awt / peer / qt / QtImageDirectGraphics.java
blob5a6f3189a7ae910a0901c542b00ddd2f8e261a71
1 /* QtImageDirectGraphics.java --
2 Copyright (C) 2005 Free Software Foundation, Inc.
4 This file is part of GNU Classpath.
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
11 GNU Classpath is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING. If not, write to the
18 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 02110-1301 USA.
21 Linking this library statically or dynamically with other modules is
22 making a combined work based on this library. Thus, the terms and
23 conditions of the GNU General Public License cover the whole
24 combination.
26 As a special exception, the copyright holders of this library give you
27 permission to link this library with independent modules to produce an
28 executable, regardless of the license terms of these independent
29 modules, and to copy and distribute the resulting executable under
30 terms of your choice, provided that you also meet, for each linked
31 independent module, the terms and conditions of the license of that
32 module. An independent module is a module which is not derived from
33 or based on this library. If you modify this library, you may extend
34 this exception to your version of the library, but you are not
35 obligated to do so. If you do not wish to do so, delete this
36 exception statement from your version. */
38 package gnu.java.awt.peer.qt;
40 import java.awt.Color;
41 import java.awt.GraphicsConfiguration;
42 import java.awt.Graphics;
43 import java.awt.Graphics2D;
44 import java.awt.Image;
45 import java.awt.Paint;
46 import java.awt.Rectangle;
47 import java.util.Stack;
48 import java.awt.Shape;
49 import java.awt.Stroke;
50 import java.awt.font.FontRenderContext;
51 import java.awt.font.GlyphVector;
52 import java.awt.geom.AffineTransform;
53 import java.awt.geom.PathIterator;
54 import java.awt.geom.Arc2D;
55 import java.awt.geom.Ellipse2D;
56 import java.awt.geom.Line2D;
57 import java.awt.geom.Rectangle2D;
58 import java.awt.geom.RoundRectangle2D;
59 import java.awt.image.BufferedImage;
60 import java.awt.image.BufferedImageOp;
61 import java.awt.image.ImageObserver;
62 import java.awt.image.RenderedImage;
63 import java.awt.image.renderable.RenderableImage;
65 /**
66 * A QtImagePainter that does an update after every drawing op.
68 public class QtImageDirectGraphics extends QtImageGraphics
70 private QtComponentPeer peer;
71 private boolean modified;
73 public QtImageDirectGraphics(QtImage image, QtComponentPeer peer)
75 super( image );
76 this.peer = peer;
77 modified = false;
80 public QtImageDirectGraphics(QtImageGraphics g)
82 super( g );
85 private void scheduleUpdate()
89 public void dispose()
91 super.dispose();
92 peer.toolkit.sync();
93 peer.QtUpdate();
96 public void draw(Shape s)
98 super.draw(s);
99 scheduleUpdate();
102 public void fill(Shape s)
104 super.fill(s);
105 scheduleUpdate();
108 public void drawString(String string, int x, int y)
110 super.drawString( string, x, y );
111 scheduleUpdate();
114 public void drawString(String string, float x, float y)
116 super.drawString( string, x, y );
117 scheduleUpdate();
120 public void drawLine(int x1, int y1, int x2, int y2)
122 super.drawLine(x1, y1, x2, y2);
123 scheduleUpdate();
126 public boolean drawImage(Image image,
127 AffineTransform Tx,
128 ImageObserver obs)
130 boolean r = super.drawImage(image, Tx, obs);
131 scheduleUpdate();
132 return r;
135 public boolean drawImage(Image image, int x, int y, Color bgcolor,
136 ImageObserver observer)
138 boolean r = super.drawImage(image, x, y, bgcolor, observer);
139 scheduleUpdate();
140 return r;
143 public boolean drawImage(Image image,
144 int dx1, int dy1, int dx2, int dy2,
145 int sx1, int sy1, int sx2, int sy2,
146 Color bgcolor, ImageObserver observer)
148 boolean r = super.drawImage( image, dx1, dy1, dx2, dy2,
149 sx1, sy1, sx2, sy2,
150 bgcolor, observer);
151 scheduleUpdate();
152 return r;
155 public boolean drawImage(Image image, int x, int y,
156 int width, int height, Color bgcolor,
157 ImageObserver observer)
159 boolean r = super.drawImage(image, x, y, width, height, bgcolor,
160 observer);
161 scheduleUpdate();
162 return r;