/[classpath]/classpath/javax/swing/JInternalFrame.java
ViewVC logotype

Diff of /classpath/javax/swing/JInternalFrame.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6.2.7 by gnu_andrew, Tue Aug 2 20:12:37 2005 UTC revision 1.6.2.8 by gnu_andrew, Sun Nov 27 21:00:37 2005 UTC
# Line 437  public class JInternalFrame extends JCom Line 437  public class JInternalFrame extends JCom
437     */     */
438    protected boolean rootPaneCheckingEnabled = false;    protected boolean rootPaneCheckingEnabled = false;
439    
   /**  
    * Tells us if we're in the initialization stage.  
    * If so, adds go to top-level Container, otherwise they go  
    * to the content pane for this container.  
    */  
   private boolean initStageDone = false;  
   
440    /** Whether the JInternalFrame is resizable. */    /** Whether the JInternalFrame is resizable. */
441    protected boolean resizable;    protected boolean resizable;
442    
# Line 567  public class JInternalFrame extends JCom Line 560  public class JInternalFrame extends JCom
560      storedBounds = new Rectangle();      storedBounds = new Rectangle();
561      setRootPane(createRootPane());      setRootPane(createRootPane());
562      updateUI();      updateUI();
563      initStageDone = true; // Done the init stage, now adds go to content pane.      setRootPaneCheckingEnabled(true); // Done the init stage, now adds go to content pane.
564    }    }
565    
566    /**    /**
# Line 587  public class JInternalFrame extends JCom Line 580  public class JInternalFrame extends JCom
580      // If we're in the initialization stage use super.add. Here we add the      // If we're in the initialization stage use super.add. Here we add the
581      // rootPane as well as the title bar and other stuff.      // rootPane as well as the title bar and other stuff.
582      // Otherwise pass the add onto the content pane.      // Otherwise pass the add onto the content pane.
583      if (!initStageDone)      if (isRootPaneCheckingEnabled())
584        super.addImpl(comp,constraints, index);        getContentPane().add(comp, constraints, index);
585      else      else
586        {        super.addImpl(comp,constraints, index);
         if (isRootPaneCheckingEnabled())  
           throw new Error("Do not use add() on JInternalFrame directly. Use "  
                            + "getContentPane().add() instead");  
         getContentPane().add(comp, constraints, index);  
       }  
587    }    }
588    
589    /**    /**
# Line 1187  public class JInternalFrame extends JCom Line 1175  public class JInternalFrame extends JCom
1175     */     */
1176    protected String paramString()    protected String paramString()
1177    {    {
1178      return "JInternalFrame";      return super.paramString();
1179    }    }
1180    
1181    /**    /**
# Line 1227  public class JInternalFrame extends JCom Line 1215  public class JInternalFrame extends JCom
1215    public void reshape(int x, int y, int width, int height)    public void reshape(int x, int y, int width, int height)
1216    {    {
1217      super.reshape(x, y, width, height);      super.reshape(x, y, width, height);
1218      invalidate();      revalidate();
     doLayout();  
1219    }    }
1220    
1221    /**    /**
# Line 1489  public class JInternalFrame extends JCom Line 1476  public class JInternalFrame extends JCom
1476    {    {
1477      // Check if we're in initialization stage.  If so, call super.setLayout      // Check if we're in initialization stage.  If so, call super.setLayout
1478      // otherwise, valid calls go to the content pane.      // otherwise, valid calls go to the content pane.
1479      if (initStageDone)      if (isRootPaneCheckingEnabled())
1480        {        getContentPane().setLayout(manager);
         if (isRootPaneCheckingEnabled())  
           throw new Error("Cannot set layout. Use getContentPane().setLayout()"  
                            + " instead.");  
         getContentPane().setLayout(manager);  
       }  
1481      else      else
1482        super.setLayout(manager);        super.setLayout(manager);
1483    }    }
# Line 1678  public class JInternalFrame extends JCom Line 1660  public class JInternalFrame extends JCom
1660     */     */
1661    public void setUI(InternalFrameUI ui)    public void setUI(InternalFrameUI ui)
1662    {    {
1663        // We must temporarily go into init mode so that the UI can directly
1664        // manipulate the JInternalFrame.
1665        boolean old = isRootPaneCheckingEnabled();
1666        setRootPaneCheckingEnabled(false);
1667      super.setUI(ui);      super.setUI(ui);
1668        setRootPaneCheckingEnabled(old);
1669    }    }
1670    
1671    /**    /**
# Line 1704  public class JInternalFrame extends JCom Line 1691  public class JInternalFrame extends JCom
1691     */     */
1692    public void updateUI()    public void updateUI()
1693    {    {
1694        // We must go into the init stage when updating the UI, so the UI can
1695        // set layout and components directly on the internal frame, not its
1696        // content pane.
1697            boolean old = isRootPaneCheckingEnabled();
1698        setRootPaneCheckingEnabled(false);
1699      setUI((InternalFrameUI) UIManager.getUI(this));      setUI((InternalFrameUI) UIManager.getUI(this));
1700        setRootPaneCheckingEnabled(old);
1701    }    }
1702    
1703    /**    /**

Legend:
Removed from v.1.6.2.7  
changed lines
  Added in v.1.6.2.8

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26