From 64089cc9f030d8ef7972adb5d117e0b23f47d62b Mon Sep 17 00:00:00 2001 From: mark Date: Thu, 18 May 2006 17:29:21 +0000 Subject: Imported GNU Classpath 0.90 * scripts/makemake.tcl: LocaleData.java moved to gnu/java/locale. * sources.am: Regenerated. * gcj/javaprims.h: Regenerated. * Makefile.in: Regenerated. * gcj/Makefile.in: Regenerated. * include/Makefile.in: Regenerated. * testsuite/Makefile.in: Regenerated. * gnu/java/lang/VMInstrumentationImpl.java: New override. * gnu/java/net/local/LocalSocketImpl.java: Likewise. * gnu/classpath/jdwp/VMMethod.java: Likewise. * gnu/classpath/jdwp/VMVirtualMachine.java: Update to latest interface. * java/lang/Thread.java: Add UncaughtExceptionHandler. * java/lang/reflect/Method.java: Implements GenericDeclaration and isSynthetic(), * java/lang/reflect/Field.java: Likewise. * java/lang/reflect/Constructor.java * java/lang/Class.java: Implements Type, GenericDeclaration, getSimpleName() and getEnclosing*() methods. * java/lang/Class.h: Add new public methods. * java/lang/Math.java: Add signum(), ulp() and log10(). * java/lang/natMath.cc (log10): New function. * java/security/VMSecureRandom.java: New override. * java/util/logging/Logger.java: Updated to latest classpath version. * java/util/logging/LogManager.java: New override. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113887 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/classpath/javax/swing/JSeparator.java | 83 +++++++++++++++++---------- 1 file changed, 53 insertions(+), 30 deletions(-) (limited to 'libjava/classpath/javax/swing/JSeparator.java') diff --git a/libjava/classpath/javax/swing/JSeparator.java b/libjava/classpath/javax/swing/JSeparator.java index 602af6a380c..c87783b73eb 100644 --- a/libjava/classpath/javax/swing/JSeparator.java +++ b/libjava/classpath/javax/swing/JSeparator.java @@ -37,12 +37,13 @@ exception statement from your version. */ package javax.swing; +import java.beans.PropertyChangeEvent; + import javax.accessibility.Accessible; import javax.accessibility.AccessibleContext; import javax.accessibility.AccessibleRole; import javax.swing.plaf.SeparatorUI; - /** * The JSeparator. It is mostly used to divide/space out * components. @@ -51,14 +52,15 @@ public class JSeparator extends JComponent implements SwingConstants, Accessible { /** - * AccessibleJSeparator + * Provides the accessibility features for the JSeparator + * component. */ protected class AccessibleJSeparator extends AccessibleJComponent { private static final long serialVersionUID = 916332890553201095L; /** - * Constructor AccessibleJSeparator + * Creates a new AccessibleJSeparator instance. */ protected AccessibleJSeparator() { @@ -66,9 +68,9 @@ public class JSeparator extends JComponent implements SwingConstants, } /** - * getAccessibleRole + * Returns the accessible role for the JSeparator component. * - * @return AccessibleRole + * @return {@link AccessibleRole#SEPARATOR}. */ public AccessibleRole getAccessibleRole() { @@ -82,7 +84,7 @@ public class JSeparator extends JComponent implements SwingConstants, private transient int orientation = HORIZONTAL; /** - * Creates a new horizontal JSeparator object. + * Creates a new horizontal JSeparator object. */ public JSeparator() { @@ -90,9 +92,13 @@ public class JSeparator extends JComponent implements SwingConstants, } /** - * Creates a new JSeparator object with the given orientation. + * Creates a new JSeparator object with the given orientation. * - * @param orientation The orientation of the JSeparator. + * @param orientation the orientation (either {@link #HORIZONTAL} or + * {@link #VERTICAL}). + * + * @throws IllegalArgumentException if orientation is not + * one of the specified values. */ public JSeparator(int orientation) { @@ -104,10 +110,9 @@ public class JSeparator extends JComponent implements SwingConstants, } /** - * This method returns the UI delegate being - * used with the JSeparator. + * Returns the UI delegate being used with the JSeparator. * - * @return SeparatorUI The JSeparator's UI delegate. + * @return The JSeparator's UI delegate. */ public SeparatorUI getUI() { @@ -115,10 +120,9 @@ public class JSeparator extends JComponent implements SwingConstants, } /** - * This method sets the UI delegate to use - * with the JSeparator. + * Sets the separator's UI delegate. * - * @param ui The UI delegate to use. + * @param ui the UI delegate. */ public void setUI(SeparatorUI ui) { @@ -126,8 +130,8 @@ public class JSeparator extends JComponent implements SwingConstants, } /** - * This method resets the UI delegate to the - * default for the current look and feel. + * Sets this separator's UI delegate to the default (obtained from the + * {@link UIManager}) for the current look and feel. */ public void updateUI() { @@ -135,11 +139,11 @@ public class JSeparator extends JComponent implements SwingConstants, } /** - * This method returns the identifier string - * that is used to determine the UI delegate - * from the current look and feel. + * Returns the suffix ("SeparatorUI" in this case) used to + * determine the class name for a UI delegate that can provide the look and + * feel for a JSeparator. * - * @return String The identifier string for the UI. + * @return "SeparatorUI". */ public String getUIClassID() { @@ -147,9 +151,11 @@ public class JSeparator extends JComponent implements SwingConstants, } /** - * This method returns the JSeparator's orientation. + * Returns the orientation of the JSeparator. * - * @return int The JSeparator's orientation. + * @return The orientation (one of {@link #HORIZONTAL} and {@link #VERTICAL}). + * + * @see #setOrientation(int) */ public int getOrientation() { @@ -157,33 +163,50 @@ public class JSeparator extends JComponent implements SwingConstants, } /** - * This method changes the JSeparator's orientation. + * Sets the orientation for the JSeparator and sends a + * {@link PropertyChangeEvent} (with the property name + * orientation) to all registered listeners. * - * @param orientation The JSeparator's orientation. + * @param orientation the orientation (either {@link #HORIZONTAL} or + * {@link #VERTICAL}). + * + * @throws IllegalArgumentException if orientation is not + * one of the specified values. + * + * @see #getOrientation() */ public void setOrientation(int orientation) { if (orientation != HORIZONTAL && orientation != VERTICAL) throw new IllegalArgumentException(orientation + " is not a valid orientation."); + int old = this.orientation; this.orientation = orientation; + firePropertyChange("orientation", old, orientation); } /** - * This method returns a string desribing the JSeparator. - * Normally only used in debugging. + * Returns an implementation-dependent string describing the attributes of + * this JSeparator. * - * @return String A string describing the JSeparator. + * @return A string describing the attributes of this JSeparator + * (never null). */ protected String paramString() { - return "JSeparator"; + String superParamStr = super.paramString(); + if (orientation == HORIZONTAL) + return superParamStr + ",orientation=HORIZONTAL"; + else + return superParamStr + ",orientation=VERTICAL"; } /** - * getAccessibleContext + * Returns the object that provides accessibility features for this + * JSeparator component. * - * @return AccessibleContext + * @return The accessible context (an instance of + * {@link AccessibleJSeparator}). */ public AccessibleContext getAccessibleContext() { -- cgit v1.2.3