jdk/src/share/classes/javax/swing/plaf/multi/MultiTreeUI.java
author lana
Thu, 26 Dec 2013 12:04:16 -0800
changeset 23010 6dadb192ad81
parent 5506 202f599c92aa
child 25152 4459bf7dab0b
permissions -rw-r--r--
8029235: Update copyright year to match last edit in jdk8 jdk repository for 2013 Summary: updated files with 2011, 2012 and 2013 years according to the file's last updated date Reviewed-by: tbell, lancea, chegar
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     2
 * Copyright (c) 1997, 2001, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
package javax.swing.plaf.multi;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
import java.util.Vector;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import javax.swing.plaf.TreeUI;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import java.awt.Rectangle;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import javax.swing.JTree;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import javax.swing.tree.TreePath;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import javax.swing.plaf.ComponentUI;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
import javax.swing.JComponent;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
import java.awt.Graphics;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
import java.awt.Dimension;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
import javax.accessibility.Accessible;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * A multiplexing UI used to combine <code>TreeUI</code>s.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * <p>This file was automatically generated by AutoMulti.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * @author  Otto Multey
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
public class MultiTreeUI extends TreeUI {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
     * The vector containing the real UIs.  This is populated
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
     * in the call to <code>createUI</code>, and can be obtained by calling
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
     * the <code>getUIs</code> method.  The first element is guaranteed to be the real UI
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
     * obtained from the default look and feel.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
    protected Vector uis = new Vector();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
////////////////////
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
// Common UI methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
////////////////////
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
     * Returns the list of UIs associated with this multiplexing UI.  This
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
     * allows processing of the UIs by an application aware of multiplexing
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
     * UIs on components.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    public ComponentUI[] getUIs() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
        return MultiLookAndFeel.uisToArray(uis);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
////////////////////
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
// TreeUI methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
////////////////////
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
     * Invokes the <code>getPathBounds</code> method on each UI handled by this object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
     * @return the value obtained from the first UI, which is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
     * the UI obtained from the default <code>LookAndFeel</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
    public Rectangle getPathBounds(JTree a, TreePath b) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
        Rectangle returnValue =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
            ((TreeUI) (uis.elementAt(0))).getPathBounds(a,b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
        for (int i = 1; i < uis.size(); i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
            ((TreeUI) (uis.elementAt(i))).getPathBounds(a,b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
        return returnValue;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
     * Invokes the <code>getPathForRow</code> method on each UI handled by this object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
     * @return the value obtained from the first UI, which is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     * the UI obtained from the default <code>LookAndFeel</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
    public TreePath getPathForRow(JTree a, int b) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
        TreePath returnValue =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
            ((TreeUI) (uis.elementAt(0))).getPathForRow(a,b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
        for (int i = 1; i < uis.size(); i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
            ((TreeUI) (uis.elementAt(i))).getPathForRow(a,b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
        return returnValue;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
     * Invokes the <code>getRowForPath</code> method on each UI handled by this object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
     * @return the value obtained from the first UI, which is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
     * the UI obtained from the default <code>LookAndFeel</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
    public int getRowForPath(JTree a, TreePath b) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
        int returnValue =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
            ((TreeUI) (uis.elementAt(0))).getRowForPath(a,b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
        for (int i = 1; i < uis.size(); i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
            ((TreeUI) (uis.elementAt(i))).getRowForPath(a,b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
        return returnValue;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
     * Invokes the <code>getRowCount</code> method on each UI handled by this object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
     * @return the value obtained from the first UI, which is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
     * the UI obtained from the default <code>LookAndFeel</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
    public int getRowCount(JTree a) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
        int returnValue =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
            ((TreeUI) (uis.elementAt(0))).getRowCount(a);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
        for (int i = 1; i < uis.size(); i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
            ((TreeUI) (uis.elementAt(i))).getRowCount(a);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
        return returnValue;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
     * Invokes the <code>getClosestPathForLocation</code> method on each UI handled by this object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
     * @return the value obtained from the first UI, which is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
     * the UI obtained from the default <code>LookAndFeel</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
    public TreePath getClosestPathForLocation(JTree a, int b, int c) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
        TreePath returnValue =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
            ((TreeUI) (uis.elementAt(0))).getClosestPathForLocation(a,b,c);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
        for (int i = 1; i < uis.size(); i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
            ((TreeUI) (uis.elementAt(i))).getClosestPathForLocation(a,b,c);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
        return returnValue;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     * Invokes the <code>isEditing</code> method on each UI handled by this object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
     * @return the value obtained from the first UI, which is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
     * the UI obtained from the default <code>LookAndFeel</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
    public boolean isEditing(JTree a) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
        boolean returnValue =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
            ((TreeUI) (uis.elementAt(0))).isEditing(a);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
        for (int i = 1; i < uis.size(); i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
            ((TreeUI) (uis.elementAt(i))).isEditing(a);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
        return returnValue;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
     * Invokes the <code>stopEditing</code> method on each UI handled by this object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
     * @return the value obtained from the first UI, which is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
     * the UI obtained from the default <code>LookAndFeel</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
    public boolean stopEditing(JTree a) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
        boolean returnValue =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
            ((TreeUI) (uis.elementAt(0))).stopEditing(a);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
        for (int i = 1; i < uis.size(); i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
            ((TreeUI) (uis.elementAt(i))).stopEditing(a);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
        return returnValue;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
     * Invokes the <code>cancelEditing</code> method on each UI handled by this object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
    public void cancelEditing(JTree a) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
        for (int i = 0; i < uis.size(); i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
            ((TreeUI) (uis.elementAt(i))).cancelEditing(a);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
     * Invokes the <code>startEditingAtPath</code> method on each UI handled by this object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
    public void startEditingAtPath(JTree a, TreePath b) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
        for (int i = 0; i < uis.size(); i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
            ((TreeUI) (uis.elementAt(i))).startEditingAtPath(a,b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
     * Invokes the <code>getEditingPath</code> method on each UI handled by this object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
     * @return the value obtained from the first UI, which is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
     * the UI obtained from the default <code>LookAndFeel</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
    public TreePath getEditingPath(JTree a) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
        TreePath returnValue =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
            ((TreeUI) (uis.elementAt(0))).getEditingPath(a);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
        for (int i = 1; i < uis.size(); i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
            ((TreeUI) (uis.elementAt(i))).getEditingPath(a);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
        return returnValue;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
////////////////////
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
// ComponentUI methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
////////////////////
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
     * Invokes the <code>contains</code> method on each UI handled by this object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
     * @return the value obtained from the first UI, which is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
     * the UI obtained from the default <code>LookAndFeel</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
    public boolean contains(JComponent a, int b, int c) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
        boolean returnValue =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
            ((ComponentUI) (uis.elementAt(0))).contains(a,b,c);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
        for (int i = 1; i < uis.size(); i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
            ((ComponentUI) (uis.elementAt(i))).contains(a,b,c);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
        return returnValue;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
     * Invokes the <code>update</code> method on each UI handled by this object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
    public void update(Graphics a, JComponent b) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
        for (int i = 0; i < uis.size(); i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
            ((ComponentUI) (uis.elementAt(i))).update(a,b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
     * Returns a multiplexing UI instance if any of the auxiliary
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
     * <code>LookAndFeel</code>s supports this UI.  Otherwise, just returns the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
     * UI object obtained from the default <code>LookAndFeel</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
    public static ComponentUI createUI(JComponent a) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
        ComponentUI mui = new MultiTreeUI();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
        return MultiLookAndFeel.createUIs(mui,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
                                          ((MultiTreeUI) mui).uis,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
                                          a);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
     * Invokes the <code>installUI</code> method on each UI handled by this object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
    public void installUI(JComponent a) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
        for (int i = 0; i < uis.size(); i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
            ((ComponentUI) (uis.elementAt(i))).installUI(a);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
     * Invokes the <code>uninstallUI</code> method on each UI handled by this object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
    public void uninstallUI(JComponent a) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
        for (int i = 0; i < uis.size(); i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
            ((ComponentUI) (uis.elementAt(i))).uninstallUI(a);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
     * Invokes the <code>paint</code> method on each UI handled by this object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
    public void paint(Graphics a, JComponent b) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
        for (int i = 0; i < uis.size(); i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
            ((ComponentUI) (uis.elementAt(i))).paint(a,b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
     * Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
     * @return the value obtained from the first UI, which is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
     * the UI obtained from the default <code>LookAndFeel</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
    public Dimension getPreferredSize(JComponent a) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
        Dimension returnValue =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
            ((ComponentUI) (uis.elementAt(0))).getPreferredSize(a);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
        for (int i = 1; i < uis.size(); i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
            ((ComponentUI) (uis.elementAt(i))).getPreferredSize(a);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
        return returnValue;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
     * Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
     * @return the value obtained from the first UI, which is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
     * the UI obtained from the default <code>LookAndFeel</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
    public Dimension getMinimumSize(JComponent a) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
        Dimension returnValue =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
            ((ComponentUI) (uis.elementAt(0))).getMinimumSize(a);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
        for (int i = 1; i < uis.size(); i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
            ((ComponentUI) (uis.elementAt(i))).getMinimumSize(a);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
        return returnValue;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
     * Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
     * @return the value obtained from the first UI, which is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
     * the UI obtained from the default <code>LookAndFeel</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
    public Dimension getMaximumSize(JComponent a) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
        Dimension returnValue =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
            ((ComponentUI) (uis.elementAt(0))).getMaximumSize(a);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
        for (int i = 1; i < uis.size(); i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
            ((ComponentUI) (uis.elementAt(i))).getMaximumSize(a);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
        return returnValue;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
     * Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
     * @return the value obtained from the first UI, which is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
     * the UI obtained from the default <code>LookAndFeel</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
    public int getAccessibleChildrenCount(JComponent a) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
        int returnValue =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
            ((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
        for (int i = 1; i < uis.size(); i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
            ((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
        return returnValue;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
     * Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
     * @return the value obtained from the first UI, which is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
     * the UI obtained from the default <code>LookAndFeel</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
    public Accessible getAccessibleChild(JComponent a, int b) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
        Accessible returnValue =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
            ((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
        for (int i = 1; i < uis.size(); i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
            ((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
        return returnValue;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
}