/*
* 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 synth title bar
*
* @author David Kloba
* @author Joshua Outwater
* @author Steve Wilson
*/
implements SynthUI, PropertyChangeListener {
private int titleSpacing;
private int buttonSpacing;
// Alignment for the title, one of SwingConstants.(LEADING|TRAILING|CENTER)
private int titleAlignment;
super(f);
}
return "InternalFrameTitlePaneUI";
}
return getContext(c, getComponentState(c));
}
}
return SynthLookAndFeel.getRegion(c);
}
if (frame.isSelected()) {
return SELECTED;
}
}
return SynthLookAndFeel.getComponentState(c);
}
protected void addSubComponents() {
}
protected void installListeners() {
super.installListeners();
frame.addPropertyChangeListener(this);
addPropertyChangeListener(this);
}
protected void uninstallListeners() {
removePropertyChangeListener(this);
super.uninstallListeners();
}
maxIcon =
minIcon =
iconIcon =
"InternalFrameTitlePane.titleSpacing", 2);
"InternalFrameTitlePane.buttonSpacing", 2);
"InternalFrameTitlePane.titleAlignment");
if (alignString != null) {
}
}
}
}
}
protected void installDefaults() {
super.installDefaults();
updateStyle(this);
}
protected void uninstallDefaults() {
// Release link to systemMenu from the JInternalFrame
}
super.uninstallDefaults();
}
UIResource { }
protected void assembleSystemMenu() {
systemPopupMenu = new JPopupMenuUIResource();
public void mousePressed(MouseEvent e) {
try {
frame.setSelected(true);
} catch(PropertyVetoException pve) {
}
}
});
if (p == null || p instanceof UIResource) {
}
if (p == null || p instanceof UIResource) {
}
}
setInheritsPopupMenu(true);
}
// PENDING: this should all be localizable!
}
protected void showSystemMenu() {
} else {
}
}
// SynthInternalFrameTitlePane has no UI, we'll invoke paint on it.
}
// Center text vertically.
if (frame.isIconifiable()) {
}
else if (frame.isMaximizable()) {
}
else if (frame.isClosable()) {
}
int maxX;
int minX;
int titleAlignment = this.titleAlignment;
if (ltr) {
if (lastButton != null) {
}
else {
}
}
else {
if (lastButton != null) {
}
else {
}
}
}
}
if (clippedTitle == title) {
// String fit, align as necessary.
}
}
}
}
}
int y, int w, int h) {
g, x, y, w, h);
}
}
updateStyle(this);
}
}
else {
// Changes for the internal frame
}
}
}
/**
* Resets the menuButton icon to match that of the frame.
*/
private void updateMenuIcon() {
"InternalFrameTitlePane.maxFrameIconSize");
int maxWidth = 16;
int maxHeight = 16;
}
}
}
}
return minimumLayoutSize(c);
}
SynthInternalFrameTitlePane.this);
int width = 0;
int height = 0;
int buttonCount = 0;
if (frame.isClosable()) {
buttonCount++;
}
if (frame.isMaximizable()) {
buttonCount++;
}
if (frame.isIconifiable()) {
buttonCount++;
}
getFont());
// Leave room for three characters in the title.
if (title_length > 3) {
} else {
}
}
boolean trailing) {
if (trailing) {
}
if (trailing) {
return x - buttonSpacing;
}
}
return x;
}
if (frame.isClosable()) {
}
if (frame.isMaximizable()) {
}
if (frame.isIconifiable()) {
}
}
else {
true);
if (frame.isClosable()) {
}
if (frame.isMaximizable()) {
}
if (frame.isIconifiable()) {
}
}
}
}
button.setFocusable(false);
return button;
}
}