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

« back to all changes in this revision

Viewing changes to javax/swing/JWindow.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:
68
68
    /**
69
69
     * Creates a new instance of <code>AccessibleJWindow</code>.
70
70
     */
71
 
    public AccessibleJWindow()
 
71
    protected AccessibleJWindow()
72
72
    {
73
73
      super();
74
74
      // Nothing to do here.
87
87
  protected AccessibleContext accessibleContext;
88
88
 
89
89
  /**
90
 
   * Tells us if we're in the initialization stage.
91
 
   * If so, adds go to top-level Container, otherwise they go
92
 
   * to the content pane for this container.
 
90
   * Creates a new <code>JWindow</code> that has a shared invisible owner frame
 
91
   * as its parent.
93
92
   */
94
 
  private boolean initStageDone = false;
95
 
 
96
93
  public JWindow()
97
94
  {
98
 
    super(SwingUtilities.getOwnerFrame());
 
95
    super(SwingUtilities.getOwnerFrame(null));
99
96
    windowInit();
100
97
  }
101
98
 
 
99
  /**
 
100
   * Creates a new <code>JWindow</code> that uses the specified graphics
 
101
   * environment. This can be used to open a window on a different screen for
 
102
   * example.
 
103
   *
 
104
   * @param gc the graphics environment to use
 
105
   */
102
106
  public JWindow(GraphicsConfiguration gc)
103
107
  {
104
 
    super(SwingUtilities.getOwnerFrame(), gc);
 
108
    super(SwingUtilities.getOwnerFrame(null), gc);
105
109
    windowInit();
106
110
  }
107
 
  
 
111
 
 
112
  /**
 
113
   * Creates a new <code>JWindow</code> that has the specified
 
114
   * <code>owner</code> frame. If <code>owner</code> is <code>null</code>, then
 
115
   * an invisible shared owner frame is installed as owner frame.
 
116
   *
 
117
   * @param owner the owner frame of this window; if <code>null</code> a shared
 
118
   *        invisible owner frame is used
 
119
   */
108
120
  public JWindow(Frame owner)
109
121
  {
110
 
    super(owner);
 
122
    super(SwingUtilities.getOwnerFrame(owner));
111
123
    windowInit();
112
124
  }
113
125
 
 
126
  /**
 
127
   * Creates a new <code>JWindow</code> that has the specified
 
128
   * <code>owner</code> window. If <code>owner</code> is <code>null</code>,
 
129
   * then an invisible shared owner frame is installed as owner frame.
 
130
   *
 
131
   * @param owner the owner window of this window; if <code>null</code> a
 
132
   *        shared invisible owner frame is used
 
133
   */
114
134
  public JWindow(Window owner)
115
135
  {
116
 
    super(owner);
 
136
    super(SwingUtilities.getOwnerFrame(owner));
117
137
    windowInit();
118
138
  }
119
139
 
 
140
  /**
 
141
   * Creates a new <code>JWindow</code> for the given graphics configuration
 
142
   * and that has the specified <code>owner</code> window. If
 
143
   * <code>owner</code> is <code>null</code>, then an invisible shared owner
 
144
   * frame is installed as owner frame.
 
145
   *
 
146
   * The <code>gc</code> parameter can be used to open the window on a
 
147
   * different screen for example.
 
148
   *
 
149
   * @param owner the owner window of this window; if <code>null</code> a
 
150
   *        shared invisible owner frame is used
 
151
   * @param gc the graphics configuration to use
 
152
   */
120
153
  public JWindow(Window owner, GraphicsConfiguration gc)
121
154
  {
122
 
    super(owner, gc);
 
155
    super(SwingUtilities.getOwnerFrame(owner), gc);
123
156
    windowInit();
124
157
  }
125
158
 
128
161
    super.setLayout(new BorderLayout(1, 1));
129
162
    getRootPane(); // will do set/create
130
163
    // Now we're done init stage, adds and layouts go to content pane.
131
 
    initStageDone = true;
 
164
    setRootPaneCheckingEnabled(true);
132
165
  }
133
166
 
134
167
  public Dimension getPreferredSize()
140
173
  {
141
174
    // Check if we're in initialization stage.  If so, call super.setLayout
142
175
    // otherwise, valid calls go to the content pane.
143
 
    if (initStageDone)
144
 
      {
145
 
        if (isRootPaneCheckingEnabled())
146
 
          throw new Error("Cannot set layout. Use getContentPane().setLayout()"
147
 
                           + " instead.");
148
 
        getContentPane().setLayout(manager);
149
 
      }
 
176
    if (isRootPaneCheckingEnabled())
 
177
      getContentPane().setLayout(manager);
150
178
    else
151
179
      super.setLayout(manager);
152
180
  }
207
235
  {
208
236
    // If we're adding in the initialization stage use super.add.
209
237
    // otherwise pass the add onto the content pane.
210
 
    if (!initStageDone)
 
238
    if (isRootPaneCheckingEnabled())
 
239
      getContentPane().add(comp, constraints, index);
 
240
    else
211
241
      super.addImpl(comp, constraints, index);
212
 
    else
213
 
      {
214
 
        if (isRootPaneCheckingEnabled())
215
 
          throw new Error("Do not use add() on JWindow directly. Use "
216
 
                          + "getContentPane().add() instead");
217
 
        getContentPane().add(comp, constraints, index);
218
 
      }
219
242
  }
220
243
 
221
244
  public void remove(Component comp)