38 import javax.swing.JComponent;
39 import java.awt.Graphics;
40 import java.awt.Dimension;
41 import javax.accessibility.Accessible;
42
43 /**
44 * A multiplexing UI used to combine <code>TextUI</code>s.
45 *
46 * <p>This file was automatically generated by AutoMulti.
47 *
48 * @author Otto Multey
49 */
50 public class MultiTextUI extends TextUI {
51
52 /**
53 * The vector containing the real UIs. This is populated
54 * in the call to <code>createUI</code>, and can be obtained by calling
55 * the <code>getUIs</code> method. The first element is guaranteed to be the real UI
56 * obtained from the default look and feel.
57 */
58 protected Vector uis = new Vector();
59
60 ////////////////////
61 // Common UI methods
62 ////////////////////
63
64 /**
65 * Returns the list of UIs associated with this multiplexing UI. This
66 * allows processing of the UIs by an application aware of multiplexing
67 * UIs on components.
68 *
69 * @return an array of the UI delegates
70 */
71 public ComponentUI[] getUIs() {
72 return MultiLookAndFeel.uisToArray(uis);
73 }
74
75 ////////////////////
76 // TextUI methods
77 ////////////////////
78
213 View returnValue =
214 ((TextUI) (uis.elementAt(0))).getRootView(a);
215 for (int i = 1; i < uis.size(); i++) {
216 ((TextUI) (uis.elementAt(i))).getRootView(a);
217 }
218 return returnValue;
219 }
220
221 ////////////////////
222 // ComponentUI methods
223 ////////////////////
224
225 /**
226 * Invokes the <code>contains</code> method on each UI handled by this object.
227 *
228 * @return the value obtained from the first UI, which is
229 * the UI obtained from the default <code>LookAndFeel</code>
230 */
231 public boolean contains(JComponent a, int b, int c) {
232 boolean returnValue =
233 ((ComponentUI) (uis.elementAt(0))).contains(a,b,c);
234 for (int i = 1; i < uis.size(); i++) {
235 ((ComponentUI) (uis.elementAt(i))).contains(a,b,c);
236 }
237 return returnValue;
238 }
239
240 /**
241 * Invokes the <code>update</code> method on each UI handled by this object.
242 */
243 public void update(Graphics a, JComponent b) {
244 for (int i = 0; i < uis.size(); i++) {
245 ((ComponentUI) (uis.elementAt(i))).update(a,b);
246 }
247 }
248
249 /**
250 * Returns a multiplexing UI instance if any of the auxiliary
251 * <code>LookAndFeel</code>s supports this UI. Otherwise, just returns the
252 * UI object obtained from the default <code>LookAndFeel</code>.
253 *
254 * @param a the component to create the UI for
255 * @return the UI delegate created
256 */
257 public static ComponentUI createUI(JComponent a) {
258 ComponentUI mui = new MultiTextUI();
259 return MultiLookAndFeel.createUIs(mui,
260 ((MultiTextUI) mui).uis,
261 a);
262 }
263
264 /**
265 * Invokes the <code>installUI</code> method on each UI handled by this object.
266 */
267 public void installUI(JComponent a) {
268 for (int i = 0; i < uis.size(); i++) {
269 ((ComponentUI) (uis.elementAt(i))).installUI(a);
270 }
271 }
272
273 /**
274 * Invokes the <code>uninstallUI</code> method on each UI handled by this object.
275 */
276 public void uninstallUI(JComponent a) {
277 for (int i = 0; i < uis.size(); i++) {
278 ((ComponentUI) (uis.elementAt(i))).uninstallUI(a);
279 }
280 }
281
282 /**
283 * Invokes the <code>paint</code> method on each UI handled by this object.
284 */
285 public void paint(Graphics a, JComponent b) {
286 for (int i = 0; i < uis.size(); i++) {
287 ((ComponentUI) (uis.elementAt(i))).paint(a,b);
288 }
289 }
290
291 /**
292 * Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
293 *
294 * @return the value obtained from the first UI, which is
295 * the UI obtained from the default <code>LookAndFeel</code>
296 */
297 public Dimension getPreferredSize(JComponent a) {
298 Dimension returnValue =
299 ((ComponentUI) (uis.elementAt(0))).getPreferredSize(a);
300 for (int i = 1; i < uis.size(); i++) {
301 ((ComponentUI) (uis.elementAt(i))).getPreferredSize(a);
302 }
303 return returnValue;
304 }
305
306 /**
307 * Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
308 *
309 * @return the value obtained from the first UI, which is
310 * the UI obtained from the default <code>LookAndFeel</code>
311 */
312 public Dimension getMinimumSize(JComponent a) {
313 Dimension returnValue =
314 ((ComponentUI) (uis.elementAt(0))).getMinimumSize(a);
315 for (int i = 1; i < uis.size(); i++) {
316 ((ComponentUI) (uis.elementAt(i))).getMinimumSize(a);
317 }
318 return returnValue;
319 }
320
321 /**
322 * Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
323 *
324 * @return the value obtained from the first UI, which is
325 * the UI obtained from the default <code>LookAndFeel</code>
326 */
327 public Dimension getMaximumSize(JComponent a) {
328 Dimension returnValue =
329 ((ComponentUI) (uis.elementAt(0))).getMaximumSize(a);
330 for (int i = 1; i < uis.size(); i++) {
331 ((ComponentUI) (uis.elementAt(i))).getMaximumSize(a);
332 }
333 return returnValue;
334 }
335
336 /**
337 * Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
338 *
339 * @return the value obtained from the first UI, which is
340 * the UI obtained from the default <code>LookAndFeel</code>
341 */
342 public int getAccessibleChildrenCount(JComponent a) {
343 int returnValue =
344 ((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a);
345 for (int i = 1; i < uis.size(); i++) {
346 ((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a);
347 }
348 return returnValue;
349 }
350
351 /**
352 * Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
353 *
354 * @return the value obtained from the first UI, which is
355 * the UI obtained from the default <code>LookAndFeel</code>
356 */
357 public Accessible getAccessibleChild(JComponent a, int b) {
358 Accessible returnValue =
359 ((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b);
360 for (int i = 1; i < uis.size(); i++) {
361 ((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b);
362 }
363 return returnValue;
364 }
365 }
|
38 import javax.swing.JComponent;
39 import java.awt.Graphics;
40 import java.awt.Dimension;
41 import javax.accessibility.Accessible;
42
43 /**
44 * A multiplexing UI used to combine <code>TextUI</code>s.
45 *
46 * <p>This file was automatically generated by AutoMulti.
47 *
48 * @author Otto Multey
49 */
50 public class MultiTextUI extends TextUI {
51
52 /**
53 * The vector containing the real UIs. This is populated
54 * in the call to <code>createUI</code>, and can be obtained by calling
55 * the <code>getUIs</code> method. The first element is guaranteed to be the real UI
56 * obtained from the default look and feel.
57 */
58 protected Vector<ComponentUI> uis = new Vector<>();
59
60 ////////////////////
61 // Common UI methods
62 ////////////////////
63
64 /**
65 * Returns the list of UIs associated with this multiplexing UI. This
66 * allows processing of the UIs by an application aware of multiplexing
67 * UIs on components.
68 *
69 * @return an array of the UI delegates
70 */
71 public ComponentUI[] getUIs() {
72 return MultiLookAndFeel.uisToArray(uis);
73 }
74
75 ////////////////////
76 // TextUI methods
77 ////////////////////
78
213 View returnValue =
214 ((TextUI) (uis.elementAt(0))).getRootView(a);
215 for (int i = 1; i < uis.size(); i++) {
216 ((TextUI) (uis.elementAt(i))).getRootView(a);
217 }
218 return returnValue;
219 }
220
221 ////////////////////
222 // ComponentUI methods
223 ////////////////////
224
225 /**
226 * Invokes the <code>contains</code> method on each UI handled by this object.
227 *
228 * @return the value obtained from the first UI, which is
229 * the UI obtained from the default <code>LookAndFeel</code>
230 */
231 public boolean contains(JComponent a, int b, int c) {
232 boolean returnValue =
233 uis.elementAt(0).contains(a,b,c);
234 for (int i = 1; i < uis.size(); i++) {
235 uis.elementAt(i).contains(a,b,c);
236 }
237 return returnValue;
238 }
239
240 /**
241 * Invokes the <code>update</code> method on each UI handled by this object.
242 */
243 public void update(Graphics a, JComponent b) {
244 for (int i = 0; i < uis.size(); i++) {
245 uis.elementAt(i).update(a,b);
246 }
247 }
248
249 /**
250 * Returns a multiplexing UI instance if any of the auxiliary
251 * <code>LookAndFeel</code>s supports this UI. Otherwise, just returns the
252 * UI object obtained from the default <code>LookAndFeel</code>.
253 *
254 * @param a the component to create the UI for
255 * @return the UI delegate created
256 */
257 public static ComponentUI createUI(JComponent a) {
258 MultiTextUI mui = new MultiTextUI();
259 return MultiLookAndFeel.createUIs(mui, mui.uis, a);
260 }
261
262 /**
263 * Invokes the <code>installUI</code> method on each UI handled by this object.
264 */
265 public void installUI(JComponent a) {
266 for (int i = 0; i < uis.size(); i++) {
267 uis.elementAt(i).installUI(a);
268 }
269 }
270
271 /**
272 * Invokes the <code>uninstallUI</code> method on each UI handled by this object.
273 */
274 public void uninstallUI(JComponent a) {
275 for (int i = 0; i < uis.size(); i++) {
276 uis.elementAt(i).uninstallUI(a);
277 }
278 }
279
280 /**
281 * Invokes the <code>paint</code> method on each UI handled by this object.
282 */
283 public void paint(Graphics a, JComponent b) {
284 for (int i = 0; i < uis.size(); i++) {
285 uis.elementAt(i).paint(a,b);
286 }
287 }
288
289 /**
290 * Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
291 *
292 * @return the value obtained from the first UI, which is
293 * the UI obtained from the default <code>LookAndFeel</code>
294 */
295 public Dimension getPreferredSize(JComponent a) {
296 Dimension returnValue =
297 uis.elementAt(0).getPreferredSize(a);
298 for (int i = 1; i < uis.size(); i++) {
299 uis.elementAt(i).getPreferredSize(a);
300 }
301 return returnValue;
302 }
303
304 /**
305 * Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
306 *
307 * @return the value obtained from the first UI, which is
308 * the UI obtained from the default <code>LookAndFeel</code>
309 */
310 public Dimension getMinimumSize(JComponent a) {
311 Dimension returnValue =
312 uis.elementAt(0).getMinimumSize(a);
313 for (int i = 1; i < uis.size(); i++) {
314 uis.elementAt(i).getMinimumSize(a);
315 }
316 return returnValue;
317 }
318
319 /**
320 * Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
321 *
322 * @return the value obtained from the first UI, which is
323 * the UI obtained from the default <code>LookAndFeel</code>
324 */
325 public Dimension getMaximumSize(JComponent a) {
326 Dimension returnValue =
327 uis.elementAt(0).getMaximumSize(a);
328 for (int i = 1; i < uis.size(); i++) {
329 uis.elementAt(i).getMaximumSize(a);
330 }
331 return returnValue;
332 }
333
334 /**
335 * Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
336 *
337 * @return the value obtained from the first UI, which is
338 * the UI obtained from the default <code>LookAndFeel</code>
339 */
340 public int getAccessibleChildrenCount(JComponent a) {
341 int returnValue =
342 uis.elementAt(0).getAccessibleChildrenCount(a);
343 for (int i = 1; i < uis.size(); i++) {
344 uis.elementAt(i).getAccessibleChildrenCount(a);
345 }
346 return returnValue;
347 }
348
349 /**
350 * Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
351 *
352 * @return the value obtained from the first UI, which is
353 * the UI obtained from the default <code>LookAndFeel</code>
354 */
355 public Accessible getAccessibleChild(JComponent a, int b) {
356 Accessible returnValue =
357 uis.elementAt(0).getAccessibleChild(a,b);
358 for (int i = 1; i < uis.size(); i++) {
359 uis.elementAt(i).getAccessibleChild(a,b);
360 }
361 return returnValue;
362 }
363 }
|