javax.swing.JInternalFrame#setMaximum ( )源码实例Demo

下面列出了javax.swing.JInternalFrame#setMaximum ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: drmips   文件: FrmSimulator.java
/**
 * Restores the specified frame's bounds from the preferences.
 * @param prefPrefix The prefix of the preference.
 * @param frame The frame.
 */
private void restoreFrameBounds(String prefPrefix, JInternalFrame frame) {
	frame.setLocation(DrMIPS.prefs.getInt(prefPrefix + "_x", 0), DrMIPS.prefs.getInt(prefPrefix + "_y", 0));
	int w = DrMIPS.prefs.getInt(prefPrefix + "_w", -1);
	int h = DrMIPS.prefs.getInt(prefPrefix + "_h", -1);
	if(w > 0 && h > 0)
		frame.setSize(w, h);
	else
		frame.pack();
	try {
		if(DrMIPS.prefs.getBoolean(prefPrefix + "_max", false))
			frame.setMaximum(true);
		if(DrMIPS.prefs.getBoolean(prefPrefix + "_min", false))
			frame.setIcon(true);
	}
	catch(PropertyVetoException ex) {
		LOG.log(Level.WARNING, "failed to maximize/minimize an internal frame");
	}
}
 
public void activateFrame(JInternalFrame f) {
    JInternalFrame currentFrame = currentFrameRef != null ?
        currentFrameRef.get() : null;
    try {
        super.activateFrame(f);
        if (currentFrame != null && f != currentFrame) {
            // If the current frame is maximized, transfer that
            // attribute to the frame being activated.
            if (currentFrame.isMaximum() &&
                (f.getClientProperty("JInternalFrame.frameType") !=
                "optionDialog") ) {
                //Special case.  If key binding was used to select next
                //frame instead of minimizing the icon via the minimize
                //icon.
                if (!currentFrame.isIcon()) {
                    currentFrame.setMaximum(false);
                    if (f.isMaximizable()) {
                        if (!f.isMaximum()) {
                            f.setMaximum(true);
                        } else if (f.isMaximum() && f.isIcon()) {
                            f.setIcon(false);
                        } else {
                            f.setMaximum(false);
                        }
                    }
                }
            }
            if (currentFrame.isSelected()) {
                currentFrame.setSelected(false);
            }
        }

        if (!f.isSelected()) {
            f.setSelected(true);
        }
    } catch (PropertyVetoException e) {}
    if (f != currentFrame) {
        currentFrameRef = new WeakReference<JInternalFrame>(f);
    }
}
 
源代码3 项目: dragonwell8_jdk   文件: WindowsDesktopManager.java
public void activateFrame(JInternalFrame f) {
    JInternalFrame currentFrame = currentFrameRef != null ?
        currentFrameRef.get() : null;
    try {
        super.activateFrame(f);
        if (currentFrame != null && f != currentFrame) {
            // If the current frame is maximized, transfer that
            // attribute to the frame being activated.
            if (currentFrame.isMaximum() &&
                (f.getClientProperty("JInternalFrame.frameType") !=
                "optionDialog") ) {
                //Special case.  If key binding was used to select next
                //frame instead of minimizing the icon via the minimize
                //icon.
                if (!currentFrame.isIcon()) {
                    currentFrame.setMaximum(false);
                    if (f.isMaximizable()) {
                        if (!f.isMaximum()) {
                            f.setMaximum(true);
                        } else if (f.isMaximum() && f.isIcon()) {
                            f.setIcon(false);
                        } else {
                            f.setMaximum(false);
                        }
                    }
                }
            }
            if (currentFrame.isSelected()) {
                currentFrame.setSelected(false);
            }
        }

        if (!f.isSelected()) {
            f.setSelected(true);
        }
    } catch (PropertyVetoException e) {}
    if (f != currentFrame) {
        currentFrameRef = new WeakReference<JInternalFrame>(f);
    }
}
 
源代码4 项目: TencentKona-8   文件: WindowsDesktopManager.java
public void activateFrame(JInternalFrame f) {
    JInternalFrame currentFrame = currentFrameRef != null ?
        currentFrameRef.get() : null;
    try {
        super.activateFrame(f);
        if (currentFrame != null && f != currentFrame) {
            // If the current frame is maximized, transfer that
            // attribute to the frame being activated.
            if (currentFrame.isMaximum() &&
                (f.getClientProperty("JInternalFrame.frameType") !=
                "optionDialog") ) {
                //Special case.  If key binding was used to select next
                //frame instead of minimizing the icon via the minimize
                //icon.
                if (!currentFrame.isIcon()) {
                    currentFrame.setMaximum(false);
                    if (f.isMaximizable()) {
                        if (!f.isMaximum()) {
                            f.setMaximum(true);
                        } else if (f.isMaximum() && f.isIcon()) {
                            f.setIcon(false);
                        } else {
                            f.setMaximum(false);
                        }
                    }
                }
            }
            if (currentFrame.isSelected()) {
                currentFrame.setSelected(false);
            }
        }

        if (!f.isSelected()) {
            f.setSelected(true);
        }
    } catch (PropertyVetoException e) {}
    if (f != currentFrame) {
        currentFrameRef = new WeakReference<JInternalFrame>(f);
    }
}
 
源代码5 项目: jdk8u60   文件: WindowsDesktopManager.java
public void activateFrame(JInternalFrame f) {
    JInternalFrame currentFrame = currentFrameRef != null ?
        currentFrameRef.get() : null;
    try {
        super.activateFrame(f);
        if (currentFrame != null && f != currentFrame) {
            // If the current frame is maximized, transfer that
            // attribute to the frame being activated.
            if (currentFrame.isMaximum() &&
                (f.getClientProperty("JInternalFrame.frameType") !=
                "optionDialog") ) {
                //Special case.  If key binding was used to select next
                //frame instead of minimizing the icon via the minimize
                //icon.
                if (!currentFrame.isIcon()) {
                    currentFrame.setMaximum(false);
                    if (f.isMaximizable()) {
                        if (!f.isMaximum()) {
                            f.setMaximum(true);
                        } else if (f.isMaximum() && f.isIcon()) {
                            f.setIcon(false);
                        } else {
                            f.setMaximum(false);
                        }
                    }
                }
            }
            if (currentFrame.isSelected()) {
                currentFrame.setSelected(false);
            }
        }

        if (!f.isSelected()) {
            f.setSelected(true);
        }
    } catch (PropertyVetoException e) {}
    if (f != currentFrame) {
        currentFrameRef = new WeakReference<JInternalFrame>(f);
    }
}
 
源代码6 项目: JDKSourceCode1.8   文件: WindowsDesktopManager.java
public void activateFrame(JInternalFrame f) {
    JInternalFrame currentFrame = currentFrameRef != null ?
        currentFrameRef.get() : null;
    try {
        super.activateFrame(f);
        if (currentFrame != null && f != currentFrame) {
            // If the current frame is maximized, transfer that
            // attribute to the frame being activated.
            if (currentFrame.isMaximum() &&
                (f.getClientProperty("JInternalFrame.frameType") !=
                "optionDialog") ) {
                //Special case.  If key binding was used to select next
                //frame instead of minimizing the icon via the minimize
                //icon.
                if (!currentFrame.isIcon()) {
                    currentFrame.setMaximum(false);
                    if (f.isMaximizable()) {
                        if (!f.isMaximum()) {
                            f.setMaximum(true);
                        } else if (f.isMaximum() && f.isIcon()) {
                            f.setIcon(false);
                        } else {
                            f.setMaximum(false);
                        }
                    }
                }
            }
            if (currentFrame.isSelected()) {
                currentFrame.setSelected(false);
            }
        }

        if (!f.isSelected()) {
            f.setSelected(true);
        }
    } catch (PropertyVetoException e) {}
    if (f != currentFrame) {
        currentFrameRef = new WeakReference<JInternalFrame>(f);
    }
}
 
源代码7 项目: openjdk-jdk8u   文件: WindowsDesktopManager.java
public void activateFrame(JInternalFrame f) {
    JInternalFrame currentFrame = currentFrameRef != null ?
        currentFrameRef.get() : null;
    try {
        super.activateFrame(f);
        if (currentFrame != null && f != currentFrame) {
            // If the current frame is maximized, transfer that
            // attribute to the frame being activated.
            if (currentFrame.isMaximum() &&
                (f.getClientProperty("JInternalFrame.frameType") !=
                "optionDialog") ) {
                //Special case.  If key binding was used to select next
                //frame instead of minimizing the icon via the minimize
                //icon.
                if (!currentFrame.isIcon()) {
                    currentFrame.setMaximum(false);
                    if (f.isMaximizable()) {
                        if (!f.isMaximum()) {
                            f.setMaximum(true);
                        } else if (f.isMaximum() && f.isIcon()) {
                            f.setIcon(false);
                        } else {
                            f.setMaximum(false);
                        }
                    }
                }
            }
            if (currentFrame.isSelected()) {
                currentFrame.setSelected(false);
            }
        }

        if (!f.isSelected()) {
            f.setSelected(true);
        }
    } catch (PropertyVetoException e) {}
    if (f != currentFrame) {
        currentFrameRef = new WeakReference<JInternalFrame>(f);
    }
}
 
public void activateFrame(JInternalFrame f) {
    JInternalFrame currentFrame = currentFrameRef != null ?
        currentFrameRef.get() : null;
    try {
        super.activateFrame(f);
        if (currentFrame != null && f != currentFrame) {
            // If the current frame is maximized, transfer that
            // attribute to the frame being activated.
            if (currentFrame.isMaximum() &&
                (f.getClientProperty("JInternalFrame.frameType") !=
                "optionDialog") ) {
                //Special case.  If key binding was used to select next
                //frame instead of minimizing the icon via the minimize
                //icon.
                if (!currentFrame.isIcon()) {
                    currentFrame.setMaximum(false);
                    if (f.isMaximizable()) {
                        if (!f.isMaximum()) {
                            f.setMaximum(true);
                        } else if (f.isMaximum() && f.isIcon()) {
                            f.setIcon(false);
                        } else {
                            f.setMaximum(false);
                        }
                    }
                }
            }
            if (currentFrame.isSelected()) {
                currentFrame.setSelected(false);
            }
        }

        if (!f.isSelected()) {
            f.setSelected(true);
        }
    } catch (PropertyVetoException e) {}
    if (f != currentFrame) {
        currentFrameRef = new WeakReference<JInternalFrame>(f);
    }
}
 
源代码9 项目: openjdk-jdk9   文件: WindowsDesktopManager.java
public void activateFrame(JInternalFrame f) {
    JInternalFrame currentFrame = currentFrameRef != null ?
        currentFrameRef.get() : null;
    try {
        super.activateFrame(f);
        if (currentFrame != null && f != currentFrame) {
            // If the current frame is maximized, transfer that
            // attribute to the frame being activated.
            if (!currentFrame.isClosed() && currentFrame.isMaximum() &&
                (f.getClientProperty("JInternalFrame.frameType") !=
                "optionDialog") ) {
                //Special case.  If key binding was used to select next
                //frame instead of minimizing the icon via the minimize
                //icon.
                if (!currentFrame.isIcon()) {
                    currentFrame.setMaximum(false);
                    if (f.isMaximizable()) {
                        if (!f.isMaximum()) {
                            f.setMaximum(true);
                        } else if (f.isMaximum() && f.isIcon()) {
                            f.setIcon(false);
                        } else {
                            f.setMaximum(false);
                        }
                    }
                }
            }
            if (currentFrame.isSelected()) {
                currentFrame.setSelected(false);
            }
        }

        if (!f.isSelected()) {
            f.setSelected(true);
        }
    } catch (PropertyVetoException e) {}
    if (f != currentFrame) {
        currentFrameRef = new WeakReference<JInternalFrame>(f);
    }
}
 
源代码10 项目: jdk8u-jdk   文件: WindowsDesktopManager.java
public void activateFrame(JInternalFrame f) {
    JInternalFrame currentFrame = currentFrameRef != null ?
        currentFrameRef.get() : null;
    try {
        super.activateFrame(f);
        if (currentFrame != null && f != currentFrame) {
            // If the current frame is maximized, transfer that
            // attribute to the frame being activated.
            if (currentFrame.isMaximum() &&
                (f.getClientProperty("JInternalFrame.frameType") !=
                "optionDialog") ) {
                //Special case.  If key binding was used to select next
                //frame instead of minimizing the icon via the minimize
                //icon.
                if (!currentFrame.isIcon()) {
                    currentFrame.setMaximum(false);
                    if (f.isMaximizable()) {
                        if (!f.isMaximum()) {
                            f.setMaximum(true);
                        } else if (f.isMaximum() && f.isIcon()) {
                            f.setIcon(false);
                        } else {
                            f.setMaximum(false);
                        }
                    }
                }
            }
            if (currentFrame.isSelected()) {
                currentFrame.setSelected(false);
            }
        }

        if (!f.isSelected()) {
            f.setSelected(true);
        }
    } catch (PropertyVetoException e) {}
    if (f != currentFrame) {
        currentFrameRef = new WeakReference<JInternalFrame>(f);
    }
}
 
源代码11 项目: hottub   文件: WindowsDesktopManager.java
public void activateFrame(JInternalFrame f) {
    JInternalFrame currentFrame = currentFrameRef != null ?
        currentFrameRef.get() : null;
    try {
        super.activateFrame(f);
        if (currentFrame != null && f != currentFrame) {
            // If the current frame is maximized, transfer that
            // attribute to the frame being activated.
            if (currentFrame.isMaximum() &&
                (f.getClientProperty("JInternalFrame.frameType") !=
                "optionDialog") ) {
                //Special case.  If key binding was used to select next
                //frame instead of minimizing the icon via the minimize
                //icon.
                if (!currentFrame.isIcon()) {
                    currentFrame.setMaximum(false);
                    if (f.isMaximizable()) {
                        if (!f.isMaximum()) {
                            f.setMaximum(true);
                        } else if (f.isMaximum() && f.isIcon()) {
                            f.setIcon(false);
                        } else {
                            f.setMaximum(false);
                        }
                    }
                }
            }
            if (currentFrame.isSelected()) {
                currentFrame.setSelected(false);
            }
        }

        if (!f.isSelected()) {
            f.setSelected(true);
        }
    } catch (PropertyVetoException e) {}
    if (f != currentFrame) {
        currentFrameRef = new WeakReference<JInternalFrame>(f);
    }
}
 
源代码12 项目: openjdk-8-source   文件: WindowsDesktopManager.java
public void activateFrame(JInternalFrame f) {
    JInternalFrame currentFrame = currentFrameRef != null ?
        currentFrameRef.get() : null;
    try {
        super.activateFrame(f);
        if (currentFrame != null && f != currentFrame) {
            // If the current frame is maximized, transfer that
            // attribute to the frame being activated.
            if (currentFrame.isMaximum() &&
                (f.getClientProperty("JInternalFrame.frameType") !=
                "optionDialog") ) {
                //Special case.  If key binding was used to select next
                //frame instead of minimizing the icon via the minimize
                //icon.
                if (!currentFrame.isIcon()) {
                    currentFrame.setMaximum(false);
                    if (f.isMaximizable()) {
                        if (!f.isMaximum()) {
                            f.setMaximum(true);
                        } else if (f.isMaximum() && f.isIcon()) {
                            f.setIcon(false);
                        } else {
                            f.setMaximum(false);
                        }
                    }
                }
            }
            if (currentFrame.isSelected()) {
                currentFrame.setSelected(false);
            }
        }

        if (!f.isSelected()) {
            f.setSelected(true);
        }
    } catch (PropertyVetoException e) {}
    if (f != currentFrame) {
        currentFrameRef = new WeakReference<JInternalFrame>(f);
    }
}
 
源代码13 项目: openjdk-8   文件: WindowsDesktopManager.java
public void activateFrame(JInternalFrame f) {
    JInternalFrame currentFrame = currentFrameRef != null ?
        currentFrameRef.get() : null;
    try {
        super.activateFrame(f);
        if (currentFrame != null && f != currentFrame) {
            // If the current frame is maximized, transfer that
            // attribute to the frame being activated.
            if (currentFrame.isMaximum() &&
                (f.getClientProperty("JInternalFrame.frameType") !=
                "optionDialog") ) {
                //Special case.  If key binding was used to select next
                //frame instead of minimizing the icon via the minimize
                //icon.
                if (!currentFrame.isIcon()) {
                    currentFrame.setMaximum(false);
                    if (f.isMaximizable()) {
                        if (!f.isMaximum()) {
                            f.setMaximum(true);
                        } else if (f.isMaximum() && f.isIcon()) {
                            f.setIcon(false);
                        } else {
                            f.setMaximum(false);
                        }
                    }
                }
            }
            if (currentFrame.isSelected()) {
                currentFrame.setSelected(false);
            }
        }

        if (!f.isSelected()) {
            f.setSelected(true);
        }
    } catch (PropertyVetoException e) {}
    if (f != currentFrame) {
        currentFrameRef = new WeakReference<JInternalFrame>(f);
    }
}
 
源代码14 项目: jdk8u_jdk   文件: WindowsDesktopManager.java
public void activateFrame(JInternalFrame f) {
    JInternalFrame currentFrame = currentFrameRef != null ?
        currentFrameRef.get() : null;
    try {
        super.activateFrame(f);
        if (currentFrame != null && f != currentFrame) {
            // If the current frame is maximized, transfer that
            // attribute to the frame being activated.
            if (currentFrame.isMaximum() &&
                (f.getClientProperty("JInternalFrame.frameType") !=
                "optionDialog") ) {
                //Special case.  If key binding was used to select next
                //frame instead of minimizing the icon via the minimize
                //icon.
                if (!currentFrame.isIcon()) {
                    currentFrame.setMaximum(false);
                    if (f.isMaximizable()) {
                        if (!f.isMaximum()) {
                            f.setMaximum(true);
                        } else if (f.isMaximum() && f.isIcon()) {
                            f.setIcon(false);
                        } else {
                            f.setMaximum(false);
                        }
                    }
                }
            }
            if (currentFrame.isSelected()) {
                currentFrame.setSelected(false);
            }
        }

        if (!f.isSelected()) {
            f.setSelected(true);
        }
    } catch (PropertyVetoException e) {}
    if (f != currentFrame) {
        currentFrameRef = new WeakReference<JInternalFrame>(f);
    }
}
 
源代码15 项目: jdk8u-jdk   文件: WindowsDesktopManager.java
public void activateFrame(JInternalFrame f) {
    JInternalFrame currentFrame = currentFrameRef != null ?
        currentFrameRef.get() : null;
    try {
        super.activateFrame(f);
        if (currentFrame != null && f != currentFrame) {
            // If the current frame is maximized, transfer that
            // attribute to the frame being activated.
            if (currentFrame.isMaximum() &&
                (f.getClientProperty("JInternalFrame.frameType") !=
                "optionDialog") ) {
                //Special case.  If key binding was used to select next
                //frame instead of minimizing the icon via the minimize
                //icon.
                if (!currentFrame.isIcon()) {
                    currentFrame.setMaximum(false);
                    if (f.isMaximizable()) {
                        if (!f.isMaximum()) {
                            f.setMaximum(true);
                        } else if (f.isMaximum() && f.isIcon()) {
                            f.setIcon(false);
                        } else {
                            f.setMaximum(false);
                        }
                    }
                }
            }
            if (currentFrame.isSelected()) {
                currentFrame.setSelected(false);
            }
        }

        if (!f.isSelected()) {
            f.setSelected(true);
        }
    } catch (PropertyVetoException e) {}
    if (f != currentFrame) {
        currentFrameRef = new WeakReference<JInternalFrame>(f);
    }
}
 
源代码16 项目: jdk8u-dev-jdk   文件: WindowsDesktopManager.java
public void activateFrame(JInternalFrame f) {
    JInternalFrame currentFrame = currentFrameRef != null ?
        currentFrameRef.get() : null;
    try {
        super.activateFrame(f);
        if (currentFrame != null && f != currentFrame) {
            // If the current frame is maximized, transfer that
            // attribute to the frame being activated.
            if (currentFrame.isMaximum() &&
                (f.getClientProperty("JInternalFrame.frameType") !=
                "optionDialog") ) {
                //Special case.  If key binding was used to select next
                //frame instead of minimizing the icon via the minimize
                //icon.
                if (!currentFrame.isIcon()) {
                    currentFrame.setMaximum(false);
                    if (f.isMaximizable()) {
                        if (!f.isMaximum()) {
                            f.setMaximum(true);
                        } else if (f.isMaximum() && f.isIcon()) {
                            f.setIcon(false);
                        } else {
                            f.setMaximum(false);
                        }
                    }
                }
            }
            if (currentFrame.isSelected()) {
                currentFrame.setSelected(false);
            }
        }

        if (!f.isSelected()) {
            f.setSelected(true);
        }
    } catch (PropertyVetoException e) {}
    if (f != currentFrame) {
        currentFrameRef = new WeakReference<JInternalFrame>(f);
    }
}