diff options
| author | mark <mark@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-05-18 17:29:21 +0000 |
|---|---|---|
| committer | mark <mark@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-05-18 17:29:21 +0000 |
| commit | 64089cc9f030d8ef7972adb5d117e0b23f47d62b (patch) | |
| tree | 9f9c470de62ee62fba1331a396450d728d2b1fad /libjava/classpath/javax/swing/JSeparator.java | |
| parent | 96034e28360d660d7a7708807fcbc4b519574d8e (diff) | |
| download | ppe42-gcc-64089cc9f030d8ef7972adb5d117e0b23f47d62b.tar.gz ppe42-gcc-64089cc9f030d8ef7972adb5d117e0b23f47d62b.zip | |
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
Diffstat (limited to 'libjava/classpath/javax/swing/JSeparator.java')
| -rw-r--r-- | libjava/classpath/javax/swing/JSeparator.java | 83 |
1 files changed, 53 insertions, 30 deletions
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 <code>JSeparator</code> + * component. */ protected class AccessibleJSeparator extends AccessibleJComponent { private static final long serialVersionUID = 916332890553201095L; /** - * Constructor AccessibleJSeparator + * Creates a new <code>AccessibleJSeparator</code> instance. */ protected AccessibleJSeparator() { @@ -66,9 +68,9 @@ public class JSeparator extends JComponent implements SwingConstants, } /** - * getAccessibleRole + * Returns the accessible role for the <code>JSeparator</code> 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 <code>JSeparator</code> 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 <code>JSeparator</code> 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 <code>orientation</code> 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 <code>JSeparator</code>. * - * @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 (<code>"SeparatorUI"</code> in this case) used to + * determine the class name for a UI delegate that can provide the look and + * feel for a <code>JSeparator</code>. * - * @return String The identifier string for the UI. + * @return <code>"SeparatorUI"</code>. */ 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 <code>JSeparator</code>. * - * @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 <code>JSeparator</code> and sends a + * {@link PropertyChangeEvent} (with the property name + * <code>orientation</code>) to all registered listeners. * - * @param orientation The JSeparator's orientation. + * @param orientation the orientation (either {@link #HORIZONTAL} or + * {@link #VERTICAL}). + * + * @throws IllegalArgumentException if <code>orientation</code> 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 <code>JSeparator</code>. * - * @return String A string describing the JSeparator. + * @return A string describing the attributes of this <code>JSeparator</code> + * (never <code>null</code>). */ 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 + * <code>JSeparator</code> component. * - * @return AccessibleContext + * @return The accessible context (an instance of + * {@link AccessibleJSeparator}). */ public AccessibleContext getAccessibleContext() { |

