home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1998 November
/
Chip_1998-11_cd.bin
/
tema
/
Cafe
/
jfc.bin
/
MultiProgressBarUI.java
< prev
next >
Wrap
Text File
|
1998-02-26
|
4KB
|
122 lines
/*
* @(#)MultiProgressBarUI.java 1.11 98/02/02
*
* Copyright (c) 1997 Sun Microsystems, Inc. All Rights Reserved.
*
* This software is the confidential and proprietary information of Sun
* Microsystems, Inc. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only in
* accordance with the terms of the license agreement you entered into
* with Sun.
*
* SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
* SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
* SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
* THIS SOFTWARE OR ITS DERIVATIVES.
*
*/
package com.sun.java.swing.plaf.multi;
import java.util.Vector;
import java.io.Serializable;
import com.sun.java.swing.*;
import java.awt.*;
import com.sun.java.swing.plaf.*;
/**
* MultiProgressBarUI implementation
* <p>
* Warning: serialized objects of this class will not be compatible with
* future swing releases. The current serialization support is appropriate
* for short term storage or RMI between Swing1.0 applications. It will
* not be possible to load serialized Swing1.0 objects with future releases
* of Swing. The JDK1.2 release of Swing will be the compatibility
* baseline for the serialized form of Swing objects.
*
* @version 1.11 02/02/98
* @author Willie Walker
*/
public class MultiProgressBarUI extends ProgressBarUI
implements Serializable {
/**
* The Vector containing the real UI's. This is populated
* in the call to createUI, and can be obtained by calling
* getUIs. The first element is guaranteed to the real UI
* obtained from the default look and feel.
*/
protected Vector uis = new Vector();
////////////////////
// Common UI methods
////////////////////
public static ComponentUI createUI(JComponent c) {
ComponentUI mui = new MultiProgressBarUI();
return MultiLookAndFeel.createUIs(mui,
((MultiProgressBarUI) mui).uis,
c);
}
/**
* Return the list of UI's associated with this multiplexing UI. This
* allows processing of the UI's by an application aware of multiplexing
* UI's on components.
*/
public ComponentUI[] getUIs() {
return MultiLookAndFeel.uisToArray(uis);
}
//////////////////////
// ComponentUI methods
//////////////////////
public void installUI(JComponent c) {
for (int i = 0; i < uis.size(); i++) {
((ComponentUI) (uis.elementAt(i))).installUI(c);
}
}
public void uninstallUI(JComponent c) {
for (int i = 0; i < uis.size(); i++) {
((ComponentUI) (uis.elementAt(i))).uninstallUI(c);
}
}
public void paint(Graphics g, JComponent c) {
for (int i = 0; i < uis.size(); i++) {
((ComponentUI) (uis.elementAt(i))).paint(g,c);
}
}
public void update(Graphics g, JComponent c) {
for (int i = 0; i < uis.size(); i++) {
((ComponentUI) (uis.elementAt(i))).update(g,c);
}
}
public Dimension getPreferredSize(JComponent c) {
return ((ComponentUI) (uis.elementAt(0))).getPreferredSize(c);
}
public Dimension getMinimumSize(JComponent c) {
return ((ComponentUI) (uis.elementAt(0))).getMinimumSize(c);
}
public Dimension getMaximumSize(JComponent c) {
return ((ComponentUI) (uis.elementAt(0))).getMaximumSize(c);
}
public boolean contains(JComponent c, int x, int y) {
return ((ComponentUI) (uis.elementAt(0))).contains(c,x,y);
}
////////////////////////
// ProgressBarUI methods
////////////////////////
}