[kaffe] CVS kaffe (robilad): Resynced with GNU Classpath: awt and swing fixes
Kaffe CVS
cvs-commits at kaffe.org
Sun Aug 21 13:01:02 PDT 2005
PatchSet 6866
Date: 2005/08/21 19:54:46
Author: robilad
Branch: HEAD
Tag: (none)
Log:
Resynced with GNU Classpath: awt and swing fixes
Members:
ChangeLog:1.4387->1.4388
libraries/javalib/gnu/java/awt/peer/gtk/GdkGraphics.java:1.17->1.18
libraries/javalib/gnu/java/awt/peer/gtk/GdkGraphics2D.java:1.24->1.25
libraries/javalib/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java:1.12->1.13
libraries/javalib/java/awt/AWTKeyStroke.java:1.9->1.10
libraries/javalib/java/awt/Label.java:1.9->1.10
libraries/javalib/java/awt/image/AreaAveragingScaleFilter.java:1.5->1.6
libraries/javalib/java/awt/image/CropImageFilter.java:1.6->1.7
libraries/javalib/java/awt/image/ImageFilter.java:1.5->1.6
libraries/javalib/java/awt/image/RGBImageFilter.java:1.11->1.12
libraries/javalib/java/awt/image/ReplicateScaleFilter.java:1.6->1.7
Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4387 kaffe/ChangeLog:1.4388
--- kaffe/ChangeLog:1.4387 Sun Aug 21 19:28:31 2005
+++ kaffe/ChangeLog Sun Aug 21 19:54:46 2005
@@ -2,6 +2,46 @@
Resynced with GNU Classpath.
+ 2005-08-21 Thomas Fitzsimmons <fitzsim at redhat.com>
+
+ * gnu/java/awt/peer/gtk/GdkGraphics.java (setClip(Shape)): Clear
+ clip when clip == null.
+ * gnu/java/awt/peer/gtk/GdkGraphics2D.java (setClip(Shape)):
+ Likewise.
+
+ 2005-08-20 Thomas Fitzsimmons <fitzsim at redhat.com>
+
+ * java/awt/Label.java (setText): Invalidate label.
+
+ 2005-08-20 Thomas Fitzsimmons <fitzsim at redhat.com>
+
+ * java/awt/image/AreaAveragingScaleFilter.java: Add checks for
+ consumer != null.
+ * java/awt/image/CropImageFilter.java: Likewise.
+ * java/awt/image/ImageFilter.java: Likewise.
+ * java/awt/image/RGBImageFilter.java: Likewise.
+ * java/awt/image/ReplicateScaleFilter.java: Likewise.
+
+ 2005-08-20 Thomas Fitzsimmons <fitzsim at redhat.com>
+
+ * gnu/java/awt/peer/gtk/GdkPixbufDecoder.java (findFormatName):
+ Just return null when ext == null.
+
+ 2005-08-20 Thomas Fitzsimmons <fitzsim at redhat.com>
+
+ * java/awt/AWTKeyStroke.java (getAWTKeyStroke): Include old-style
+ modifiers in returned AWTKeyStroke's modifier mask.
+
+ 2005-08-20 Thomas Fitzsimmons <fitzsim at redhat.com>
+
+ * gnu/java/awt/peer/gtk/GdkGraphics2D.java (setStroke): Clear
+ dashes if dashes is null.
+ (setStrokeUnlocked): Likewise.
+
+2005-08-21 Dalibor Topic <robilad at kaffe.org>
+
+ Resynced with GNU Classpath.
+
2005-08-20 Thomas Fitzsimmons <fitzsim at redhat.com>
* java/awt/Window.java (getMostRecentFocusOwner): New method.
Index: kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GdkGraphics.java
diff -u kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GdkGraphics.java:1.17 kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GdkGraphics.java:1.18
--- kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GdkGraphics.java:1.17 Fri Aug 19 01:27:58 2005
+++ kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GdkGraphics.java Sun Aug 21 19:54:51 2005
@@ -349,7 +349,13 @@
public void setClip (Shape clip)
{
- if (clip != null)
+ if (clip == null)
+ {
+ // Reset clipping.
+ Dimension d = component.awtComponent.getSize();
+ setClip(new Rectangle (0, 0, d.width, d.height));
+ }
+ else
setClip(clip.getBounds());
}
Index: kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GdkGraphics2D.java
diff -u kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GdkGraphics2D.java:1.24 kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GdkGraphics2D.java:1.25
--- kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GdkGraphics2D.java:1.24 Fri Aug 19 01:27:58 2005
+++ kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GdkGraphics2D.java Sun Aug 21 19:54:53 2005
@@ -45,6 +45,7 @@
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Composite;
+import java.awt.Dimension;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.GradientPaint;
@@ -867,6 +868,8 @@
cairoSetDash(double_dashes, double_dashes.length,
(double) bs.getDashPhase());
}
+ else
+ cairoSetDash(new double[0], 0, 0.0);
}
}
@@ -889,6 +892,8 @@
cairoSetDashUnlocked(double_dashes, double_dashes.length,
(double) bs.getDashPhase());
}
+ else
+ cairoSetDashUnlocked(new double[0], 0, 0.0);
}
}
@@ -985,7 +990,13 @@
public void setClip(Shape s)
{
clip = s;
- if (s != null)
+ if (clip == null)
+ {
+ // Reset clipping.
+ Dimension d = component.awtComponent.getSize();
+ setClip(0, 0, d.width, d.height);
+ }
+ else
{
cairoNewPath();
if (s instanceof Rectangle2D)
Index: kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java
diff -u kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java:1.12 kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java:1.13
--- kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java:1.12 Fri Aug 19 01:27:58 2005
+++ kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java Sun Aug 21 19:54:53 2005
@@ -306,7 +306,7 @@
static String findFormatName(Object ext, boolean needWritable)
{
if (ext == null)
- throw new IllegalArgumentException("extension is null");
+ return null;
if (!(ext instanceof String))
throw new IllegalArgumentException("extension is not a string");
Index: kaffe/libraries/javalib/java/awt/AWTKeyStroke.java
diff -u kaffe/libraries/javalib/java/awt/AWTKeyStroke.java:1.9 kaffe/libraries/javalib/java/awt/AWTKeyStroke.java:1.10
--- kaffe/libraries/javalib/java/awt/AWTKeyStroke.java:1.9 Wed Jul 6 13:21:16 2005
+++ kaffe/libraries/javalib/java/awt/AWTKeyStroke.java Sun Aug 21 19:54:53 2005
@@ -423,13 +423,25 @@
{
token = t.nextToken();
if ("shift".equals(token))
- modifiers |= KeyEvent.SHIFT_DOWN_MASK;
+ {
+ modifiers |= KeyEvent.SHIFT_MASK;
+ modifiers |= KeyEvent.SHIFT_DOWN_MASK;
+ }
else if ("ctrl".equals(token) || "control".equals(token))
- modifiers |= KeyEvent.CTRL_DOWN_MASK;
+ {
+ modifiers |= KeyEvent.CTRL_MASK;
+ modifiers |= KeyEvent.CTRL_DOWN_MASK;
+ }
else if ("meta".equals(token))
- modifiers |= KeyEvent.META_DOWN_MASK;
+ {
+ modifiers |= KeyEvent.META_MASK;
+ modifiers |= KeyEvent.META_DOWN_MASK;
+ }
else if ("alt".equals(token))
- modifiers |= KeyEvent.ALT_DOWN_MASK;
+ {
+ modifiers |= KeyEvent.ALT_MASK;
+ modifiers |= KeyEvent.ALT_DOWN_MASK;
+ }
else if ("button1".equals(token))
modifiers |= KeyEvent.BUTTON1_DOWN_MASK;
else if ("button2".equals(token))
Index: kaffe/libraries/javalib/java/awt/Label.java
diff -u kaffe/libraries/javalib/java/awt/Label.java:1.9 kaffe/libraries/javalib/java/awt/Label.java:1.10
--- kaffe/libraries/javalib/java/awt/Label.java:1.9 Mon Jul 4 00:06:05 2005
+++ kaffe/libraries/javalib/java/awt/Label.java Sun Aug 21 19:54:53 2005
@@ -215,12 +215,16 @@
public synchronized void
setText(String text)
{
- this.text = text;
-
- if (peer != null)
+ if (this.text != text)
{
- LabelPeer lp = (LabelPeer) peer;
- lp.setText (text);
+ this.text = text;
+
+ if (peer != null)
+ {
+ LabelPeer lp = (LabelPeer) peer;
+ lp.setText (text);
+ }
+ invalidate();
}
}
Index: kaffe/libraries/javalib/java/awt/image/AreaAveragingScaleFilter.java
diff -u kaffe/libraries/javalib/java/awt/image/AreaAveragingScaleFilter.java:1.5 kaffe/libraries/javalib/java/awt/image/AreaAveragingScaleFilter.java:1.6
--- kaffe/libraries/javalib/java/awt/image/AreaAveragingScaleFilter.java:1.5 Mon Jul 4 00:06:17 2005
+++ kaffe/libraries/javalib/java/awt/image/AreaAveragingScaleFilter.java Sun Aug 21 19:54:54 2005
@@ -80,6 +80,7 @@
*/
public void setHints(int flags)
{
+ if (consumer != null)
consumer.setHints(flags);
}
@@ -100,6 +101,7 @@
public void setPixels(int x, int y, int w, int h,
ColorModel model, byte[] pixels, int offset, int scansize)
{
+ if (consumer != null)
consumer.setPixels(x, y, w, h, model, pixels, offset, scansize);
}
@@ -120,6 +122,7 @@
public void setPixels(int x, int y, int w, int h,
ColorModel model, int[] pixels, int offset, int scansize)
{
+ if (consumer != null)
consumer.setPixels(x, y, w, h, model, pixels, offset, scansize);
}
Index: kaffe/libraries/javalib/java/awt/image/CropImageFilter.java
diff -u kaffe/libraries/javalib/java/awt/image/CropImageFilter.java:1.6 kaffe/libraries/javalib/java/awt/image/CropImageFilter.java:1.7
--- kaffe/libraries/javalib/java/awt/image/CropImageFilter.java:1.6 Mon Jul 4 00:06:20 2005
+++ kaffe/libraries/javalib/java/awt/image/CropImageFilter.java Sun Aug 21 19:54:54 2005
@@ -79,6 +79,7 @@
*/
public void setDimensions(int width, int height)
{
+ if (consumer != null)
consumer.setDimensions(this.width, this.height);
}
@@ -93,7 +94,8 @@
public void setProperties(Hashtable props)
{
props.put("filters", "CropImageFilter");
- consumer.setProperties(props);
+ if (consumer != null)
+ consumer.setProperties(props);
}
/**
@@ -130,9 +132,10 @@
cropped[i * bounds.width + j] = pixels[start + bounds.x + j];
}
- consumer.setPixels(bounds.x, bounds.y,
- bounds.width, bounds.height,
- model, cropped, 0, bounds.width);
+ if (consumer != null)
+ consumer.setPixels(bounds.x, bounds.y,
+ bounds.width, bounds.height,
+ model, cropped, 0, bounds.width);
}
}
@@ -170,9 +173,10 @@
cropped[i * bounds.width + j] = pixels[start + bounds.x + j];
}
- consumer.setPixels(bounds.x, bounds.y,
- bounds.width, bounds.height,
- model, cropped, 0, bounds.width);
+ if (consumer != null)
+ consumer.setPixels(bounds.x, bounds.y,
+ bounds.width, bounds.height,
+ model, cropped, 0, bounds.width);
}
}
Index: kaffe/libraries/javalib/java/awt/image/ImageFilter.java
diff -u kaffe/libraries/javalib/java/awt/image/ImageFilter.java:1.5 kaffe/libraries/javalib/java/awt/image/ImageFilter.java:1.6
--- kaffe/libraries/javalib/java/awt/image/ImageFilter.java:1.5 Mon Jul 4 00:06:20 2005
+++ kaffe/libraries/javalib/java/awt/image/ImageFilter.java Sun Aug 21 19:54:54 2005
@@ -125,6 +125,7 @@
*/
public void setDimensions(int width, int height)
{
+ if (consumer != null)
consumer.setDimensions(width, height);
}
@@ -137,7 +138,8 @@
public void setProperties(Hashtable props)
{
props.put("filters", "ImageFilter");
- consumer.setProperties(props);
+ if (consumer != null)
+ consumer.setProperties(props);
}
/**
@@ -149,6 +151,7 @@
* @see ColorModel */
public void setColorModel(ColorModel model)
{
+ if (consumer != null)
consumer.setColorModel(model);
}
@@ -164,6 +167,7 @@
*/
public void setHints(int flags)
{
+ if (consumer != null)
consumer.setHints(flags);
}
@@ -184,6 +188,7 @@
public void setPixels(int x, int y, int w, int h,
ColorModel model, byte[] pixels, int offset, int scansize)
{
+ if (consumer != null)
consumer.setPixels(x, y, w, h, model, pixels, offset, scansize);
}
@@ -204,6 +209,7 @@
public void setPixels(int x, int y, int w, int h,
ColorModel model, int[] pixels, int offset, int scansize)
{
+ if (consumer != null)
consumer.setPixels(x, y, w, h, model, pixels, offset, scansize);
}
@@ -215,6 +221,7 @@
*/
public void imageComplete(int status)
{
+ if (consumer != null)
consumer.imageComplete(status);
}
}
Index: kaffe/libraries/javalib/java/awt/image/RGBImageFilter.java
diff -u kaffe/libraries/javalib/java/awt/image/RGBImageFilter.java:1.11 kaffe/libraries/javalib/java/awt/image/RGBImageFilter.java:1.12
--- kaffe/libraries/javalib/java/awt/image/RGBImageFilter.java:1.11 Mon Jul 4 00:06:21 2005
+++ kaffe/libraries/javalib/java/awt/image/RGBImageFilter.java Sun Aug 21 19:54:54 2005
@@ -79,10 +79,12 @@
if( ( model instanceof IndexColorModel) && canFilterIndexColorModel ) {
newmodel = filterIndexColorModel( (IndexColorModel) model );
- consumer.setColorModel(newmodel);
+ if (consumer != null)
+ consumer.setColorModel(newmodel);
}
else {
- consumer.setColorModel(ColorModel.getRGBdefault());
+ if (consumer != null)
+ consumer.setColorModel(ColorModel.getRGBdefault());
}
}
@@ -178,6 +180,7 @@
{
if(model == origmodel && (model instanceof IndexColorModel) && canFilterIndexColorModel)
{
+ if (consumer != null)
consumer.setPixels(x, y, w, h, newmodel, pixels, offset, scansize);
}
else
@@ -185,7 +188,8 @@
int intPixels[] =
convertColorModelToDefault( x, y, w, h, model, pixels, offset, scansize );
filterRGBPixels( x, y, w, h, intPixels, offset, scansize );
- consumer.setPixels(x, y, w, h, ColorModel.getRGBdefault(), intPixels, offset, scansize);
+ if (consumer != null)
+ consumer.setPixels(x, y, w, h, ColorModel.getRGBdefault(), intPixels, offset, scansize);
}
}
@@ -209,6 +213,7 @@
{
if(model == origmodel && (model instanceof IndexColorModel) && canFilterIndexColorModel)
{
+ if (consumer != null)
consumer.setPixels(x, y, w, h, newmodel, pixels, offset, scansize);
}
else
@@ -216,7 +221,8 @@
//FIXME: Store the filtered pixels in a separate temporary buffer?
convertColorModelToDefault( x, y, w, h, model, pixels, offset, scansize );
filterRGBPixels( x, y, w, h, pixels, offset, scansize );
- consumer.setPixels(x, y, w, h, ColorModel.getRGBdefault(), pixels, offset, scansize);
+ if (consumer != null)
+ consumer.setPixels(x, y, w, h, ColorModel.getRGBdefault(), pixels, offset, scansize);
}
}
Index: kaffe/libraries/javalib/java/awt/image/ReplicateScaleFilter.java
diff -u kaffe/libraries/javalib/java/awt/image/ReplicateScaleFilter.java:1.6 kaffe/libraries/javalib/java/awt/image/ReplicateScaleFilter.java:1.7
--- kaffe/libraries/javalib/java/awt/image/ReplicateScaleFilter.java:1.6 Mon Jul 4 00:06:21 2005
+++ kaffe/libraries/javalib/java/awt/image/ReplicateScaleFilter.java Sun Aug 21 19:54:54 2005
@@ -124,7 +124,8 @@
destHeight = (int) (height * ((double) destWidth / srcWidth));
}
- consumer.setDimensions(destWidth, destHeight);
+ if (consumer != null)
+ consumer.setDimensions(destWidth, destHeight);
}
/**
@@ -136,7 +137,8 @@
public void setProperties(Hashtable props)
{
props.put("filters", "ReplicateScaleFilter");
- consumer.setProperties(props);
+ if (consumer != null)
+ consumer.setProperties(props);
}
/**
@@ -165,9 +167,10 @@
model, pixels, offset, scansize,
rx, ry, destScansize);
- consumer.setPixels((int) Math.floor(x/rx), (int) Math.floor(y/ry),
- (int) Math.ceil(w/rx), (int) Math.ceil(h/ry),
- model, destPixels, 0, destScansize);
+ if (consumer != null)
+ consumer.setPixels((int) Math.floor(x/rx), (int) Math.floor(y/ry),
+ (int) Math.ceil(w/rx), (int) Math.ceil(h/ry),
+ model, destPixels, 0, destScansize);
}
/**
@@ -196,9 +199,10 @@
model, pixels, offset, scansize,
rx, ry, destScansize);
- consumer.setPixels((int) Math.floor(x/rx), (int) Math.floor(y/ry),
- (int) Math.ceil(w/rx), (int) Math.ceil(h/ry),
- model, destPixels, 0, destScansize);
+ if (consumer != null)
+ consumer.setPixels((int) Math.floor(x/rx), (int) Math.floor(y/ry),
+ (int) Math.ceil(w/rx), (int) Math.ceil(h/ry),
+ model, destPixels, 0, destScansize);
}
private byte[] replicatePixels(int srcx, int srcy, int srcw, int srch,
More information about the kaffe
mailing list