KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * @(#)MultiSplitPaneUI.java 1.27 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.SplitPaneUI JavaDoc;
11 import javax.swing.JSplitPane JavaDoc;
12 import java.awt.Graphics JavaDoc;
13 import javax.swing.plaf.ComponentUI JavaDoc;
14 import javax.swing.JComponent JavaDoc;
15 import java.awt.Dimension JavaDoc;
16 import javax.accessibility.Accessible JavaDoc;
17
18 /**
19  * A multiplexing UI used to combine <code>SplitPaneUI</code>s.
20  *
21  * <p>This file was automatically generated by AutoMulti.
22  *
23  * @version 1.27 12/19/03 17:39:42
24  * @author Otto Multey
25  */

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

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

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

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

53     /**
54      * Invokes the <code>resetToPreferredSizes</code> method on each UI handled by this object.
55      */

56     public void resetToPreferredSizes(JSplitPane JavaDoc a) {
57         for (int i = 0; i < uis.size(); i++) {
58             ((SplitPaneUI JavaDoc) (uis.elementAt(i))).resetToPreferredSizes(a);
59         }
60     }
61
62     /**
63      * Invokes the <code>setDividerLocation</code> method on each UI handled by this object.
64      */

65     public void setDividerLocation(JSplitPane JavaDoc a, int b) {
66         for (int i = 0; i < uis.size(); i++) {
67             ((SplitPaneUI JavaDoc) (uis.elementAt(i))).setDividerLocation(a,b);
68         }
69     }
70
71     /**
72      * Invokes the <code>getDividerLocation</code> method on each UI handled by this object.
73      *
74      * @return the value obtained from the first UI, which is
75      * the UI obtained from the default <code>LookAndFeel</code>
76      */

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

92     public int getMinimumDividerLocation(JSplitPane JavaDoc a) {
93         int returnValue =
94             ((SplitPaneUI JavaDoc) (uis.elementAt(0))).getMinimumDividerLocation(a);
95         for (int i = 1; i < uis.size(); i++) {
96             ((SplitPaneUI JavaDoc) (uis.elementAt(i))).getMinimumDividerLocation(a);
97         }
98         return returnValue;
99     }
100
101     /**
102      * Invokes the <code>getMaximumDividerLocation</code> method on each UI handled by this object.
103      *
104      * @return the value obtained from the first UI, which is
105      * the UI obtained from the default <code>LookAndFeel</code>
106      */

107     public int getMaximumDividerLocation(JSplitPane JavaDoc a) {
108         int returnValue =
109             ((SplitPaneUI JavaDoc) (uis.elementAt(0))).getMaximumDividerLocation(a);
110         for (int i = 1; i < uis.size(); i++) {
111             ((SplitPaneUI JavaDoc) (uis.elementAt(i))).getMaximumDividerLocation(a);
112         }
113         return returnValue;
114     }
115
116     /**
117      * Invokes the <code>finishedPaintingChildren</code> method on each UI handled by this object.
118      */

119     public void finishedPaintingChildren(JSplitPane JavaDoc a, Graphics JavaDoc b) {
120         for (int i = 0; i < uis.size(); i++) {
121             ((SplitPaneUI JavaDoc) (uis.elementAt(i))).finishedPaintingChildren(a,b);
122         }
123     }
124
125 ////////////////////
126
// ComponentUI methods
127
////////////////////
128

129     /**
130      * Invokes the <code>contains</code> method on each UI handled by this object.
131      *
132      * @return the value obtained from the first UI, which is
133      * the UI obtained from the default <code>LookAndFeel</code>
134      */

135     public boolean contains(JComponent JavaDoc a, int b, int c) {
136         boolean returnValue =
137             ((ComponentUI JavaDoc) (uis.elementAt(0))).contains(a,b,c);
138         for (int i = 1; i < uis.size(); i++) {
139             ((ComponentUI JavaDoc) (uis.elementAt(i))).contains(a,b,c);
140         }
141         return returnValue;
142     }
143
144     /**
145      * Invokes the <code>update</code> method on each UI handled by this object.
146      */

147     public void update(Graphics JavaDoc a, JComponent JavaDoc b) {
148         for (int i = 0; i < uis.size(); i++) {
149             ((ComponentUI JavaDoc) (uis.elementAt(i))).update(a,b);
150         }
151     }
152
153     /**
154      * Returns a multiplexing UI instance if any of the auxiliary
155      * <code>LookAndFeel</code>s supports this UI. Otherwise, just returns the
156      * UI object obtained from the default <code>LookAndFeel</code>.
157      */

158     public static ComponentUI JavaDoc createUI(JComponent JavaDoc a) {
159         ComponentUI JavaDoc mui = new MultiSplitPaneUI JavaDoc();
160         return MultiLookAndFeel.createUIs(mui,
161                                           ((MultiSplitPaneUI JavaDoc) mui).uis,
162                                           a);
163     }
164
165     /**
166      * Invokes the <code>installUI</code> method on each UI handled by this object.
167      */

168     public void installUI(JComponent JavaDoc a) {
169         for (int i = 0; i < uis.size(); i++) {
170             ((ComponentUI JavaDoc) (uis.elementAt(i))).installUI(a);
171         }
172     }
173
174     /**
175      * Invokes the <code>uninstallUI</code> method on each UI handled by this object.
176      */

177     public void uninstallUI(JComponent JavaDoc a) {
178         for (int i = 0; i < uis.size(); i++) {
179             ((ComponentUI JavaDoc) (uis.elementAt(i))).uninstallUI(a);
180         }
181     }
182
183     /**
184      * Invokes the <code>paint</code> method on each UI handled by this object.
185      */

186     public void paint(Graphics JavaDoc a, JComponent JavaDoc b) {
187         for (int i = 0; i < uis.size(); i++) {
188             ((ComponentUI JavaDoc) (uis.elementAt(i))).paint(a,b);
189         }
190     }
191
192     /**
193      * Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
194      *
195      * @return the value obtained from the first UI, which is
196      * the UI obtained from the default <code>LookAndFeel</code>
197      */

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

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

228     public Dimension JavaDoc getMaximumSize(JComponent JavaDoc a) {
229         Dimension JavaDoc returnValue =
230             ((ComponentUI JavaDoc) (uis.elementAt(0))).getMaximumSize(a);
231         for (int i = 1; i < uis.size(); i++) {
232             ((ComponentUI JavaDoc) (uis.elementAt(i))).getMaximumSize(a);
233         }
234         return returnValue;
235     }
236
237     /**
238      * Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
239      *
240      * @return the value obtained from the first UI, which is
241      * the UI obtained from the default <code>LookAndFeel</code>
242      */

243     public int getAccessibleChildrenCount(JComponent JavaDoc a) {
244         int returnValue =
245             ((ComponentUI JavaDoc) (uis.elementAt(0))).getAccessibleChildrenCount(a);
246         for (int i = 1; i < uis.size(); i++) {
247             ((ComponentUI JavaDoc) (uis.elementAt(i))).getAccessibleChildrenCount(a);
248         }
249         return returnValue;
250     }
251
252     /**
253      * Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
254      *
255      * @return the value obtained from the first UI, which is
256      * the UI obtained from the default <code>LookAndFeel</code>
257      */

258     public Accessible JavaDoc getAccessibleChild(JComponent JavaDoc a, int b) {
259         Accessible JavaDoc returnValue =
260             ((ComponentUI JavaDoc) (uis.elementAt(0))).getAccessibleChild(a,b);
261         for (int i = 1; i < uis.size(); i++) {
262             ((ComponentUI JavaDoc) (uis.elementAt(i))).getAccessibleChild(a,b);
263         }
264         return returnValue;
265     }
266 }
267
Popular Tags