/*
* 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.
*/
/**
* Provides the Synth L&F UI delegate for
* {@link javax.swing.JDesktopPane}.
*
* @author Joshua Outwater
* @author Steve Wilson
* @since 1.7
*/
/**
* Creates a new UI object for the given component.
*
* @param c component to create UI object for
* @return the UI object
*/
return new SynthDesktopPaneUI();
}
/**
* @inheritDoc
*/
protected void installListeners() {
super.installListeners();
desktop.addPropertyChangeListener(this);
// Listen for desktop being resized
// Listen for frames being added to desktop
}
}
/**
* @inheritDoc
*/
protected void installDefaults() {
} else if (comp instanceof JInternalFrame) {
} else {
continue;
}
// Move desktopIcon from desktop to taskBar
}
taskBar);
}
}
}
}
}
}
}
/**
* @inheritDoc
*/
protected void uninstallListeners() {
}
super.uninstallListeners();
}
/**
* @inheritDoc
*/
protected void uninstallDefaults() {
if (f.isIcon()) {
}
}
}
}
/**
* @inheritDoc
*/
protected void installDesktopManager() {
if (!(desktopManager instanceof SynthDesktopManager)) {
desktopManager = new SynthDesktopManager();
}
} else {
super.installDesktopManager();
}
}
/**
* @inheritDoc
*/
protected void uninstallDesktopManager() {
}
}
super.uninstallDesktopManager();
}
TaskBar() {
setOpaque(true);
// First shrink buttons to fit
if (n > 0) {
// Start with the largest preferred width
int prefWidth = 0;
c.setPreferredSize(null);
}
}
// Shrink equally to fit if needed
}
}
super.layoutContainer(target);
}
});
// PENDING: This should be handled by the painter
int x, int y, int w, int h) {
g.translate(x, y);
g.setColor(getHighlightOuterColor(c));
g.setColor(getShadowOuterColor(c));
g.translate(-x, -y);
}
});
}
void adjustSize() {
// Initial size, because we have no buttons yet
height += 21;
} else {
// We already have a good height
}
}
revalidate();
repaint();
}
}
// ComponentListener interface
if (e.getSource() instanceof JDesktopPane) {
adjustSize();
}
}
if (e.getSource() instanceof JInternalFrame) {
adjustSize();
}
}
if (e.getSource() instanceof JInternalFrame) {
revalidate();
}
}
// ContainerListener interface
if (e.getChild() instanceof JInternalFrame) {
if (comp == desktopIcon) {
// We have it already
return;
}
}
f.addComponentListener(this);
if (getComponentCount() == 1) {
adjustSize();
}
}
}
if (e.getChild() instanceof JInternalFrame) {
if (!f.isIcon()) {
// Frame was removed without using setClosed(true)
remove(f.getDesktopIcon());
f.removeComponentListener(this);
revalidate();
repaint();
}
}
}
}
if (f.isIcon()) {
try {
f.setIcon(false);
} catch (PropertyVetoException e2) {
}
} else {
f.setNormalBounds(f.getBounds());
}
try {
f.setSelected(true);
} catch (PropertyVetoException e2) {
}
}
JDesktopPane d = f.getDesktopPane();
boolean findNext = f.isSelected();
if (c == null) {
return;
}
desktopIcon = f.getDesktopIcon();
if (!f.isMaximum()) {
f.setNormalBounds(f.getBounds());
}
c.remove(f);
try {
f.setSelected(false);
} catch (PropertyVetoException e2) {
}
// Get topmost of the remaining frames
if (findNext) {
if (comp instanceof JInternalFrame) {
try {
} catch (PropertyVetoException e2) {
}
return;
}
}
}
}
if (c != null) {
c = c.getParent();
if (c != null) {
c.add(f);
if (f.isMaximum()) {
int w = c.getWidth();
}
}
if (f.isSelected()) {
f.moveToFront();
} else {
try {
f.setSelected(true);
} catch (PropertyVetoException e2) {
}
}
}
}
}
super.removeIconFor(f);
}
}
}
}
/**
* @inheritDoc
*/
return getContext(c, getComponentState(c));
}
}
return SynthLookAndFeel.getComponentState(c);
}
/**
* Notifies this UI delegate to repaint the specified component.
* This method paints the component background, then calls
* the {@link #paint(SynthContext,Graphics)} method.
*
* <p>In general, this method does not need to be overridden by subclasses.
* All Look and Feel rendering code should reside in the {@code paint} method.
*
* @param g the {@code Graphics} object used for painting
* @param c the component being painted
* @see #paint(SynthContext,Graphics)
*/
}
/**
* Paints the specified component according to the Look and Feel.
* <p>This method is not used by Synth Look and Feel.
* Painting is handled by the {@link #paint(SynthContext,Graphics)} method.
*
* @param g the {@code Graphics} object used for painting
* @param c the component being painted
* @see #paint(SynthContext,Graphics)
*/
}
/**
* Paints the specified component. This implementation does nothing.
*
* @param context context for the component being painted
* @param g the {@code Graphics} object used for painting
* @see #update(Graphics,JComponent)
*/
}
/**
* @inheritDoc
*/
int y, int w, int h) {
}
/**
* @inheritDoc
*/
}
}
}
}