KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > swing > plaf > multi > MultiTabbedPaneUI


1 /*
2  * @(#)MultiTabbedPaneUI.java 1.28 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7 package javax.swing.plaf.multi;
8
9 import java.util.Vector JavaDoc;
10 import javax.swing.plaf.TabbedPaneUI JavaDoc;
11 import javax.swing.JTabbedPane JavaDoc;
12 import java.awt.Rectangle JavaDoc;
13 import javax.swing.plaf.ComponentUI JavaDoc;
14 import javax.swing.JComponent JavaDoc;
15 import java.awt.Graphics JavaDoc;
16 import java.awt.Dimension JavaDoc;
17 import javax.accessibility.Accessible JavaDoc;
18
19 /**
20  * A multiplexing UI used to combine <code>TabbedPaneUI</code>s.
21  *
22  * <p>This file was automatically generated by AutoMulti.
23  *
24  * @version 1.28 12/19/03 17:39:42
25  * @author Otto Multey
26  */

27 public class MultiTabbedPaneUI extends TabbedPaneUI JavaDoc {
28
29     /**
30      * The vector containing the real UIs. This is populated
31      * in the call to <code>createUI</code>, and can be obtained by calling
32      * the <code>getUIs</code> method. The first element is guaranteed to be the real UI
33      * obtained from the default look and feel.
34      */

35     protected Vector JavaDoc uis = new Vector JavaDoc();
36
37 ////////////////////
38
// Common UI methods
39
////////////////////
40

41     /**
42      * Returns the list of UIs associated with this multiplexing UI. This
43      * allows processing of the UIs by an application aware of multiplexing
44      * UIs on components.
45      */

46     public ComponentUI JavaDoc[] getUIs() {
47         return MultiLookAndFeel.uisToArray(uis);
48     }
49
50 ////////////////////
51
// TabbedPaneUI methods
52
////////////////////
53

54     /**
55      * Invokes the <code>tabForCoordinate</code> method on each UI handled by this object.
56      *
57      * @return the value obtained from the first UI, which is
58      * the UI obtained from the default <code>LookAndFeel</code>
59      */

60     public int tabForCoordinate(JTabbedPane JavaDoc a, int b, int c) {
61         int returnValue =
62             ((TabbedPaneUI JavaDoc) (uis.elementAt(0))).tabForCoordinate(a,b,c);
63         for (int i = 1; i < uis.size(); i++) {
64             ((TabbedPaneUI JavaDoc) (uis.elementAt(i))).tabForCoordinate(a,b,c);
65         }
66         return returnValue;
67     }
68
69     /**
70      * Invokes the <code>getTabBounds</code> method on each UI handled by this object.
71      *
72      * @return the value obtained from the first UI, which is
73      * the UI obtained from the default <code>LookAndFeel</code>
74      */

75     public Rectangle JavaDoc getTabBounds(JTabbedPane JavaDoc a, int b) {
76         Rectangle JavaDoc returnValue =
77             ((TabbedPaneUI JavaDoc) (uis.elementAt(0))).getTabBounds(a,b);
78         for (int i = 1; i < uis.size(); i++) {
79             ((TabbedPaneUI JavaDoc) (uis.elementAt(i))).getTabBounds(a,b);
80         }
81         return returnValue;
82     }
83
84     /**
85      * Invokes the <code>getTabRunCount</code> method on each UI handled by this object.
86      *
87      * @return the value obtained from the first UI, which is
88      * the UI obtained from the default <code>LookAndFeel</code>
89      */

90     public int getTabRunCount(JTabbedPane JavaDoc a) {
91         int returnValue =
92             ((TabbedPaneUI JavaDoc) (uis.elementAt(0))).getTabRunCount(a);
93         for (int i = 1; i < uis.size(); i++) {
94             ((TabbedPaneUI JavaDoc) (uis.elementAt(i))).getTabRunCount(a);
95         }
96         return returnValue;
97     }
98
99 ////////////////////
100
// ComponentUI methods
101
////////////////////
102

103     /**
104      * Invokes the <code>contains</code> method on each UI handled by this object.
105      *
106      * @return the value obtained from the first UI, which is
107      * the UI obtained from the default <code>LookAndFeel</code>
108      */

109     public boolean contains(JComponent JavaDoc a, int b, int c) {
110         boolean returnValue =
111             ((ComponentUI JavaDoc) (uis.elementAt(0))).contains(a,b,c);
112         for (int i = 1; i < uis.size(); i++) {
113             ((ComponentUI JavaDoc) (uis.elementAt(i))).contains(a,b,c);
114         }
115         return returnValue;
116     }
117
118     /**
119      * Invokes the <code>update</code> method on each UI handled by this object.
120      */

121     public void update(Graphics JavaDoc a, JComponent JavaDoc b) {
122         for (int i = 0; i < uis.size(); i++) {
123             ((ComponentUI JavaDoc) (uis.elementAt(i))).update(a,b);
124         }
125     }
126
127     /**
128      * Returns a multiplexing UI instance if any of the auxiliary
129      * <code>LookAndFeel</code>s supports this UI. Otherwise, just returns the
130      * UI object obtained from the default <code>LookAndFeel</code>.
131      */

132     public static ComponentUI JavaDoc createUI(JComponent JavaDoc a) {
133         ComponentUI JavaDoc mui = new MultiTabbedPaneUI JavaDoc();
134         return MultiLookAndFeel.createUIs(mui,
135                                           ((MultiTabbedPaneUI JavaDoc) mui).uis,
136                                           a);
137     }
138
139     /**
140      * Invokes the <code>installUI</code> method on each UI handled by this object.
141      */

142     public void installUI(JComponent JavaDoc a) {
143         for (int i = 0; i < uis.size(); i++) {
144             ((ComponentUI JavaDoc) (uis.elementAt(i))).installUI(a);
145         }
146     }
147
148     /**
149      * Invokes the <code>uninstallUI</code> method on each UI handled by this object.
150      */

151     public void uninstallUI(JComponent JavaDoc a) {
152         for (int i = 0; i < uis.size(); i++) {
153             ((ComponentUI JavaDoc) (uis.elementAt(i))).uninstallUI(a);
154         }
155     }
156
157     /**
158      * Invokes the <code>paint</code> method on each UI handled by this object.
159      */

160     public void paint(Graphics JavaDoc a, JComponent JavaDoc b) {
161         for (int i = 0; i < uis.size(); i++) {
162             ((ComponentUI JavaDoc) (uis.elementAt(i))).paint(a,b);
163         }
164     }
165
166     /**
167      * Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
168      *
169      * @return the value obtained from the first UI, which is
170      * the UI obtained from the default <code>LookAndFeel</code>
171      */

172     public Dimension JavaDoc getPreferredSize(JComponent JavaDoc a) {
173         Dimension JavaDoc returnValue =
174             ((ComponentUI JavaDoc) (uis.elementAt(0))).getPreferredSize(a);
175         for (int i = 1; i < uis.size(); i++) {
176             ((ComponentUI JavaDoc) (uis.elementAt(i))).getPreferredSize(a);
177         }
178         return returnValue;
179     }
180
181     /**
182      * Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
183      *
184      * @return the value obtained from the first UI, which is
185      * the UI obtained from the default <code>LookAndFeel</code>
186      */

187     public Dimension JavaDoc getMinimumSize(JComponent JavaDoc a) {
188         Dimension JavaDoc returnValue =
189             ((ComponentUI JavaDoc) (uis.elementAt(0))).getMinimumSize(a);
190         for (int i = 1; i < uis.size(); i++) {
191             ((ComponentUI JavaDoc) (uis.elementAt(i))).getMinimumSize(a);
192         }
193         return returnValue;
194     }
195
196     /**
197      * Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
198      *
199      * @return the value obtained from the first UI, which is
200      * the UI obtained from the default <code>LookAndFeel</code>
201      */

202     public Dimension JavaDoc getMaximumSize(JComponent JavaDoc a) {
203         Dimension JavaDoc returnValue =
204             ((ComponentUI JavaDoc) (uis.elementAt(0))).getMaximumSize(a);
205         for (int i = 1; i < uis.size(); i++) {
206             ((ComponentUI JavaDoc) (uis.elementAt(i))).getMaximumSize(a);
207         }
208         return returnValue;
209     }
210
211     /**
212      * Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
213      *
214      * @return the value obtained from the first UI, which is
215      * the UI obtained from the default <code>LookAndFeel</code>
216      */

217     public int getAccessibleChildrenCount(JComponent JavaDoc a) {
218         int returnValue =
219             ((ComponentUI JavaDoc) (uis.elementAt(0))).getAccessibleChildrenCount(a);
220         for (int i = 1; i < uis.size(); i++) {
221             ((ComponentUI JavaDoc) (uis.elementAt(i))).getAccessibleChildrenCount(a);
222         }
223         return returnValue;
224     }
225
226     /**
227      * Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
228      *
229      * @return the value obtained from the first UI, which is
230      * the UI obtained from the default <code>LookAndFeel</code>
231      */

232     public Accessible JavaDoc getAccessibleChild(JComponent JavaDoc a, int b) {
233         Accessible JavaDoc returnValue =
234             ((ComponentUI JavaDoc) (uis.elementAt(0))).getAccessibleChild(a,b);
235         for (int i = 1; i < uis.size(); i++) {
236             ((ComponentUI JavaDoc) (uis.elementAt(i))).getAccessibleChild(a,b);
237         }
238         return returnValue;
239     }
240 }
241
Popular Tags