From d4c53a90db99bfdce6a622a6d1b6195deb1b92bf Mon Sep 17 00:00:00 2001 From: Ingo Maier Date: Sat, 22 Aug 2009 11:56:57 +0000 Subject: Better scaladocs --- src/swing/scala/swing/UIElement.scala | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/swing') diff --git a/src/swing/scala/swing/UIElement.scala b/src/swing/scala/swing/UIElement.scala index f3d2d0d785..a557535627 100644 --- a/src/swing/scala/swing/UIElement.scala +++ b/src/swing/scala/swing/UIElement.scala @@ -27,8 +27,10 @@ object UIElement { } /** - * Returns the wrapper for a given peer, null if there is no cached wrapper - * for the given component of the given type. Should never throw an exception. + * Looks up the internal component cache for a wrapper of the given + * Java Swing peer. If this method finds one of the given type `C`, + * it will return that wrapper. Otherwise it returns `null`. This + * method never throws an exception. */ private[swing] def cachedWrapper[C<:UIElement](c: java.awt.Component): C = { val w = c match { @@ -39,8 +41,11 @@ object UIElement { } /** - * Wraps a given AWT component in a UIElement. If there is no wrapper in the - * cache, this method will create a new one. + * Returns a wrapper for a given Java Swing peer. If there is a + * compatible wrapper in use, this method will return it. + * + * `wrap` methods in companion objects of subclasses of UIElement have the + * same behavior, except that they return more specific wrappers. */ def wrap(c: java.awt.Component): UIElement = { val w = cachedWrapper[UIElement](c) -- cgit v1.2.3