This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FYI: Patch: classpath merge - java.awt and java.beans


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi list,


I commited the attached patch to merge java.awt and java.beans again 
with classpath.


Michael
- -- 
Homepage: http://www.worldforge.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+d2LcWSOgCCdjSDsRAjwDAJ9Ndf2DPCMaQmC9WczA9cH4ewti/ACfeica
vPz2WQm0zD7d8gDTXPs26s0=
=Eaf9
-----END PGP SIGNATURE-----
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/libjava/ChangeLog,v
retrieving revision 1.1788
diff -u -r1.1788 ChangeLog
--- ChangeLog	18 Mar 2003 07:50:18 -0000	1.1788
+++ ChangeLog	18 Mar 2003 18:15:34 -0000
@@ -1,5 +1,20 @@
 2003-03-18  Michael Koch  <konqueror at gmx dot de>
 
+	* java/awt/ScrollPane.java
+	(ScrollPane): Rewrote for new ScrollPaneAdjustable.
+	(getViewportSize): Likewise.
+	(addNotify): Likewise.
+	(removeNotify): Likewise.
+	* java/awt/ScrollPaneAdjustable.java
+	(ScrollPaneAdjustable): No longer extends Scrollbar.
+	* java/beans/beancontext/BeanContextServices.java:
+	Reformated.
+	(getService): Added throws TooManyListenersException;
+	* java/beans/beancontext/BeanContextServicesSupport.java:
+	Reformated.
+
+2003-03-18  Michael Koch  <konqueror at gmx dot de>
+
 	* java/io/BufferedOutputStream.java,
 	java/io/DataInput.java,
 	java/io/DataInputStream.java,
Index: java/awt/ScrollPane.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/awt/ScrollPane.java,v
retrieving revision 1.11
diff -u -r1.11 ScrollPane.java
--- java/awt/ScrollPane.java	2 Mar 2003 19:24:49 -0000	1.11
+++ java/awt/ScrollPane.java	18 Mar 2003 18:15:34 -0000
@@ -153,8 +153,8 @@
 
   if (scrollbarDisplayPolicy != SCROLLBARS_NEVER)
     {
-      hAdjustable = new ScrollPaneAdjustable(Scrollbar.HORIZONTAL);
-      vAdjustable = new ScrollPaneAdjustable(Scrollbar.VERTICAL);
+      hAdjustable = new ScrollPaneAdjustable (this, Scrollbar.HORIZONTAL);
+      vAdjustable = new ScrollPaneAdjustable (this, Scrollbar.VERTICAL);
     }
 
   wheelScrollingEnabled = true;
@@ -215,23 +215,17 @@
   *
   * @return The viewport size.
   */
-public Dimension
-getViewportSize()
+public Dimension getViewportSize ()
 {
-  Dimension viewsize = getSize();
-  Insets insets = getInsets();
-  viewsize.width = viewsize.width - (insets.left + insets.right);
-  viewsize.height = viewsize.height - (insets.top + insets.bottom);
-
-  ScrollPaneAdjustable v = (ScrollPaneAdjustable)getVAdjustable();
-  ScrollPaneAdjustable h = (ScrollPaneAdjustable)getHAdjustable();
-
-  if ((v != null) && v.isVisible())
-    viewsize.width = viewsize.width - v.getSize().width;
-  if ((h != null) && h.isVisible())
-    viewsize.height = viewsize.height - v.getSize().height;
-
-  return(viewsize);
+  Dimension viewsize = getSize ();
+  Insets insets = getInsets ();
+  viewsize.width = (viewsize.width
+                    - (insets.left + insets.right)
+                    - getVScrollbarWidth ());
+  viewsize.height = (viewsize.height
+                     - (insets.top + insets.bottom)
+                     - getHScrollbarHeight ());
+  return viewsize;
 }
 
 /*************************************************************************/
@@ -347,11 +341,7 @@
     return;
 
   setPeer((ComponentPeer)getToolkit().createScrollPane(this));
-
-  if (hAdjustable != null)
-    hAdjustable.addNotify();
-  if (vAdjustable != null)
-    vAdjustable.removeNotify();
+  super.addNotify();
 }
 
 /*************************************************************************/
@@ -362,11 +352,6 @@
 public void
 removeNotify()
 {
-  if (hAdjustable != null)
-    hAdjustable.removeNotify();
-  if (vAdjustable != null)
-    vAdjustable.removeNotify();
-
   super.removeNotify();
 }
 
Index: java/awt/ScrollPaneAdjustable.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/awt/ScrollPaneAdjustable.java,v
retrieving revision 1.4
diff -u -r1.4 ScrollPaneAdjustable.java
--- java/awt/ScrollPaneAdjustable.java	17 Mar 2003 16:40:30 -0000	1.4
+++ java/awt/ScrollPaneAdjustable.java	18 Mar 2003 18:15:34 -0000
@@ -49,7 +49,6 @@
  * @since 1.4
  */
 public class ScrollPaneAdjustable
-  extends Scrollbar
   implements Adjustable, Serializable
 {
   private static final long serialVersionUID = -3359745691033257079L;
@@ -60,13 +59,14 @@
   int minimum;
   int maximum;
   int visibleAmount;
-  int unitIncrement;
-  int blockIncrement;
+  int unitIncrement = 1;
+  int blockIncrement = 1;
   AdjustmentListener adjustmentListener;
 
-  ScrollPaneAdjustable (int orientation)
+  ScrollPaneAdjustable (ScrollPane sp, int orientation)
   {
-    throw new Error ("not implemented");
+    this.sp = sp;
+    this.orientation = orientation;
   }
   
   ScrollPaneAdjustable (ScrollPane sp, int orientation, int value, int minimum,
Index: java/beans/beancontext/BeanContextServices.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/beans/beancontext/BeanContextServices.java,v
retrieving revision 1.2
diff -u -r1.2 BeanContextServices.java
--- java/beans/beancontext/BeanContextServices.java	22 Jan 2002 22:40:12 -0000	1.2
+++ java/beans/beancontext/BeanContextServices.java	18 Mar 2003 18:15:34 -0000
@@ -39,6 +39,7 @@
 package java.beans.beancontext;
 
 import java.util.Iterator;
+import java.util.TooManyListenersException;
 
 /**
  * Allows a <code>BeanContext</code> to provide services to its children.
@@ -46,161 +47,172 @@
  * @specnote it is unclear whether a <code>BeanContextServices</code>
  *           should delegate unhandled requests to parents.  I assume so.
  * @author John Keiser
- * @since JDK1.2
+ * @since 1.2
  */
 
-public interface BeanContextServices extends BeanContext, BeanContextServicesListener {
-	/**
-	 * Register a service to make it available to others.
-	 * This class may refuse to add the service based on whatever
-	 * information it can gather, including whether the service
-	 * provider is trusted.
-	 *
-	 * @param serviceClass the service class.
-	 * @param provider the factory that will actually provide the service.
-	 * @return whether the service was added or not.
-	 */
-	public boolean addService(Class serviceClass, BeanContextServiceProvider provider);
-
-	/**
-	 * Make it so that no one else can use this service.
-	 * <P>
-	 *
-	 * If <code>revokeNow</code> is <code>false</code>, the only
-	 * effect of this method is to make all subsequent calls to
-	 * <code>getService()</code> on this service class fail.
-	 * <P>
-	 *
-	 * If it is <code>true</code>, a message is also sent out to all
-	 * listeners on the service and all references to it are released.
-	 *
-	 * @param serviceClass the service class to revoke.
-	 * @param provider the service provider providing the service class.
-	 * @param revokeNow whether to release all current references to
-	 *        the service.
-	 */
-	public void revokeService(Class serviceClass, BeanContextServiceProvider provider, boolean revokeNow);
-
-	/**
-	 * Release your copy of this service.
-	 * <P>
-	 *
-	 * If all copies of the service's class have been relinquished by
-	 * the requestor, the <code>BeanContextServiceRevokedListener</code>
-	 * previously registered by <code>getService()</code> will be
-	 * unregistered.
-	 *
-	 * @param requestorChild the original <code>BeanContextChild</code>
-	 *        requesting the service.
-	 * @param requestor the original requestor of the service.
-	 * @param service the service to relinquish
-	 * @see #getService(java.beans.beancontext.BeanContextChild,java.lang.Object,java.lang.Class,java.lang.Object,java.beans.beancontext.BeanContextServiceRevokedListener)
-	 */
-	public void releaseService(BeanContextChild requestorChild, Object requestor, Object service);
-
-	/**
-	 * Get a service from this <code>BeanContextServices</code>.
-	 * <P>
-	 *
-	 * The specified listener will be registered to receive a
-	 * revocation notice for the specified serviceClass.  One
-	 * notification per service class per requestor object will be
-	 * sent.
-	 * <P>
-	 *
-	 * The listener will be unregistered when all services that were
-	 * obtained by that requestor for that service class are released.
-	 * <P>
-	 *
-	 * If the requested service class is not available, or if this
-	 * <code>BeanContextServices</code> object chooses not honor the
-	 * request because the service class has been revoked or for some
-	 * other reason, then this method will return <code>null</code>.
-	 * <P>
-	 *
-	 * This method may throw unchecked exceptions, so watch out.
-	 *
-	 * @specnote it is not specified what happens when two subsequent
-	 *           calls are made to <code>getService()</code> with the
-	 *           same requestor object and service class but different
-	 *           listeners.  Which listener is to be notified?
-	 *
-	 * @param requestorChild the <code>BeanContextChild</code>
-	 *        associated with the requestor.  Typically this will be
-	 *        the same as the requestor itself, but since any
-	 *        <code>Object</code>, even one outside the hierarchy, may
-	 *        make a request, this parameter is necessary.  Only weak
-	 *        references to this will be retained, and it will never
-	 *        be changed, only queried in a read-only manner.
-	 * @param requestor the actual requestor of the service.  Only
-	 *        weak references to this will be retained, and it will
-	 *        never be changed, only queried in a read-only manner.
-	 * @param serviceClass the <code>Class</code> of the service being
-	 *        requested.
-	 * @param serviceSelector a parameter to customize the service
-	 *        returned with.
-	 * @param listener a listener that will be notified if the service
-	 *        being requested is revoked.
-	 * @return an instance of <code>serviceClass</code> (such that
-	 *        <code>instanceof</code> serviceClass is true), or
-	 *        <code>null</code>.
-	 */
-	public Object getService(BeanContextChild requestorChild, Object requestor, Class serviceClass, Object serviceSelector, BeanContextServiceRevokedListener listener);
-
-	/**
-	 * Get a list of all service classes supported.
-	 * <P>
-	 *
-	 * This method must synchronize on
-	 * <code>BeanContext.globalHierarchyLock</code>.
-	 *
-	 * @return a list of all service classes supported.
-	 * @see java.beans.beancontext.BeanContext#globalHierarchyLock
-	 */
-	public Iterator getCurrentServiceClasses();
-
-	/**
-	 * Get a list of valid service selectors for the specified service class.
-	 * <P>
-	 *
-	 * If the specified service class does not have a finite number of
-	 * valid service selectors, it should return <code>null</code>.
-	 * If it takes a general <code>Integer</code> parameter, for
-	 * example, you may as well return <code>null</code> or the poor
-	 * soul who called this method will be iterating all day.
-	 * <P>
-	 *
-	 * If it has no valid service selectors, it should still return an empty
-	 * <code>Iterator</code>.
-	 *
-	 * @param serviceClass the service class to get selectors for.
-	 * @return a list of valid service selectors for the service
-	 *         class, or <code>null</code>.
-	 */
-	public Iterator getCurrentServiceSelectors(Class serviceClass);
-
-	/**
-	 * Tell whether the specified service class is available.
-	 * Iff getService() could return a non-null value for the
-	 * specified service, this method will return <code>true</code>.
-	 *
-	 * @param serviceClass the service class to check on.
-	 * @return whether the specified service class is availabe.
-	 */
-	public boolean hasService(Class serviceClass);
-
-	/**
-	 * Add a listener on all adds and removes of services.
-	 * @param listener the listener to add.
-	 */
-	public void addBeanContextServicesListener(BeanContextServicesListener listener);
-
-	/**
-	 * Remove a listener on all adds and removes of services.
-	 * @specnote it is not certain whether this should remove this
-	 *           listener if it was specified in
-	 *           <code>getService()</code>.
-	 * @param listener the listener to add.
-	 */
-	public void removeBeanContextServicesListener(BeanContextServicesListener listener);
+public interface BeanContextServices
+  extends BeanContext, BeanContextServicesListener
+{
+  /**
+   * Register a service to make it available to others.
+   * This class may refuse to add the service based on whatever
+   * information it can gather, including whether the service
+   * provider is trusted.
+   *
+   * @param serviceClass the service class.
+   * @param provider the factory that will actually provide the service.
+   * @return whether the service was added or not.
+   */
+  public boolean addService (Class serviceClass,
+                             BeanContextServiceProvider provider);
+
+  /**
+   * Make it so that no one else can use this service.
+   * <P>
+   *
+   * If <code>revokeNow</code> is <code>false</code>, the only
+   * effect of this method is to make all subsequent calls to
+   * <code>getService()</code> on this service class fail.
+   * <P>
+   *
+   * If it is <code>true</code>, a message is also sent out to all
+   * listeners on the service and all references to it are released.
+   *
+   * @param serviceClass the service class to revoke.
+   * @param provider the service provider providing the service class.
+   * @param revokeNow whether to release all current references to
+   *        the service.
+   */
+  public void revokeService (Class serviceClass,
+                             BeanContextServiceProvider provider,
+                             boolean revokeNow);
+
+  /**
+   * Release your copy of this service.
+   * <P>
+   *
+   * If all copies of the service's class have been relinquished by
+   * the requestor, the <code>BeanContextServiceRevokedListener</code>
+   * previously registered by <code>getService()</code> will be
+   * unregistered.
+   *
+   * @param requestorChild the original <code>BeanContextChild</code>
+   *        requesting the service.
+   * @param requestor the original requestor of the service.
+   * @param service the service to relinquish
+   * @see #getService(java.beans.beancontext.BeanContextChild,java.lang.Object,java.lang.Class,java.lang.Object,java.beans.beancontext.BeanContextServiceRevokedListener)
+   */
+  public void releaseService (BeanContextChild requestorChild, Object requestor,
+                              Object service);
+
+  /**
+   * Get a service from this <code>BeanContextServices</code>.
+   * <P>
+   *
+   * The specified listener will be registered to receive a
+   * revocation notice for the specified serviceClass.  One
+   * notification per service class per requestor object will be
+   * sent.
+   * <P>
+   *
+   * The listener will be unregistered when all services that were
+   * obtained by that requestor for that service class are released.
+   * <P>
+   *
+   * If the requested service class is not available, or if this
+   * <code>BeanContextServices</code> object chooses not honor the
+   * request because the service class has been revoked or for some
+   * other reason, then this method will return <code>null</code>.
+   * <P>
+   *
+   * This method may throw unchecked exceptions, so watch out.
+   *
+   * @specnote it is not specified what happens when two subsequent
+   *           calls are made to <code>getService()</code> with the
+   *           same requestor object and service class but different
+   *           listeners.  Which listener is to be notified?
+   *
+   * @param requestorChild the <code>BeanContextChild</code>
+   *        associated with the requestor.  Typically this will be
+   *        the same as the requestor itself, but since any
+   *        <code>Object</code>, even one outside the hierarchy, may
+   *        make a request, this parameter is necessary.  Only weak
+   *        references to this will be retained, and it will never
+   *        be changed, only queried in a read-only manner.
+   * @param requestor the actual requestor of the service.  Only
+   *        weak references to this will be retained, and it will
+   *        never be changed, only queried in a read-only manner.
+   * @param serviceClass the <code>Class</code> of the service being
+   *        requested.
+   * @param serviceSelector a parameter to customize the service
+   *        returned with.
+   * @param listener a listener that will be notified if the service
+   *        being requested is revoked.
+   * @return an instance of <code>serviceClass</code> (such that
+   *        <code>instanceof</code> serviceClass is true), or
+   *        <code>null</code>.
+   */
+  public Object getService (BeanContextChild requestorChild, Object requestor,
+                            Class serviceClass, Object serviceSelector,
+                            BeanContextServiceRevokedListener listener)
+    throws TooManyListenersException;
+
+  /**
+   * Get a list of all service classes supported.
+   * <P>
+   *
+   * This method must synchronize on
+   * <code>BeanContext.globalHierarchyLock</code>.
+   *
+   * @return a list of all service classes supported.
+   * @see java.beans.beancontext.BeanContext#globalHierarchyLock
+   */
+  public Iterator getCurrentServiceClasses ();
+
+  /**
+   * Get a list of valid service selectors for the specified service class.
+   * <P>
+   *
+   * If the specified service class does not have a finite number of
+   * valid service selectors, it should return <code>null</code>.
+   * If it takes a general <code>Integer</code> parameter, for
+   * example, you may as well return <code>null</code> or the poor
+   * soul who called this method will be iterating all day.
+   * <P>
+   *
+   * If it has no valid service selectors, it should still return an empty
+   * <code>Iterator</code>.
+   *
+   * @param serviceClass the service class to get selectors for.
+   * @return a list of valid service selectors for the service
+   *         class, or <code>null</code>.
+   */
+  public Iterator getCurrentServiceSelectors (Class serviceClass);
+
+  /**
+   * Tell whether the specified service class is available.
+   * Iff getService() could return a non-null value for the
+   * specified service, this method will return <code>true</code>.
+   *
+   * @param serviceClass the service class to check on.
+   * @return whether the specified service class is available.
+   */
+  public boolean hasService (Class serviceClass);
+
+  /**
+   * Add a listener on all adds and removes of services.
+   * @param listener the listener to add.
+   */
+  public void
+  addBeanContextServicesListener (BeanContextServicesListener listener);
+
+  /**
+   * Remove a listener on all adds and removes of services.
+   * @specnote it is not certain whether this should remove this
+   *           listener if it was specified in
+   *           <code>getService()</code>.
+   * @param listener the listener to add.
+   */
+  public void
+  removeBeanContextServicesListener (BeanContextServicesListener listener);
 }
Index: java/beans/beancontext/BeanContextServicesSupport.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/beans/beancontext/BeanContextServicesSupport.java,v
retrieving revision 1.1
diff -u -r1.1 BeanContextServicesSupport.java
--- java/beans/beancontext/BeanContextServicesSupport.java	10 Mar 2003 14:33:47 -0000	1.1
+++ java/beans/beancontext/BeanContextServicesSupport.java	18 Mar 2003 18:15:34 -0000
@@ -131,12 +131,14 @@
     this (peer, lcle, true, true);
   }
 
-  public BeanContextServicesSupport (BeanContextServices peer, Locale lcle, boolean dtime)
+  public BeanContextServicesSupport (BeanContextServices peer, Locale lcle,
+                                     boolean dtime)
   {
     this (peer, lcle, dtime, true);
   }
 
-  public BeanContextServicesSupport (BeanContextServices peer, Locale lcle, boolean dtime, boolean visible)
+  public BeanContextServicesSupport (BeanContextServices peer, Locale lcle,
+                                     boolean dtime, boolean visible)
   {
     throw new Error ("Not implemented");
   }
@@ -146,12 +148,14 @@
     throw new Error ("Not implemented");
   }
 
-  public boolean addService (Class serviceClass, BeanContextServiceProvider bcsp) 
+  public boolean addService (Class serviceClass, BeanContextServiceProvider bcsp)
   {
     throw new Error ("Not implemented");
   }
 
-  protected boolean addService (Class serviceClass, BeanContextServiceProvider bcsp, boolean fireEvent)
+  protected boolean addService (Class serviceClass,
+                                BeanContextServiceProvider bcsp,
+                                boolean fireEvent)
   {
     throw new Error ("Not implemented");
   }
@@ -167,22 +171,26 @@
   {
     throw new Error ("Not implemented");
   }
-  protected void childJustRemovedHook (Object child, BeanContextSupport.BCSChild bcsc)
+  
+  protected void childJustRemovedHook (Object child,
+                                       BeanContextSupport.BCSChild bcsc)
   {
     throw new Error ("Not implemented");
   }
 
-  protected BeanContextSupport.BCSChild createBCSChild (Object targetChild, Object peer) 
+  protected BeanContextSupport.BCSChild createBCSChild (Object targetChild,
+                                                        Object peer) 
   {
     throw new Error ("Not implemented");
   }
 
-  protected BeanContextServicesSupport.BCSSServiceProvider createBCSSServiceProvider (Class sc, BeanContextServiceProvider bcsp)
+  protected BeanContextServicesSupport.BCSSServiceProvider
+  createBCSSServiceProvider (Class sc, BeanContextServiceProvider bcsp)
   {
     throw new Error ("Not implemented");
   }
 
-  protected final void fireServiceAdded (BeanContextServiceAvailableEvent bcssae) 
+  protected final void fireServiceAdded (BeanContextServiceAvailableEvent bcssae)
   {
     throw new Error ("Not implemented");
   }
@@ -192,12 +200,14 @@
     throw new Error ("Not implemented");
   }
 
-  protected final void fireServiceRevoked (BeanContextServiceRevokedEvent bcsre) 
+  protected final void
+  fireServiceRevoked (BeanContextServiceRevokedEvent bcsre)
   {
     throw new Error ("Not implemented");
   }
 
-  protected final void fireServiceRevoked (Class serviceClass, boolean revokeNow)
+  protected final void fireServiceRevoked (Class serviceClass,
+                                           boolean revokeNow)
   {
     throw new Error ("Not implemented");
   }
@@ -207,7 +217,8 @@
     throw new Error ("Not implemented");
   }
 
-  protected static final BeanContextServicesListener getChildBeanContextServicesListener (Object child) 
+  protected static final BeanContextServicesListener
+  getChildBeanContextServicesListener (Object child) 
   {
     throw new Error ("Not implemented");
   }
@@ -222,7 +233,9 @@
     throw new Error ("Not implemented");
   }
 
-  public Object getService (BeanContextChild child, Object requestor, Class serviceClass, Object serviceSelector, BeanContextServiceRevokedListener bcsrl)
+  public Object getService (BeanContextChild child, Object requestor,
+                            Class serviceClass, Object serviceSelector,
+                            BeanContextServiceRevokedListener bcsrl)
     throws TooManyListenersException
   {
     throw new Error ("Not implemented");
@@ -248,17 +261,20 @@
     throw new Error ("Not implemented");
   }
 
-  public void releaseService (BeanContextChild child, Object requestor, Object service) 
+  public void releaseService (BeanContextChild child, Object requestor,
+                              Object service)
   {
     throw new Error ("Not implemented");
   }
 
-  public void removeBeanContextServicesListener (BeanContextServicesListener bcsl) 
+  public void
+  removeBeanContextServicesListener (BeanContextServicesListener bcsl)
   {
     throw new Error ("Not implemented");
   }
 
-  public void revokeService (Class serviceClass, BeanContextServiceProvider bcsp, boolean revokeCurrentServicesNow) 
+  public void revokeService (Class serviceClass, BeanContextServiceProvider bcsp,
+                             boolean revokeCurrentServicesNow) 
   {
     throw new Error ("Not implemented");
   }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]