Methods Summary |
---|
protected void | addSubComponents()
menuButton.setName("InternalFrameTitlePane.menuButton");
iconButton.setName("InternalFrameTitlePane.iconifyButton");
maxButton.setName("InternalFrameTitlePane.maximizeButton");
closeButton.setName("InternalFrameTitlePane.closeButton");
add(menuButton);
add(iconButton);
add(maxButton);
add(closeButton);
|
protected void | addSystemMenuItems(javax.swing.JPopupMenu menu)
// PENDING: this should all be localizable!
JMenuItem mi = (JMenuItem)menu.add(restoreAction);
mi.setMnemonic('R");
mi = (JMenuItem)menu.add(moveAction);
mi.setMnemonic('M");
mi = (JMenuItem)menu.add(sizeAction);
mi.setMnemonic('S");
mi = (JMenuItem)menu.add(iconifyAction);
mi.setMnemonic('n");
mi = (JMenuItem)menu.add(maximizeAction);
mi.setMnemonic('x");
menu.add(new JSeparator());
mi = (JMenuItem)menu.add(closeAction);
mi.setMnemonic('C");
|
protected void | assembleSystemMenu()
systemPopupMenu = new JPopupMenuUIResource();
addSystemMenuItems(systemPopupMenu);
enableActions();
menuButton = createNoFocusButton();
menuButton.setIcon(frame.getFrameIcon());
menuButton.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
showSystemMenu();
}
});
JPopupMenu p = frame.getComponentPopupMenu();
if (p == null || p instanceof UIResource) {
frame.setComponentPopupMenu(systemPopupMenu);
}
if (frame.getDesktopIcon() != null) {
p = frame.getDesktopIcon().getComponentPopupMenu();
if (p == null || p instanceof UIResource) {
frame.getDesktopIcon().setComponentPopupMenu(systemPopupMenu);
}
}
setInheritsPopupMenu(true);
|
protected java.awt.LayoutManager | createLayout()
SynthContext context = getContext(this);
LayoutManager lm =
(LayoutManager)style.get(context, "InternalFrameTitlePane.titlePaneLayout");
context.dispose();
return (lm != null) ? lm : new SynthTitlePaneLayout();
|
private javax.swing.JButton | createNoFocusButton()
JButton button = new JButton();
button.setFocusable(false);
button.setMargin(new Insets(0,0,0,0));
return button;
|
private int | getComponentState(javax.swing.JComponent c)
if (frame != null) {
if (frame.isSelected()) {
return SELECTED;
}
}
return SynthLookAndFeel.getComponentState(c);
|
public javax.swing.plaf.synth.SynthContext | getContext(javax.swing.JComponent c)
return getContext(c, getComponentState(c));
|
public javax.swing.plaf.synth.SynthContext | getContext(javax.swing.JComponent c, int state)
return SynthContext.getContext(SynthContext.class, c,
SynthLookAndFeel.getRegion(c), style, state);
|
private javax.swing.plaf.synth.Region | getRegion(javax.swing.JComponent c)
return SynthLookAndFeel.getRegion(c);
|
public java.lang.String | getUIClassID()
return "InternalFrameTitlePaneUI";
|
protected void | installDefaults()
super.installDefaults();
updateStyle(this);
|
protected void | installListeners()
super.installListeners();
frame.addPropertyChangeListener(this);
|
public void | paint(java.awt.Graphics g, javax.swing.JComponent c)
SynthContext context = getContext(c);
paint(context, g);
context.dispose();
|
protected void | paint(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g)
|
public void | paintBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)
context.getPainter().paintInternalFrameTitlePaneBorder(context,
g, x, y, w, h);
|
public void | paintComponent(java.awt.Graphics g)
SynthContext context = getContext(this);
SynthLookAndFeel.update(context, g);
context.getPainter().paintInternalFrameTitlePaneBackground(context,
g, 0, 0, getWidth(), getHeight());
paint(context, g);
context.dispose();
|
public void | propertyChange(java.beans.PropertyChangeEvent evt)
if (SynthLookAndFeel.shouldUpdateStyle(evt)) {
updateStyle(SynthInternalFrameTitlePane.this);
}
|
protected void | showSystemMenu()
Dimension dim = new Dimension();
Insets insets = frame.getInsets();
dim.width += insets.left + insets.right;
dim.height += insets.bottom + insets.top;
if (!frame.isIcon()) {
systemPopupMenu.show(menuButton,
getX() - dim.width,
getY() + getHeight() - dim.height);
} else {
systemPopupMenu.show(menuButton,
getX() - dim.width,
getY() - systemPopupMenu.getPreferredSize().height -
dim.height);
}
|
protected void | uninstallDefaults()
SynthContext context = getContext(this, ENABLED);
style.uninstallDefaults(context);
context.dispose();
style = null;
JInternalFrame.JDesktopIcon di = frame.getDesktopIcon();
if(di != null && di.getComponentPopupMenu() == systemPopupMenu) {
// Release link to systemMenu from the JInternalFrame
di.setComponentPopupMenu(null);
}
super.uninstallDefaults();
|
protected void | uninstallListeners()
frame.removePropertyChangeListener(this);
super.uninstallListeners();
|
private void | updateStyle(javax.swing.JComponent c)
SynthContext context = getContext(this, ENABLED);
SynthStyle oldStyle = style;
style = SynthLookAndFeel.updateStyle(context, this);
if (style != oldStyle) {
maxIcon =
style.getIcon(context,"InternalFrameTitlePane.maximizeIcon");
minIcon =
style.getIcon(context,"InternalFrameTitlePane.minimizeIcon");
iconIcon =
style.getIcon(context,"InternalFrameTitlePane.iconifyIcon");
closeIcon =
style.getIcon(context,"InternalFrameTitlePane.closeIcon");
}
context.dispose();
|