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