diff options
author | Mark Wielaard <mark@gcc.gnu.org> | 2006-05-18 17:29:21 +0000 |
---|---|---|
committer | Mark Wielaard <mark@gcc.gnu.org> | 2006-05-18 17:29:21 +0000 |
commit | 4f9533c7722fa07511a94d005227961f4a4dec23 (patch) | |
tree | 9f9c470de62ee62fba1331a396450d728d2b1fad /libjava/classpath/javax/swing/JDesktopPane.java | |
parent | eaec4980e139903ae9b274d1abcf3a13946603a8 (diff) | |
download | gcc-4f9533c7722fa07511a94d005227961f4a4dec23.tar.gz |
Imported GNU Classpath 0.90
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.
From-SVN: r113887
Diffstat (limited to 'libjava/classpath/javax/swing/JDesktopPane.java')
-rw-r--r-- | libjava/classpath/javax/swing/JDesktopPane.java | 74 |
1 files changed, 62 insertions, 12 deletions
diff --git a/libjava/classpath/javax/swing/JDesktopPane.java b/libjava/classpath/javax/swing/JDesktopPane.java index 43ab71e7e9f..454870ea6fc 100644 --- a/libjava/classpath/javax/swing/JDesktopPane.java +++ b/libjava/classpath/javax/swing/JDesktopPane.java @@ -56,7 +56,6 @@ import javax.swing.plaf.DesktopPaneUI; */ public class JDesktopPane extends JLayeredPane implements Accessible { - /** DOCUMENT ME! */ private static final long serialVersionUID = 766333777224038726L; /** @@ -85,15 +84,24 @@ public class JDesktopPane extends JLayeredPane implements Accessible private transient int dragMode = LIVE_DRAG_MODE; /** - * AccessibleJDesktopPane + * Indicates if the dragMode property has been set by a client + * program or by the UI. + * + * @see #setUIProperty(String, Object) + * @see LookAndFeel#installProperty(JComponent, String, Object) + */ + private boolean clientDragModeSet = false; + + /** + * Provides the accessibility features for the <code>JDesktopPane</code> + * component. */ protected class AccessibleJDesktopPane extends AccessibleJComponent { - /** DOCUMENT ME! */ private static final long serialVersionUID = 6079388927946077570L; /** - * Constructor AccessibleJDesktopPane + * Creates a new <code>AccessibleJDesktopPane</code> instance. */ protected AccessibleJDesktopPane() { @@ -101,9 +109,9 @@ public class JDesktopPane extends JLayeredPane implements Accessible } /** - * getAccessibleRole + * Returns the accessible role for the <code>JSlider</code> component. * - * @return AccessibleRole + * @return {@link AccessibleRole#DESKTOP_PANE}. */ public AccessibleRole getAccessibleRole() { @@ -153,6 +161,8 @@ public class JDesktopPane extends JLayeredPane implements Accessible if ((mode != LIVE_DRAG_MODE) && (mode != OUTLINE_DRAG_MODE)) throw new IllegalArgumentException("Drag mode not valid."); + clientDragModeSet = true; + // FIXME: Unsupported mode. if (mode == OUTLINE_DRAG_MODE) // throw new IllegalArgumentException("Outline drag modes are @@ -198,7 +208,6 @@ public class JDesktopPane extends JLayeredPane implements Accessible public void updateUI() { setUI((DesktopPaneUI) UIManager.getUI(this)); - invalidate(); } /** @@ -288,13 +297,22 @@ public class JDesktopPane extends JLayeredPane implements Accessible } /** - * This method returns a String that describes the JDesktopPane. + * Returns an implementation-dependent string describing the attributes of + * this <code>JDesktopPane</code>. * - * @return A String that describes the JDesktopPane. + * @return A string describing the attributes of this <code>JDesktopPane</code> + * (never <code>null</code>). */ protected String paramString() { - return "JDesktopPane"; + String superParamStr = super.paramString(); + StringBuffer sb = new StringBuffer(); + sb.append(",isOptimizedDrawingPossible="); + sb.append(isOptimizedDrawingEnabled()); + sb.append(",desktopManager="); + if (desktopManager != null) + sb.append(desktopManager); + return superParamStr + sb.toString(); } /** @@ -320,9 +338,11 @@ public class JDesktopPane extends JLayeredPane implements Accessible } /** - * getAccessibleContext + * Returns the object that provides accessibility features for this + * <code>JDesktopPane</code> component. * - * @return AccessibleContext + * @return The accessible context (an instance of + * {@link AccessibleJDesktopPane}). */ public AccessibleContext getAccessibleContext() { @@ -331,4 +351,34 @@ public class JDesktopPane extends JLayeredPane implements Accessible return accessibleContext; } + + /** + * Helper method for + * {@link LookAndFeel#installProperty(JComponent, String, Object)}. + * + * @param propertyName the name of the property + * @param value the value of the property + * + * @throws IllegalArgumentException if the specified property cannot be set + * by this method + * @throws ClassCastException if the property value does not match the + * property type + * @throws NullPointerException if <code>c</code> or + * <code>propertyValue</code> is <code>null</code> + */ + void setUIProperty(String propertyName, Object value) + { + if (propertyName.equals("dragMode")) + { + if (! clientDragModeSet) + { + setDragMode(((Integer) value).intValue()); + clientDragModeSet = false; + } + } + else + { + super.setUIProperty(propertyName, value); + } + } } |