/[classpath]/classpath/javax/swing/plaf/basic/BasicInternalFrameUI.java
ViewVC logotype

Diff of /classpath/javax/swing/plaf/basic/BasicInternalFrameUI.java

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

revision 1.4.2.6 by gnu_andrew, Wed Nov 2 00:43:54 2005 UTC revision 1.4.2.7 by gnu_andrew, Sun Nov 27 21:00:38 2005 UTC
# Line 46  import java.awt.Dimension; Line 46  import java.awt.Dimension;
46  import java.awt.Graphics;  import java.awt.Graphics;
47  import java.awt.Insets;  import java.awt.Insets;
48  import java.awt.LayoutManager;  import java.awt.LayoutManager;
49    import java.awt.LayoutManager2;
50  import java.awt.Point;  import java.awt.Point;
51  import java.awt.Rectangle;  import java.awt.Rectangle;
52  import java.awt.event.ComponentEvent;  import java.awt.event.ComponentEvent;
# Line 751  public class BasicInternalFrameUI extend Line 752  public class BasicInternalFrameUI extend
752        int y = me.getY();        int y = me.getY();
753    
754        // Find the candidate which should receive this event.        // Find the candidate which should receive this event.
755        Component parent = frame.getContentPane();        Component parent = frame.getLayeredPane();
756        if (parent == null)        if (parent == null)
757          return;          return;
758        Component candidate = null;        Component candidate = null;
# Line 1164  public class BasicInternalFrameUI extend Line 1165  public class BasicInternalFrameUI extend
1165        {        {
1166          frame = (JInternalFrame) c;          frame = (JInternalFrame) c;
1167    
         internalFrameLayout = createLayoutManager();  
         frame.setLayout(internalFrameLayout);  
   
1168          ((JComponent) frame.getRootPane().getGlassPane()).setOpaque(false);          ((JComponent) frame.getRootPane().getGlassPane()).setOpaque(false);
1169          frame.getRootPane().getGlassPane().setVisible(true);          frame.getRootPane().getGlassPane().setVisible(true);
1170    
# Line 1192  public class BasicInternalFrameUI extend Line 1190  public class BasicInternalFrameUI extend
1190      uninstallListeners();      uninstallListeners();
1191      uninstallDefaults();      uninstallDefaults();
1192    
     frame.setLayout(null);  
1193      ((JComponent) frame.getRootPane().getGlassPane()).setOpaque(true);      ((JComponent) frame.getRootPane().getGlassPane()).setOpaque(true);
1194      frame.getRootPane().getGlassPane().setVisible(false);      frame.getRootPane().getGlassPane().setVisible(false);
1195    
# Line 1204  public class BasicInternalFrameUI extend Line 1201  public class BasicInternalFrameUI extend
1201     */     */
1202    protected void installDefaults()    protected void installDefaults()
1203      {      {
1204          internalFrameLayout = createLayoutManager();
1205          frame.setLayout(internalFrameLayout);
1206        LookAndFeel.installBorder(frame, "InternalFrame.border");        LookAndFeel.installBorder(frame, "InternalFrame.border");
1207        frame.setFrameIcon(UIManager.getIcon("InternalFrame.icon"));        frame.setFrameIcon(UIManager.getIcon("InternalFrame.icon"));
1208        // InternalFrames are invisible by default.        // InternalFrames are invisible by default.
# Line 1256  public class BasicInternalFrameUI extend Line 1255  public class BasicInternalFrameUI extend
1255    protected void uninstallDefaults()    protected void uninstallDefaults()
1256    {    {
1257      frame.setBorder(null);      frame.setBorder(null);
1258        frame.setLayout(null);
1259        internalFrameLayout = null;
1260    }    }
1261    
1262    /**    /**
# Line 1329  public class BasicInternalFrameUI extend Line 1330  public class BasicInternalFrameUI extend
1330     */     */
1331    public Dimension getPreferredSize(JComponent x)    public Dimension getPreferredSize(JComponent x)
1332    {    {
1333      return internalFrameLayout.preferredLayoutSize(x);      Dimension pref = null;
1334        LayoutManager layout = frame.getLayout();
1335        if (frame == x && layout != null)
1336          pref = layout.preferredLayoutSize(frame);
1337        else
1338          pref = new Dimension(100, 100);
1339        return pref;
1340    }    }
1341    
1342    /**    /**
# Line 1341  public class BasicInternalFrameUI extend Line 1348  public class BasicInternalFrameUI extend
1348     */     */
1349    public Dimension getMinimumSize(JComponent x)    public Dimension getMinimumSize(JComponent x)
1350    {    {
1351      return internalFrameLayout.minimumLayoutSize(x);      Dimension min = null;
1352        LayoutManager layout = frame.getLayout();
1353        if (frame == x && layout != null)
1354          min = layout.minimumLayoutSize(frame);
1355        else
1356          min = new Dimension(0, 0);
1357        return min;
1358    }    }
1359    
1360    /**    /**
# Line 1353  public class BasicInternalFrameUI extend Line 1366  public class BasicInternalFrameUI extend
1366     */     */
1367    public Dimension getMaximumSize(JComponent x)    public Dimension getMaximumSize(JComponent x)
1368    {    {
1369      return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);      Dimension max = null;
1370        LayoutManager layout = frame.getLayout();
1371        if (frame == x && layout != null && layout instanceof LayoutManager2)
1372          max = ((LayoutManager2) layout).maximumLayoutSize(frame);
1373        else
1374          max = new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
1375        return max;
1376    }    }
1377    
1378    /**    /**

Legend:
Removed from v.1.4.2.6  
changed lines
  Added in v.1.4.2.7

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