286N/A/*
286N/A * Copyright (c) 1998, 2001, Oracle and/or its affiliates. All rights reserved.
286N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
286N/A *
286N/A * This code is free software; you can redistribute it and/or modify it
286N/A * under the terms of the GNU General Public License version 2 only, as
286N/A * published by the Free Software Foundation. Oracle designates this
286N/A * particular file as subject to the "Classpath" exception as provided
286N/A * by Oracle in the LICENSE file that accompanied this code.
286N/A *
286N/A * This code is distributed in the hope that it will be useful, but WITHOUT
286N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
286N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
286N/A * version 2 for more details (a copy is included in the LICENSE file that
286N/A * accompanied this code).
286N/A *
286N/A * You should have received a copy of the GNU General Public License version
286N/A * 2 along with this work; if not, write to the Free Software Foundation,
286N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
286N/A *
286N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
286N/A * or visit www.oracle.com if you need additional information or have any
286N/A * questions.
286N/A */
286N/Apackage javax.swing.plaf.multi;
286N/A
286N/Aimport java.util.Vector;
286N/Aimport javax.swing.plaf.ColorChooserUI;
286N/Aimport javax.swing.plaf.ComponentUI;
286N/Aimport javax.swing.JComponent;
286N/Aimport java.awt.Graphics;
286N/Aimport java.awt.Dimension;
286N/Aimport javax.accessibility.Accessible;
286N/A
286N/A/**
286N/A * A multiplexing UI used to combine <code>ColorChooserUI</code>s.
286N/A *
286N/A * <p>This file was automatically generated by AutoMulti.
286N/A *
286N/A * @author Otto Multey
286N/A */
286N/Apublic class MultiColorChooserUI extends ColorChooserUI {
286N/A
286N/A /**
286N/A * The vector containing the real UIs. This is populated
286N/A * in the call to <code>createUI</code>, and can be obtained by calling
286N/A * the <code>getUIs</code> method. The first element is guaranteed to be the real UI
286N/A * obtained from the default look and feel.
286N/A */
286N/A protected Vector uis = new Vector();
286N/A
286N/A////////////////////
286N/A// Common UI methods
286N/A////////////////////
286N/A
286N/A /**
286N/A * Returns the list of UIs associated with this multiplexing UI. This
286N/A * allows processing of the UIs by an application aware of multiplexing
286N/A * UIs on components.
286N/A */
286N/A public ComponentUI[] getUIs() {
286N/A return MultiLookAndFeel.uisToArray(uis);
286N/A }
286N/A
286N/A////////////////////
286N/A// ColorChooserUI methods
286N/A////////////////////
286N/A
286N/A////////////////////
286N/A// ComponentUI methods
286N/A////////////////////
286N/A
286N/A /**
286N/A * Invokes the <code>contains</code> method on each UI handled by this object.
286N/A *
286N/A * @return the value obtained from the first UI, which is
286N/A * the UI obtained from the default <code>LookAndFeel</code>
286N/A */
286N/A public boolean contains(JComponent a, int b, int c) {
286N/A boolean returnValue =
286N/A ((ComponentUI) (uis.elementAt(0))).contains(a,b,c);
286N/A for (int i = 1; i < uis.size(); i++) {
286N/A ((ComponentUI) (uis.elementAt(i))).contains(a,b,c);
286N/A }
286N/A return returnValue;
286N/A }
286N/A
286N/A /**
286N/A * Invokes the <code>update</code> method on each UI handled by this object.
286N/A */
286N/A public void update(Graphics a, JComponent b) {
286N/A for (int i = 0; i < uis.size(); i++) {
286N/A ((ComponentUI) (uis.elementAt(i))).update(a,b);
286N/A }
286N/A }
286N/A
286N/A /**
286N/A * Returns a multiplexing UI instance if any of the auxiliary
286N/A * <code>LookAndFeel</code>s supports this UI. Otherwise, just returns the
286N/A * UI object obtained from the default <code>LookAndFeel</code>.
286N/A */
286N/A public static ComponentUI createUI(JComponent a) {
286N/A ComponentUI mui = new MultiColorChooserUI();
286N/A return MultiLookAndFeel.createUIs(mui,
286N/A ((MultiColorChooserUI) mui).uis,
286N/A a);
286N/A }
286N/A
286N/A /**
286N/A * Invokes the <code>installUI</code> method on each UI handled by this object.
286N/A */
286N/A public void installUI(JComponent a) {
286N/A for (int i = 0; i < uis.size(); i++) {
286N/A ((ComponentUI) (uis.elementAt(i))).installUI(a);
286N/A }
286N/A }
286N/A
286N/A /**
286N/A * Invokes the <code>uninstallUI</code> method on each UI handled by this object.
286N/A */
286N/A public void uninstallUI(JComponent a) {
286N/A for (int i = 0; i < uis.size(); i++) {
286N/A ((ComponentUI) (uis.elementAt(i))).uninstallUI(a);
286N/A }
286N/A }
286N/A
286N/A /**
286N/A * Invokes the <code>paint</code> method on each UI handled by this object.
286N/A */
286N/A public void paint(Graphics a, JComponent b) {
286N/A for (int i = 0; i < uis.size(); i++) {
286N/A ((ComponentUI) (uis.elementAt(i))).paint(a,b);
286N/A }
286N/A }
286N/A
286N/A /**
286N/A * Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
286N/A *
286N/A * @return the value obtained from the first UI, which is
286N/A * the UI obtained from the default <code>LookAndFeel</code>
286N/A */
286N/A public Dimension getPreferredSize(JComponent a) {
Dimension returnValue =
((ComponentUI) (uis.elementAt(0))).getPreferredSize(a);
for (int i = 1; i < uis.size(); i++) {
((ComponentUI) (uis.elementAt(i))).getPreferredSize(a);
}
return returnValue;
}
/**
* Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
*
* @return the value obtained from the first UI, which is
* the UI obtained from the default <code>LookAndFeel</code>
*/
public Dimension getMinimumSize(JComponent a) {
Dimension returnValue =
((ComponentUI) (uis.elementAt(0))).getMinimumSize(a);
for (int i = 1; i < uis.size(); i++) {
((ComponentUI) (uis.elementAt(i))).getMinimumSize(a);
}
return returnValue;
}
/**
* Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
*
* @return the value obtained from the first UI, which is
* the UI obtained from the default <code>LookAndFeel</code>
*/
public Dimension getMaximumSize(JComponent a) {
Dimension returnValue =
((ComponentUI) (uis.elementAt(0))).getMaximumSize(a);
for (int i = 1; i < uis.size(); i++) {
((ComponentUI) (uis.elementAt(i))).getMaximumSize(a);
}
return returnValue;
}
/**
* Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
*
* @return the value obtained from the first UI, which is
* the UI obtained from the default <code>LookAndFeel</code>
*/
public int getAccessibleChildrenCount(JComponent a) {
int returnValue =
((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a);
for (int i = 1; i < uis.size(); i++) {
((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a);
}
return returnValue;
}
/**
* Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
*
* @return the value obtained from the first UI, which is
* the UI obtained from the default <code>LookAndFeel</code>
*/
public Accessible getAccessibleChild(JComponent a, int b) {
Accessible returnValue =
((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b);
for (int i = 1; i < uis.size(); i++) {
((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b);
}
return returnValue;
}
}