Methods Summary |
---|
public static javax.swing.plaf.ComponentUI | createUI(javax.swing.JComponent c)
return new SynthDesktopPaneUI();
|
private int | getComponentState(javax.swing.JComponent c)
return SynthLookAndFeel.getComponentState(c);
|
private javax.swing.plaf.synth.SynthContext | getContext(javax.swing.JComponent c, int state)
return SynthContext.getContext(SynthContext.class, c,
SynthLookAndFeel.getRegion(c), style, state);
|
public javax.swing.plaf.synth.SynthContext | getContext(javax.swing.JComponent c)
return getContext(c, getComponentState(c));
|
private javax.swing.plaf.synth.Region | getRegion(javax.swing.JComponent c)
return SynthLookAndFeel.getRegion(c);
|
protected void | installDefaults()
updateStyle(desktop);
if (UIManager.getBoolean("InternalFrame.useTaskBar")) {
taskBar = new TaskBar();
for (Component comp : desktop.getComponents()) {
JInternalFrame.JDesktopIcon desktopIcon;
if (comp instanceof JInternalFrame.JDesktopIcon) {
desktopIcon = (JInternalFrame.JDesktopIcon)comp;
} else if (comp instanceof JInternalFrame) {
desktopIcon = ((JInternalFrame)comp).getDesktopIcon();
} else {
continue;
}
// Move desktopIcon from desktop to taskBar
if (desktopIcon.getParent() == desktop) {
desktop.remove(desktopIcon);
}
if (desktopIcon.getParent() != taskBar) {
taskBar.add(desktopIcon);
desktopIcon.getInternalFrame().addComponentListener(
taskBar);
}
}
taskBar.setBackground(desktop.getBackground());
desktop.add(taskBar,
new Integer(JLayeredPane.PALETTE_LAYER.intValue() + 1));
if (desktop.isShowing()) {
taskBar.adjustSize();
}
}
|
protected void | installDesktopManager()
if (UIManager.getBoolean("InternalFrame.useTaskBar")) {
desktopManager = oldDesktopManager = desktop.getDesktopManager();
if (!(desktopManager instanceof SynthDesktopManager)) {
desktopManager = new SynthDesktopManager();
desktop.setDesktopManager(desktopManager);
}
} else {
super.installDesktopManager();
}
|
protected void | installListeners()
super.installListeners();
desktop.addPropertyChangeListener(this);
if (taskBar != null) {
// Listen for desktop being resized
desktop.addComponentListener(taskBar);
// Listen for frames being added to desktop
desktop.addContainerListener(taskBar);
}
|
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().paintDesktopPaneBorder(context, g, x, y, w, h);
|
public void | propertyChange(java.beans.PropertyChangeEvent evt)
if (SynthLookAndFeel.shouldUpdateStyle(evt)) {
updateStyle((JDesktopPane)evt.getSource());
}
if (evt.getPropertyName() == "ancestor" && taskBar != null) {
taskBar.adjustSize();
}
|
protected void | uninstallDefaults()
SynthContext context = getContext(desktop, ENABLED);
style.uninstallDefaults(context);
context.dispose();
style = null;
if (taskBar != null) {
for (Component comp : taskBar.getComponents()) {
JInternalFrame.JDesktopIcon desktopIcon =
(JInternalFrame.JDesktopIcon)comp;
taskBar.remove(desktopIcon);
desktopIcon.setPreferredSize(null);
JInternalFrame f = desktopIcon.getInternalFrame();
if (f.isIcon()) {
desktop.add(desktopIcon);
}
f.removeComponentListener(taskBar);
}
desktop.remove(taskBar);
taskBar = null;
}
|
protected void | uninstallDesktopManager()
if (oldDesktopManager != null && !(oldDesktopManager instanceof UIResource)) {
desktopManager = desktop.getDesktopManager();
if (desktopManager == null || desktopManager instanceof UIResource) {
desktop.setDesktopManager(oldDesktopManager);
}
}
oldDesktopManager = null;
super.uninstallDesktopManager();
|
protected void | uninstallListeners()
if (taskBar != null) {
desktop.removeComponentListener(taskBar);
desktop.removeContainerListener(taskBar);
}
desktop.removePropertyChangeListener(this);
super.uninstallListeners();
|
public void | update(java.awt.Graphics g, javax.swing.JComponent c)
SynthContext context = getContext(c);
SynthLookAndFeel.update(context, g);
context.getPainter().paintDesktopPaneBackground(context, g, 0, 0,
c.getWidth(), c.getHeight());
paint(context, g);
context.dispose();
|
private void | updateStyle(javax.swing.JDesktopPane c)
SynthStyle oldStyle = style;
SynthContext context = getContext(c, ENABLED);
style = SynthLookAndFeel.updateStyle(context, this);
if (oldStyle != null) {
uninstallKeyboardActions();
installKeyboardActions();
}
context.dispose();
|