From bc7ac0d88b1a48c25af598f636de44cd60e5aa1a Mon Sep 17 00:00:00 2001 From: Michael Koch Date: Thu, 25 Sep 2003 14:38:02 +0000 Subject: [multiple changes] 2003-09-25 Sascha Brawer * java/awt/font/FontRenderContext.java (getTransform): Return copy of internal transform object. Add Javadoc. * java/awt/geom/Rectangle2D.java (getPathIterator): Use the same winding rule as Sun J2SE. * javax/swing/border/MatteBorder.java (MatteBorder(Icon)): Docfix. 2003-09-25 Ingo Proetel * java/rmi/Naming.java: Added comments, now accepts pseudo protocol "rmi". From-SVN: r71777 --- libjava/ChangeLog | 13 ++++++++ libjava/java/awt/font/FontRenderContext.java | 15 +++++++-- libjava/java/awt/geom/Rectangle2D.java | 8 ++++- libjava/java/rmi/Naming.java | 46 ++++++++++++++++++++++++++++ libjava/javax/swing/border/MatteBorder.java | 2 +- 5 files changed, 80 insertions(+), 4 deletions(-) (limited to 'libjava') diff --git a/libjava/ChangeLog b/libjava/ChangeLog index d34670d..9e33fe8 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,16 @@ +2003-09-25 Sascha Brawer + + * java/awt/font/FontRenderContext.java (getTransform): Return + copy of internal transform object. Add Javadoc. + * java/awt/geom/Rectangle2D.java (getPathIterator): Use the same + winding rule as Sun J2SE. + * javax/swing/border/MatteBorder.java (MatteBorder(Icon)): Docfix. + +2003-09-25 Ingo Proetel + + * java/rmi/Naming.java: + Added comments, now accepts pseudo protocol "rmi". + 2003-09-25 Guilhem Lavaux * java/text/DecimalFormat.java (format): Don't immediatly round diff --git a/libjava/java/awt/font/FontRenderContext.java b/libjava/java/awt/font/FontRenderContext.java index b8202a8..2bec38d 100644 --- a/libjava/java/awt/font/FontRenderContext.java +++ b/libjava/java/awt/font/FontRenderContext.java @@ -1,5 +1,5 @@ /* FontRenderContext.java - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 2002, 2003 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -88,11 +88,22 @@ public class FontRenderContext && usesFractionalMetrics == rhs.usesFractionalMetrics ()); } + + /** + * Retrieves the affine transform for scaling typographical points + * to raster pixels. + * + * @return a clone of the transform object. + */ public AffineTransform getTransform () { - return affineTransform; + if (affineTransform == null) + return new AffineTransform (); + else + return new AffineTransform (affineTransform); } + /** * Returns the hash code of the font render context. */ diff --git a/libjava/java/awt/geom/Rectangle2D.java b/libjava/java/awt/geom/Rectangle2D.java index e63e1ba..8203ca3 100644 --- a/libjava/java/awt/geom/Rectangle2D.java +++ b/libjava/java/awt/geom/Rectangle2D.java @@ -399,7 +399,13 @@ public abstract class Rectangle2D extends RectangularShape public int getWindingRule() { - return WIND_EVEN_ODD; + // A test program showed that Sun J2SE 1.3.1 and 1.4.1_01 + // return WIND_NON_ZERO paths. While this does not really + // make any difference for rectangles (because they are not + // self-intersecting), it seems appropriate to behave + // identically. + + return WIND_NON_ZERO; } public boolean isDone() diff --git a/libjava/java/rmi/Naming.java b/libjava/java/rmi/Naming.java index b558976..2dd50d3 100644 --- a/libjava/java/rmi/Naming.java +++ b/libjava/java/rmi/Naming.java @@ -44,26 +44,72 @@ import java.rmi.registry.LocateRegistry; public final class Naming { +/**
+ * Looks for the remote object that is associated with the named service.
+ * Name and location is given in form of a URL without a scheme:
+ * 
+ *   //host:port/service-name
+ *  
+ * The port is optional.
+ * 
+ * @param name the service name and location + * @return Remote-object that implements the named service + * @throws NotBoundException if no object implements the service + * @throws MalformedURLException + * @throws RemoteException + */ public static Remote lookup(String name) throws NotBoundException, MalformedURLException, RemoteException { + // hack to accept "rmi://host:port/service" strings + if(name.startsWith("rmi:")){ name = name.substring(4); } URL u = new URL("http:" + name); return (getRegistry(u).lookup(u.getFile().substring(1))); } +/** + * Try to bind the given object to the given service name. + * @param name + * @param obj + * @throws AlreadyBoundException + * @throws MalformedURLException + * @throws RemoteException + */ public static void bind(String name, Remote obj) throws AlreadyBoundException, MalformedURLException, RemoteException { URL u = new URL("http:" + name); getRegistry(u).bind(u.getFile().substring(1), obj); } +/** + * Remove a binding for a given service name. + * @param name + * @throws RemoteException + * @throws NotBoundException + * @throws MalformedURLException + */ public static void unbind(String name) throws RemoteException, NotBoundException, MalformedURLException { URL u = new URL("http:" + name); getRegistry(u).unbind(u.getFile().substring(1)); } +/** + * Forces the binding between the given Remote-object and the given service name, even + * if there was already an object bound to this name. + * @param name + * @param obj + * @throws RemoteException + * @throws MalformedURLException + */ public static void rebind(String name, Remote obj) throws RemoteException, MalformedURLException { URL u = new URL("http:" + name); getRegistry(u).rebind(u.getFile().substring(1), obj); } +/** + * Lists all services at the named registry. + * @param name url that specifies the registry + * @return list of services at the name registry + * @throws RemoteException + * @throws MalformedURLException + */ public static String[] list(String name) throws RemoteException, MalformedURLException { return (getRegistry(new URL("http:" + name)).list()); } diff --git a/libjava/javax/swing/border/MatteBorder.java b/libjava/javax/swing/border/MatteBorder.java index e7b0f62..d5dc6dd 100644 --- a/libjava/javax/swing/border/MatteBorder.java +++ b/libjava/javax/swing/border/MatteBorder.java @@ -183,7 +183,7 @@ public class MatteBorder * at the left and right edge, the icon height for the top and * bottom edge. * - *

[A picture of a MatteBorder made by this constructor] * * @param tileIcon an icon for tiling the border area. -- cgit v1.1