Methods Summary |
---|
public void | actionPerformed(java.awt.event.ActionEvent e)
|
public void | addLayoutComponent(java.lang.String name, java.awt.Component c)
|
protected void | addSubComponents()
title = new Title(frame.getTitle());
title.setFont(getFont());
add(systemButton);
add(title);
add(minimizeButton);
add(maximizeButton);
|
protected void | assembleSystemMenu()
systemMenu = new JPopupMenu();
JMenuItem mi = (JMenuItem)systemMenu.add(new JMenuItem(restoreAction));
mi.setMnemonic('R");
mi = (JMenuItem) systemMenu.add(new JMenuItem(moveAction));
mi.setMnemonic('M");
mi = (JMenuItem) systemMenu.add(new JMenuItem(sizeAction));
mi.setMnemonic('S");
mi = (JMenuItem) systemMenu.add(new JMenuItem(iconifyAction));
mi.setMnemonic('n");
mi = (JMenuItem) systemMenu.add(new JMenuItem(maximizeAction));
mi.setMnemonic('x");
systemMenu.add(new JSeparator());
mi = (JMenuItem) systemMenu.add(new JMenuItem(closeAction));
mi.setMnemonic('C");
systemButton = new SystemButton();
systemButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
systemMenu.show(systemButton, 0, BUTTON_SIZE);
}
});
systemButton.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent evt) {
try {
frame.setSelected(true);
} catch (PropertyVetoException pve) {
}
if ((evt.getClickCount() == 2)) {
closeAction.actionPerformed(new
ActionEvent(evt.getSource(),
ActionEvent.ACTION_PERFORMED,
null, evt.getWhen(), 0));
systemMenu.setVisible(false);
}
}
});
|
protected void | createButtons()
minimizeButton = new MinimizeButton();
minimizeButton.addActionListener(iconifyAction);
maximizeButton = new MaximizeButton();
maximizeButton.addActionListener(maximizeAction);
|
protected java.awt.LayoutManager | createLayout()
return this;
|
protected java.beans.PropertyChangeListener | createPropertyChangeListener()
return this;
|
javax.swing.JPopupMenu | getSystemMenu()
return systemMenu;
|
protected void | hideSystemMenu()
systemMenu.setVisible(false);
|
protected void | installDefaults()
setFont(UIManager.getFont("InternalFrame.titleFont"));
setPreferredSize(new Dimension(100, BUTTON_SIZE));
|
public void | layoutContainer(java.awt.Container c)
int w = getWidth();
systemButton.setBounds(0, 0, BUTTON_SIZE, BUTTON_SIZE);
int x = w - BUTTON_SIZE;
if(frame.isMaximizable()) {
maximizeButton.setBounds(x, 0, BUTTON_SIZE, BUTTON_SIZE);
x -= BUTTON_SIZE;
} else if(maximizeButton.getParent() != null) {
maximizeButton.getParent().remove(maximizeButton);
}
if(frame.isIconifiable()) {
minimizeButton.setBounds(x, 0, BUTTON_SIZE, BUTTON_SIZE);
x -= BUTTON_SIZE;
} else if(minimizeButton.getParent() != null) {
minimizeButton.getParent().remove(minimizeButton);
}
title.setBounds(BUTTON_SIZE, 0, x, BUTTON_SIZE);
|
public java.awt.Dimension | minimumLayoutSize(java.awt.Container c)
return new Dimension(100, BUTTON_SIZE);
|
public void | paintComponent(java.awt.Graphics g)
|
public java.awt.Dimension | preferredLayoutSize(java.awt.Container c)
return minimumLayoutSize(c);
|
public void | propertyChange(java.beans.PropertyChangeEvent evt)
String prop = (String)evt.getPropertyName();
JInternalFrame f = (JInternalFrame)evt.getSource();
boolean value = false;
if (JInternalFrame.IS_SELECTED_PROPERTY.equals(prop)) {
repaint();
} else if (prop.equals("maximizable")) {
if ((Boolean)evt.getNewValue() == Boolean.TRUE)
add(maximizeButton);
else
remove(maximizeButton);
revalidate();
repaint();
} else if (prop.equals("iconable")) {
if ((Boolean)evt.getNewValue() == Boolean.TRUE)
add(minimizeButton);
else
remove(minimizeButton);
revalidate();
repaint();
} else if (prop.equals(JInternalFrame.TITLE_PROPERTY)) {
repaint();
}
enableActions();
|
public void | removeLayoutComponent(java.awt.Component c)
|
void | setColors(java.awt.Color c, java.awt.Color h, java.awt.Color s)
color = c;
highlight = h;
shadow = s;
|
protected void | showSystemMenu()
systemMenu.show(systemButton, 0, BUTTON_SIZE);
|
protected void | uninstallListeners()
// Get around protected method in superclass
super.uninstallListeners();
|