1 7 8 9 package com.sun.java.swing.plaf.windows; 10 11 import javax.swing.DefaultDesktopManager ; 12 import javax.swing.JInternalFrame ; 13 import javax.swing.JLayeredPane ; 14 import java.awt.Component ; 15 import java.awt.Container ; 16 import java.awt.Dimension ; 17 import java.beans.PropertyVetoException ; 18 import java.util.Vector ; 19 20 36 public class WindowsDesktopManager extends DefaultDesktopManager 37 implements java.io.Serializable , javax.swing.plaf.UIResource { 38 39 42 JInternalFrame currentFrame; 43 JInternalFrame initialFrame; 44 45 public void activateFrame(JInternalFrame f) { 46 try { 47 super.activateFrame(f); 48 49 if (currentFrame != null && f != currentFrame) { 50 if (currentFrame.isMaximum() && 53 (f.getClientProperty("JInternalFrame.frameType") != 54 "optionDialog") ) { 55 if (!currentFrame.isIcon()) { 59 currentFrame.setMaximum(false); 60 } 61 if (f.isMaximizable()) { 62 if (!f.isMaximum()) { 63 f.setMaximum(true); 64 } else if (f.isMaximum() && f.isIcon()) { 65 f.setIcon(false); 66 } else { 67 f.setMaximum(false); 68 } 69 } 70 } 71 if (currentFrame.isSelected()) { 72 currentFrame.setSelected(false); 73 } 74 } 75 76 if (!f.isSelected()) { 77 f.setSelected(true); 78 } 79 currentFrame = f; 80 } catch (PropertyVetoException e) {} 81 } 82 83 } 84 | Popular Tags |