/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* The class that manages a basic title bar
* <p>
* <strong>Warning:</strong>
* Serialized objects of this class will not be compatible with
* future Swing releases. The current serialization support is
* appropriate for short term storage or RMI between applications running
* the same version of Swing. As of 1.4, support for long term storage
* of all JavaBeans<sup><font size="-2">TM</font></sup>
* has been added to the <code>java.beans</code> package.
* Please see {@link java.beans.XMLEncoder}.
*
* @author David Kloba
* @author Steve Wilson
*/
{
// These constants are not used in JDK code
frame = f;
}
protected void installTitlePane() {
}
protected void addSubComponents() {
}
protected void createActions() {
maximizeAction = new MaximizeAction();
iconifyAction = new IconifyAction();
closeAction = new CloseAction();
restoreAction = new RestoreAction();
moveAction = new MoveAction();
sizeAction = new SizeAction();
}
return map;
}
protected void installListeners() {
if( propertyChangeListener == null ) {
}
}
protected void uninstallListeners() {
}
protected void installDefaults() {
}
protected void uninstallDefaults() {
}
protected void createButtons() {
iconButton = new NoFocusButton(
"InternalFrameTitlePane.iconifyButtonAccessibleName",
"InternalFrameTitlePane.iconifyButtonOpacity");
}
maxButton = new NoFocusButton(
"InternalFrameTitlePane.maximizeButtonAccessibleName",
"InternalFrameTitlePane.maximizeButtonOpacity");
closeButton = new NoFocusButton(
"InternalFrameTitlePane.closeButtonAccessibleName",
"InternalFrameTitlePane.closeButtonOpacity");
}
}
protected void setButtonIcons() {
}
if (restoreButtonToolTip != null &&
}
}
}
}
}
}
if (restoreButtonToolTip != null &&
}
} else {
}
}
}
}
}
}
}
protected void assembleSystemMenu() {
}
}
return new JMenu(" ");
}
menuBar = new SystemMenuBar();
menuBar.setBorderPainted(false);
return menuBar;
}
protected void showSystemMenu(){
// windowMenu.setPopupMenuVisible(true);
// windowMenu.setVisible(true);
}
if(isSelected)
else
// Center text vertically.
int titleX;
int titleW;
} else {
}
g.setFont(f);
}
}
/**
* Invoked from paintComponent.
* Paints the background of the titlepane. All text and icons will
* then be rendered on top of this background.
* @param g the graphics to use to render the background
* @since 1.4
*/
if(isSelected)
else
}
return SwingUtilities2.clipStringIfNecessary(
}
/**
* Post a WINDOW_CLOSING-like event to the frame, so that it can
* be treated like a regular Frame.
*/
InternalFrameEvent e = new InternalFrameEvent(
// Try posting event, unless there's a SecurityManager.
try {
return;
} catch (SecurityException se) {
// Use dispatchEvent instead.
}
}
frame.dispatchEvent(e);
}
protected void enableActions() {
sizeAction.setEnabled(false);
moveAction.setEnabled(false);
}
}
return handler;
}
return getHandler();
}
return getHandler();
}
//
// PropertyChangeListener
//
repaint();
return;
}
return;
}
if ("closable" == prop) {
} else {
}
} else if ("maximizable" == prop) {
} else {
}
} else if ("iconable" == prop) {
} else {
}
}
revalidate();
repaint();
}
//
// LayoutManager
//
return minimumLayoutSize(c);
}
// Calculate width.
int width = 22;
if (frame.isClosable()) {
width += 19;
}
if (frame.isMaximizable()) {
width += 19;
}
if (frame.isIconifiable()) {
width += 19;
}
// Leave room for three characters in the title.
if (title_length > 3) {
} else {
}
// Calculate height.
fontHeight += 2;
int iconHeight = 0;
// SystemMenuBar forces the icon to be 16x16 or less.
}
iconHeight += 2;
// Take into account the border insets if any.
}
return dim;
}
int w = getWidth();
int h = getHeight();
int x;
int iconHeight = 0;
}
if (frame.isClosable()) {
}
if (frame.isMaximizable()) {
}
if (frame.isIconifiable()) {
}
}
}
/**
* This class should be treated as a "protected" inner class.
* Instantiate it only within subclasses of <Foo>.
*/
// NOTE: This class exists only for backward compatability. All
// its functionality has been moved into Handler. If you need to add
// new functionality add it to the Handler, but make sure this
// class calls into the Handler.
}
}
/**
* This class should be treated as a "protected" inner class.
* Instantiate it only within subclasses of <Foo>.
*/
// NOTE: This class exists only for backward compatability. All
// its functionality has been moved into Handler. If you need to add
// new functionality add it to the Handler, but make sure this
// class calls into the Handler.
}
}
return getHandler().preferredLayoutSize(c);
}
return getHandler().minimumLayoutSize(c);
}
getHandler().layoutContainer(c);
}
}
/**
* This class should be treated as a "protected" inner class.
* Instantiate it only within subclasses of <Foo>.
*/
public CloseAction() {
"InternalFrameTitlePane.closeButtonText"));
}
if(frame.isClosable()) {
}
}
} // end CloseAction
/**
* This class should be treated as a "protected" inner class.
* Instantiate it only within subclasses of <Foo>.
*/
public MaximizeAction() {
"InternalFrameTitlePane.maximizeButtonText"));
}
if (frame.isMaximizable()) {
try {
} catch (PropertyVetoException e) { }
try {
frame.setMaximum(true);
} catch (PropertyVetoException e) { }
} else {
try {
frame.setMaximum(false);
} catch (PropertyVetoException e) { }
}
}
}
}
/**
* This class should be treated as a "protected" inner class.
* Instantiate it only within subclasses of <Foo>.
*/
public IconifyAction() {
"InternalFrameTitlePane.minimizeButtonText"));
}
if(frame.isIconifiable()) {
} else{
}
}
}
} // end IconifyAction
/**
* This class should be treated as a "protected" inner class.
* Instantiate it only within subclasses of <Foo>.
*/
public RestoreAction() {
"InternalFrameTitlePane.restoreButtonText"));
}
try {
} catch (PropertyVetoException e) { }
try {
frame.setMaximum(false);
} catch (PropertyVetoException e) { }
try {
} catch (PropertyVetoException e) { }
}
}
}
/**
* This class should be treated as a "protected" inner class.
* Instantiate it only within subclasses of <Foo>.
*/
public MoveAction() {
"InternalFrameTitlePane.moveButtonText"));
}
// This action is currently undefined
}
} // end MoveAction
/*
* Handles showing and hiding the system menu.
*/
}
if (show) {
} else {
windowMenu.setVisible(false);
}
}
}
/**
* This class should be treated as a "protected" inner class.
* Instantiate it only within subclasses of <Foo>.
*/
public SizeAction() {
"InternalFrameTitlePane.sizeButtonText"));
}
// This action is currently undefined
}
} // end SizeAction
/**
* This class should be treated as a "protected" inner class.
* Instantiate it only within subclasses of <Foo>.
*/
public boolean isFocusTraversable() { return false; }
public void requestFocus() {}
"InternalFrame.icon");
}
// Resize to 16x16 if necessary.
}
}
}
public boolean isOpaque() {
return true;
}
} // end SystemMenuBar
setFocusPainted(false);
}
}
public boolean isFocusTraversable() { return false; }
public void requestFocus() {}
}
return ac;
}
} // end NoFocusButton
} // End Title Pane Class