~ubuntu-branches/ubuntu/precise/classpath/precise

« back to all changes in this revision

Viewing changes to javax/swing/JDesktopPane.java

  • Committer: Bazaar Package Importer
  • Author(s): Michael Koch
  • Date: 2006-05-27 16:11:15 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060527161115-h6e39eposdt5snb6
Tags: 2:0.91-3
* Install header files to /usr/include/classpath.
* debian/control: classpath: Conflict with jamvm < 1.4.3 and
  cacao < 0.96 (Closes: #368172).

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
 */
57
57
public class JDesktopPane extends JLayeredPane implements Accessible
58
58
{
59
 
  /** DOCUMENT ME! */
60
59
  private static final long serialVersionUID = 766333777224038726L;
61
60
 
62
61
  /**
85
84
  private transient int dragMode = LIVE_DRAG_MODE;
86
85
 
87
86
  /**
88
 
   * AccessibleJDesktopPane
 
87
   * Indicates if the dragMode property has been set by a client
 
88
   * program or by the UI.
 
89
   *
 
90
   * @see #setUIProperty(String, Object)
 
91
   * @see LookAndFeel#installProperty(JComponent, String, Object)
 
92
   */
 
93
  private boolean clientDragModeSet = false;
 
94
 
 
95
  /**
 
96
   * Provides the accessibility features for the <code>JDesktopPane</code>
 
97
   * component.
89
98
   */
90
99
  protected class AccessibleJDesktopPane extends AccessibleJComponent
91
100
  {
92
 
    /** DOCUMENT ME! */
93
101
    private static final long serialVersionUID = 6079388927946077570L;
94
102
 
95
103
    /**
96
 
     * Constructor AccessibleJDesktopPane
 
104
     * Creates a new <code>AccessibleJDesktopPane</code> instance.
97
105
     */
98
106
    protected AccessibleJDesktopPane()
99
107
    {
101
109
    }
102
110
 
103
111
    /**
104
 
     * getAccessibleRole
 
112
     * Returns the accessible role for the <code>JSlider</code> component.
105
113
     *
106
 
     * @return AccessibleRole
 
114
     * @return {@link AccessibleRole#DESKTOP_PANE}.
107
115
     */
108
116
    public AccessibleRole getAccessibleRole()
109
117
    {
153
161
    if ((mode != LIVE_DRAG_MODE) && (mode != OUTLINE_DRAG_MODE))
154
162
      throw new IllegalArgumentException("Drag mode not valid.");
155
163
 
 
164
    clientDragModeSet = true;
 
165
 
156
166
    // FIXME: Unsupported mode.
157
167
    if (mode == OUTLINE_DRAG_MODE)
158
168
      // throw new IllegalArgumentException("Outline drag modes are
198
208
  public void updateUI()
199
209
  {
200
210
    setUI((DesktopPaneUI) UIManager.getUI(this));
201
 
    invalidate();
202
211
  }
203
212
 
204
213
  /**
288
297
  }
289
298
 
290
299
  /**
291
 
   * This method returns a String that describes the JDesktopPane.
 
300
   * Returns an implementation-dependent string describing the attributes of
 
301
   * this <code>JDesktopPane</code>.
292
302
   *
293
 
   * @return A String that describes the JDesktopPane.
 
303
   * @return A string describing the attributes of this <code>JDesktopPane</code>
 
304
   *         (never <code>null</code>).
294
305
   */
295
306
  protected String paramString()
296
307
  {
297
 
    return "JDesktopPane";
 
308
    String superParamStr = super.paramString();
 
309
    StringBuffer sb = new StringBuffer();
 
310
    sb.append(",isOptimizedDrawingPossible=");
 
311
    sb.append(isOptimizedDrawingEnabled());
 
312
    sb.append(",desktopManager=");
 
313
    if (desktopManager != null)
 
314
      sb.append(desktopManager);
 
315
    return superParamStr + sb.toString();
298
316
  }
299
317
 
300
318
  /**
320
338
  }
321
339
 
322
340
  /**
323
 
   * getAccessibleContext
 
341
   * Returns the object that provides accessibility features for this
 
342
   * <code>JDesktopPane</code> component.
324
343
   *
325
 
   * @return AccessibleContext
 
344
   * @return The accessible context (an instance of 
 
345
   *     {@link AccessibleJDesktopPane}).
326
346
   */
327
347
  public AccessibleContext getAccessibleContext()
328
348
  {
331
351
 
332
352
    return accessibleContext;
333
353
  }
 
354
 
 
355
  /**
 
356
   * Helper method for
 
357
   * {@link LookAndFeel#installProperty(JComponent, String, Object)}.
 
358
   * 
 
359
   * @param propertyName the name of the property
 
360
   * @param value the value of the property
 
361
   *
 
362
   * @throws IllegalArgumentException if the specified property cannot be set
 
363
   *         by this method
 
364
   * @throws ClassCastException if the property value does not match the
 
365
   *         property type
 
366
   * @throws NullPointerException if <code>c</code> or
 
367
   *         <code>propertyValue</code> is <code>null</code>
 
368
   */
 
369
  void setUIProperty(String propertyName, Object value)
 
370
  {
 
371
    if (propertyName.equals("dragMode"))
 
372
      {
 
373
        if (! clientDragModeSet)
 
374
          {
 
375
            setDragMode(((Integer) value).intValue());
 
376
            clientDragModeSet = false;
 
377
          }
 
378
      }
 
379
    else
 
380
      {
 
381
        super.setUIProperty(propertyName, value);
 
382
      }
 
383
  }
334
384
}