101 |
static |
static |
102 |
{ |
{ |
103 |
if (! Configuration.GTK_CAIRO_ENABLED) |
if (! Configuration.GTK_CAIRO_ENABLED) |
104 |
throw new Error("Grahics2D not implemented. " |
throw new Error("Graphics2D not implemented. " |
105 |
+ "Cairo was not found or disabled at configure time"); |
+ "Cairo was not found or disabled at configure time"); |
106 |
|
|
107 |
if (Configuration.INIT_LOAD_LIBRARY) |
if (Configuration.INIT_LOAD_LIBRARY) |
157 |
return new GdkGraphics2D(width, height); |
return new GdkGraphics2D(width, height); |
158 |
} |
} |
159 |
|
|
160 |
|
private void fail_g2d () |
161 |
|
{ |
162 |
|
System.err.println ("Attempted to instantiate GdkGraphics2D" |
163 |
|
+ " but Graphics2D not enabled. Try again with" |
164 |
|
+ " -Dgnu.java.awt.peer.gtk.Graphics=Graphics2D"); |
165 |
|
System.exit (1); |
166 |
|
} |
167 |
|
|
168 |
GdkGraphics2D(GdkGraphics2D g) |
GdkGraphics2D(GdkGraphics2D g) |
169 |
{ |
{ |
170 |
|
if (!GtkToolkit.useGraphics2D ()) |
171 |
|
fail_g2d (); |
172 |
|
|
173 |
paint = g.paint; |
paint = g.paint; |
174 |
stroke = g.stroke; |
stroke = g.stroke; |
175 |
setRenderingHints(g.hints); |
setRenderingHints(g.hints); |
211 |
|
|
212 |
GdkGraphics2D(int width, int height) |
GdkGraphics2D(int width, int height) |
213 |
{ |
{ |
214 |
|
if (!GtkToolkit.useGraphics2D ()) |
215 |
|
fail_g2d (); |
216 |
|
|
217 |
initState(width, height); |
initState(width, height); |
218 |
|
|
219 |
setColor(Color.black); |
setColor(Color.black); |
229 |
|
|
230 |
GdkGraphics2D(GtkComponentPeer component) |
GdkGraphics2D(GtkComponentPeer component) |
231 |
{ |
{ |
232 |
|
if (!GtkToolkit.useGraphics2D ()) |
233 |
|
fail_g2d (); |
234 |
|
|
235 |
this.component = component; |
this.component = component; |
236 |
|
|
237 |
if (component.isRealized()) |
if (component.isRealized()) |
1009 |
if (clip == null) |
if (clip == null) |
1010 |
{ |
{ |
1011 |
// Reset clipping. |
// Reset clipping. |
1012 |
Dimension d = component.awtComponent.getSize(); |
if (component != null) |
1013 |
setClip(0, 0, d.width, d.height); |
{ |
1014 |
|
Dimension d = component.awtComponent.getSize(); |
1015 |
|
setClip(0, 0, d.width, d.height); |
1016 |
|
} |
1017 |
} |
} |
1018 |
else |
else |
1019 |
{ |
{ |