summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-19 05:20:12 +0000
committermkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-19 05:20:12 +0000
commit2295aa6c8c8fcdb65dbc68006db984b978a1c689 (patch)
tree5bf3a7fd7b79ae251d31f0c6f157b5da2c08e6b0
parent66c6bae7a65cc3aec9e520b1f2e9a98ede5798df (diff)
downloadgcc-2295aa6c8c8fcdb65dbc68006db984b978a1c689.tar.gz
2005-04-19 Michael Koch <konqueror@gmx.de>
* gnu/java/awt/peer/gtk/GdkGraphics.java (getClipBounds): Handle clip being null. (setClip): Likewise. * java/beans/beancontext/BeanContextSupport.java (add): Implemented. (addAll): Likewise. (clear): Likewise. (removeAll): Likewise. (retainAll): Likewise. 2005-04-19 Michael Koch <konqueror@gmx.de> * java/beans/beancontext/BeanContextServicesSupport.java (BeanContextServicesSupport): Reimplemented. (addBeanContextServicesListener): Implemented. (initialize): Likewise. (removeBeanContextServicesListener): Likewise. * java/beans/beancontext/BeanContextSupport.java (add): Likewise. (addBeanContextMembershipListener): Likewise. (getLocale): Likewise. (initialize): Likewise. (iterator): Likewise. (remove): Likewise. (toArray): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@98375 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--libjava/ChangeLog28
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GdkGraphics.java8
-rw-r--r--libjava/java/beans/beancontext/BeanContextServicesSupport.java49
-rw-r--r--libjava/java/beans/beancontext/BeanContextSupport.java50
4 files changed, 93 insertions, 42 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 6360762deb3..2f889b3df92 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,31 @@
+2005-04-19 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/awt/peer/gtk/GdkGraphics.java
+ (getClipBounds): Handle clip being null.
+ (setClip): Likewise.
+ * java/beans/beancontext/BeanContextSupport.java
+ (add): Implemented.
+ (addAll): Likewise.
+ (clear): Likewise.
+ (removeAll): Likewise.
+ (retainAll): Likewise.
+
+2005-04-19 Michael Koch <konqueror@gmx.de>
+
+ * java/beans/beancontext/BeanContextServicesSupport.java
+ (BeanContextServicesSupport): Reimplemented.
+ (addBeanContextServicesListener): Implemented.
+ (initialize): Likewise.
+ (removeBeanContextServicesListener): Likewise.
+ * java/beans/beancontext/BeanContextSupport.java
+ (add): Likewise.
+ (addBeanContextMembershipListener): Likewise.
+ (getLocale): Likewise.
+ (initialize): Likewise.
+ (iterator): Likewise.
+ (remove): Likewise.
+ (toArray): Likewise.
+
2005-04-19 Roman Kennke <roman@kennke.org>
* java/awt/MediaTracker.java:
diff --git a/libjava/gnu/java/awt/peer/gtk/GdkGraphics.java b/libjava/gnu/java/awt/peer/gtk/GdkGraphics.java
index 7361b291c94..c5978ba33af 100644
--- a/libjava/gnu/java/awt/peer/gtk/GdkGraphics.java
+++ b/libjava/gnu/java/awt/peer/gtk/GdkGraphics.java
@@ -404,7 +404,10 @@ public class GdkGraphics extends Graphics
public Rectangle getClipBounds ()
{
- return new Rectangle (clip.x, clip.y, clip.width, clip.height);
+ if (clip == null)
+ return null;
+ else
+ return clip.getBounds();
}
public Color getColor ()
@@ -445,7 +448,8 @@ public class GdkGraphics extends Graphics
public void setClip (Shape clip)
{
- setClip (clip.getBounds ());
+ if (clip != null)
+ setClip(clip.getBounds());
}
private native void setFGColor(int red, int green, int blue);
diff --git a/libjava/java/beans/beancontext/BeanContextServicesSupport.java b/libjava/java/beans/beancontext/BeanContextServicesSupport.java
index 60aab693db0..318bf9bea15 100644
--- a/libjava/java/beans/beancontext/BeanContextServicesSupport.java
+++ b/libjava/java/beans/beancontext/BeanContextServicesSupport.java
@@ -1,5 +1,5 @@
-/* java.beans.beancontext.BeanContextServicesSupport
- Copyright (C) 2003 Free Software Foundation, Inc.
+/* BeanContextServicesSupport.java --
+ Copyright (C) 2003, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
-
+
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
@@ -120,34 +120,36 @@ public class BeanContextServicesSupport
public BeanContextServicesSupport ()
{
- this (null, null, true, true);
+ super();
}
public BeanContextServicesSupport (BeanContextServices peer)
{
- this (peer, null, true, true);
+ super(peer);
}
- public BeanContextServicesSupport (BeanContextServices peer, Locale lcle)
+ public BeanContextServicesSupport(BeanContextServices peer, Locale locale)
{
- this (peer, lcle, true, true);
+ super(peer, locale);
}
- public BeanContextServicesSupport (BeanContextServices peer, Locale lcle,
- boolean dtime)
+ public BeanContextServicesSupport(BeanContextServices peer, Locale locale,
+ boolean dtime)
{
- this (peer, lcle, dtime, true);
+ super(peer, locale, dtime);
}
- public BeanContextServicesSupport (BeanContextServices peer, Locale lcle,
- boolean dtime, boolean visible)
+ public BeanContextServicesSupport(BeanContextServices peer, Locale locale,
+ boolean dtime, boolean visible)
{
- throw new Error ("Not implemented");
+ super(peer, locale, dtime, visible);
}
- public void addBeanContextServicesListener (BeanContextServicesListener bcsl)
+ public void addBeanContextServicesListener
+ (BeanContextServicesListener listener)
{
- throw new Error ("Not implemented");
+ if (! bcsListeners.contains(listener))
+ bcsListeners.add(listener);
}
public boolean addService (Class serviceClass, BeanContextServiceProvider bcsp)
@@ -202,8 +204,7 @@ public class BeanContextServicesSupport
throw new Error ("Not implemented");
}
- protected final void
- fireServiceRevoked (BeanContextServiceRevokedEvent bcsre)
+ protected final void fireServiceRevoked(BeanContextServiceRevokedEvent event)
{
throw new Error ("Not implemented");
}
@@ -250,7 +251,10 @@ public class BeanContextServicesSupport
public void initialize ()
{
- throw new Error ("Not implemented");
+ super.initialize();
+
+ bcsListeners = new ArrayList();
+ services = new HashMap();
}
protected void initializeBeanContextResources ()
@@ -269,10 +273,13 @@ public class BeanContextServicesSupport
throw new Error ("Not implemented");
}
- public void
- removeBeanContextServicesListener (BeanContextServicesListener bcsl)
+ public void removeBeanContextServicesListener
+ (BeanContextServicesListener listener)
{
- throw new Error ("Not implemented");
+ int index = bcsListeners.indexOf(listener);
+
+ if (index > -1)
+ bcsListeners.remove(index);
}
public void revokeService (Class serviceClass, BeanContextServiceProvider bcsp,
diff --git a/libjava/java/beans/beancontext/BeanContextSupport.java b/libjava/java/beans/beancontext/BeanContextSupport.java
index e9e26cc995a..cb500530e36 100644
--- a/libjava/java/beans/beancontext/BeanContextSupport.java
+++ b/libjava/java/beans/beancontext/BeanContextSupport.java
@@ -1,5 +1,5 @@
-/* java.beans.beancontext.BeanContextSupport
- Copyright (C) 2003 Free Software Foundation, Inc.
+/* BeanContextSupport.java --
+ Copyright (C) 2003, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
-
+
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
@@ -153,23 +153,31 @@ public class BeanContextSupport extends BeanContextChildSupport
okToUseGui = visible;
initialize ();
-
- throw new Error ("Not implemented");
}
public boolean add (Object targetChild)
{
- throw new Error ("Not implemented");
+ if (targetChild == null)
+ throw new IllegalArgumentException();
+
+ if (children.containsKey(targetChild))
+ return false;
+
+ // FIXME: The second argument is surely wrong.
+ children.put(targetChild, targetChild);
+ return true;
}
public boolean addAll (Collection c)
{
- throw new Error ("Not implemented");
+ throw new UnsupportedOperationException();
}
- public void addBeanContextMembershipListener (BeanContextMembershipListener bcml)
+ public void addBeanContextMembershipListener
+ (BeanContextMembershipListener listener)
{
- throw new Error ("Not implemented");
+ if (! bcmListeners.contains(listener))
+ bcmListeners.add(listener);
}
public boolean avoidingGui ()
@@ -216,7 +224,7 @@ public class BeanContextSupport extends BeanContextChildSupport
public void clear ()
{
- throw new Error ("Not implemented");
+ throw new UnsupportedOperationException();
}
public boolean contains (Object o)
@@ -302,7 +310,7 @@ public class BeanContextSupport extends BeanContextChildSupport
public Locale getLocale ()
{
- throw new Error ("Not implemented");
+ return locale;
}
public URL getResource (String name, BeanContextChild bcc)
@@ -317,7 +325,8 @@ public class BeanContextSupport extends BeanContextChildSupport
protected void initialize ()
{
- throw new Error ("Not implemented");
+ bcmListeners = new ArrayList();
+ children = new HashMap();
}
public Object instantiateChild (String beanName)
@@ -343,7 +352,7 @@ public class BeanContextSupport extends BeanContextChildSupport
public Iterator iterator ()
{
- throw new Error ("Not implemented");
+ return children.keySet().iterator();
}
public boolean needsGui ()
@@ -369,17 +378,20 @@ public class BeanContextSupport extends BeanContextChildSupport
public boolean remove (Object targetChild)
{
- throw new Error ("Not implemented");
+ return remove(targetChild, true);
}
protected boolean remove (Object targetChild, boolean callChildSetBC)
{
+ if (targetChild == null)
+ throw new IllegalArgumentException();
+
throw new Error ("Not implemented");
}
public boolean removeAll (Collection c)
{
- throw new Error ("Not implemented");
+ throw new UnsupportedOperationException();
}
public void removeBeanContextMembershipListener (BeanContextMembershipListener bcml)
@@ -389,7 +401,7 @@ public class BeanContextSupport extends BeanContextChildSupport
public boolean retainAll (Collection c)
{
- throw new Error ("Not implemented");
+ throw new UnsupportedOperationException();
}
protected final void serialize (ObjectOutputStream oos, Collection coll)
@@ -416,12 +428,12 @@ public class BeanContextSupport extends BeanContextChildSupport
public Object[] toArray ()
{
- throw new Error ("Not implemented");
+ return children.keySet().toArray();
}
- public Object[] toArray (Object[] arry)
+ public Object[] toArray(Object[] array)
{
- throw new Error ("Not implemented");
+ return children.keySet().toArray(array);
}
protected boolean validatePendingAdd (Object targetChild)