107 |
if (Configuration.INIT_LOAD_LIBRARY) |
if (Configuration.INIT_LOAD_LIBRARY) |
108 |
System.loadLibrary("gtkpeer"); |
System.loadLibrary("gtkpeer"); |
109 |
|
|
110 |
if (GtkToolkit.useGraphics2D ()) |
initStaticState(); |
|
initStaticState(); |
|
|
else |
|
|
{ |
|
|
System.err.println ("Attempted to instantiate GdkGraphics2D" |
|
|
+ " but Graphics2D not enabled. Try again with" |
|
|
+ " -Dgnu.java.awt.peer.gtk.Graphics=Graphics2D"); |
|
|
System.exit (1); |
|
|
} |
|
111 |
} |
} |
112 |
|
|
113 |
static native void initStaticState(); |
static native void initStaticState(); |
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()) |