diff options
author | Thomas Fitzsimmons <fitzsim@redhat.com> | 2005-09-10 01:01:53 +0000 |
---|---|---|
committer | Thomas Fitzsimmons <fitzsim@redhat.com> | 2005-09-10 01:01:53 +0000 |
commit | d425c869b6ed8dcb14dbf6d5e8ba846e1b0b6013 (patch) | |
tree | 6f0a32ba4e19ebece297fbd8b0b64a979d723a7e | |
parent | 052c6226f96583a8691634e2096bd5f2c450c58e (diff) | |
download | classpath-d425c869b6ed8dcb14dbf6d5e8ba846e1b0b6013.tar.gz |
2005-09-09 Thomas Fitzsimmons <fitzsim@redhat.com>
PR awt/23692
* gnu/java/awt/peer/gtk/GdkGraphics2D.java (static): Only call
initStaticState if using Graphics2D. Otherwise print error and
exit.
(setClip(Shape)): If clip == null and component == null, do
nothing.
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | gnu/java/awt/peer/gtk/GdkGraphics2D.java | 15 |
2 files changed, 21 insertions, 3 deletions
@@ -1,5 +1,14 @@ 2005-09-09 Thomas Fitzsimmons <fitzsim@redhat.com> + PR awt/23692 + * gnu/java/awt/peer/gtk/GdkGraphics2D.java (static): Only call + initStaticState if using Graphics2D. Otherwise print error and + exit. + (setClip(Shape)): If clip == null and component == null, do + nothing. + +2005-09-09 Thomas Fitzsimmons <fitzsim@redhat.com> + * gnu/java/awt/peer/gtk/GdkGraphics.java (GdkGraphics(GtkComponentPeer)): Set font field to a sensible default if component font is null. diff --git a/gnu/java/awt/peer/gtk/GdkGraphics2D.java b/gnu/java/awt/peer/gtk/GdkGraphics2D.java index 617e529d3..6c5c4c8d3 100644 --- a/gnu/java/awt/peer/gtk/GdkGraphics2D.java +++ b/gnu/java/awt/peer/gtk/GdkGraphics2D.java @@ -107,7 +107,13 @@ public class GdkGraphics2D extends Graphics2D if (Configuration.INIT_LOAD_LIBRARY) System.loadLibrary("gtkpeer"); - initStaticState(); + if (GtkToolkit.useGraphics2D ()) + 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); + } } static native void initStaticState(); @@ -992,8 +998,11 @@ public class GdkGraphics2D extends Graphics2D if (clip == null) { // Reset clipping. - Dimension d = component.awtComponent.getSize(); - setClip(0, 0, d.width, d.height); + if (component != null) + { + Dimension d = component.awtComponent.getSize(); + setClip(0, 0, d.width, d.height); + } } else { |