35 import javax.swing.JComponent;
36 import java.awt.Graphics;
37 import java.awt.Dimension;
38 import javax.accessibility.Accessible;
39
40 /**
41 * A multiplexing UI used to combine <code>FileChooserUI</code>s.
42 *
43 * <p>This file was automatically generated by AutoMulti.
44 *
45 * @author Otto Multey
46 */
47 public class MultiFileChooserUI extends FileChooserUI {
48
49 /**
50 * The vector containing the real UIs. This is populated
51 * in the call to <code>createUI</code>, and can be obtained by calling
52 * the <code>getUIs</code> method. The first element is guaranteed to be the real UI
53 * obtained from the default look and feel.
54 */
55 protected Vector uis = new Vector();
56
57 ////////////////////
58 // Common UI methods
59 ////////////////////
60
61 /**
62 * Returns the list of UIs associated with this multiplexing UI. This
63 * allows processing of the UIs by an application aware of multiplexing
64 * UIs on components.
65 */
66 public ComponentUI[] getUIs() {
67 return MultiLookAndFeel.uisToArray(uis);
68 }
69
70 ////////////////////
71 // FileChooserUI methods
72 ////////////////////
73
74 /**
75 * Invokes the <code>getAcceptAllFileFilter</code> method on each UI handled by this object.
144 * Invokes the <code>ensureFileIsVisible</code> method on each UI handled by this object.
145 */
146 public void ensureFileIsVisible(JFileChooser a, File b) {
147 for (int i = 0; i < uis.size(); i++) {
148 ((FileChooserUI) (uis.elementAt(i))).ensureFileIsVisible(a,b);
149 }
150 }
151
152 ////////////////////
153 // ComponentUI methods
154 ////////////////////
155
156 /**
157 * Invokes the <code>contains</code> method on each UI handled by this object.
158 *
159 * @return the value obtained from the first UI, which is
160 * the UI obtained from the default <code>LookAndFeel</code>
161 */
162 public boolean contains(JComponent a, int b, int c) {
163 boolean returnValue =
164 ((ComponentUI) (uis.elementAt(0))).contains(a,b,c);
165 for (int i = 1; i < uis.size(); i++) {
166 ((ComponentUI) (uis.elementAt(i))).contains(a,b,c);
167 }
168 return returnValue;
169 }
170
171 /**
172 * Invokes the <code>update</code> method on each UI handled by this object.
173 */
174 public void update(Graphics a, JComponent b) {
175 for (int i = 0; i < uis.size(); i++) {
176 ((ComponentUI) (uis.elementAt(i))).update(a,b);
177 }
178 }
179
180 /**
181 * Returns a multiplexing UI instance if any of the auxiliary
182 * <code>LookAndFeel</code>s supports this UI. Otherwise, just returns the
183 * UI object obtained from the default <code>LookAndFeel</code>.
184 */
185 public static ComponentUI createUI(JComponent a) {
186 ComponentUI mui = new MultiFileChooserUI();
187 return MultiLookAndFeel.createUIs(mui,
188 ((MultiFileChooserUI) mui).uis,
189 a);
190 }
191
192 /**
193 * Invokes the <code>installUI</code> method on each UI handled by this object.
194 */
195 public void installUI(JComponent a) {
196 for (int i = 0; i < uis.size(); i++) {
197 ((ComponentUI) (uis.elementAt(i))).installUI(a);
198 }
199 }
200
201 /**
202 * Invokes the <code>uninstallUI</code> method on each UI handled by this object.
203 */
204 public void uninstallUI(JComponent a) {
205 for (int i = 0; i < uis.size(); i++) {
206 ((ComponentUI) (uis.elementAt(i))).uninstallUI(a);
207 }
208 }
209
210 /**
211 * Invokes the <code>paint</code> method on each UI handled by this object.
212 */
213 public void paint(Graphics a, JComponent b) {
214 for (int i = 0; i < uis.size(); i++) {
215 ((ComponentUI) (uis.elementAt(i))).paint(a,b);
216 }
217 }
218
219 /**
220 * Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
221 *
222 * @return the value obtained from the first UI, which is
223 * the UI obtained from the default <code>LookAndFeel</code>
224 */
225 public Dimension getPreferredSize(JComponent a) {
226 Dimension returnValue =
227 ((ComponentUI) (uis.elementAt(0))).getPreferredSize(a);
228 for (int i = 1; i < uis.size(); i++) {
229 ((ComponentUI) (uis.elementAt(i))).getPreferredSize(a);
230 }
231 return returnValue;
232 }
233
234 /**
235 * Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
236 *
237 * @return the value obtained from the first UI, which is
238 * the UI obtained from the default <code>LookAndFeel</code>
239 */
240 public Dimension getMinimumSize(JComponent a) {
241 Dimension returnValue =
242 ((ComponentUI) (uis.elementAt(0))).getMinimumSize(a);
243 for (int i = 1; i < uis.size(); i++) {
244 ((ComponentUI) (uis.elementAt(i))).getMinimumSize(a);
245 }
246 return returnValue;
247 }
248
249 /**
250 * Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
251 *
252 * @return the value obtained from the first UI, which is
253 * the UI obtained from the default <code>LookAndFeel</code>
254 */
255 public Dimension getMaximumSize(JComponent a) {
256 Dimension returnValue =
257 ((ComponentUI) (uis.elementAt(0))).getMaximumSize(a);
258 for (int i = 1; i < uis.size(); i++) {
259 ((ComponentUI) (uis.elementAt(i))).getMaximumSize(a);
260 }
261 return returnValue;
262 }
263
264 /**
265 * Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
266 *
267 * @return the value obtained from the first UI, which is
268 * the UI obtained from the default <code>LookAndFeel</code>
269 */
270 public int getAccessibleChildrenCount(JComponent a) {
271 int returnValue =
272 ((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a);
273 for (int i = 1; i < uis.size(); i++) {
274 ((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a);
275 }
276 return returnValue;
277 }
278
279 /**
280 * Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
281 *
282 * @return the value obtained from the first UI, which is
283 * the UI obtained from the default <code>LookAndFeel</code>
284 */
285 public Accessible getAccessibleChild(JComponent a, int b) {
286 Accessible returnValue =
287 ((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b);
288 for (int i = 1; i < uis.size(); i++) {
289 ((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b);
290 }
291 return returnValue;
292 }
293 }
|
35 import javax.swing.JComponent;
36 import java.awt.Graphics;
37 import java.awt.Dimension;
38 import javax.accessibility.Accessible;
39
40 /**
41 * A multiplexing UI used to combine <code>FileChooserUI</code>s.
42 *
43 * <p>This file was automatically generated by AutoMulti.
44 *
45 * @author Otto Multey
46 */
47 public class MultiFileChooserUI extends FileChooserUI {
48
49 /**
50 * The vector containing the real UIs. This is populated
51 * in the call to <code>createUI</code>, and can be obtained by calling
52 * the <code>getUIs</code> method. The first element is guaranteed to be the real UI
53 * obtained from the default look and feel.
54 */
55 protected Vector<ComponentUI> uis = new Vector<>();
56
57 ////////////////////
58 // Common UI methods
59 ////////////////////
60
61 /**
62 * Returns the list of UIs associated with this multiplexing UI. This
63 * allows processing of the UIs by an application aware of multiplexing
64 * UIs on components.
65 */
66 public ComponentUI[] getUIs() {
67 return MultiLookAndFeel.uisToArray(uis);
68 }
69
70 ////////////////////
71 // FileChooserUI methods
72 ////////////////////
73
74 /**
75 * Invokes the <code>getAcceptAllFileFilter</code> method on each UI handled by this object.
144 * Invokes the <code>ensureFileIsVisible</code> method on each UI handled by this object.
145 */
146 public void ensureFileIsVisible(JFileChooser a, File b) {
147 for (int i = 0; i < uis.size(); i++) {
148 ((FileChooserUI) (uis.elementAt(i))).ensureFileIsVisible(a,b);
149 }
150 }
151
152 ////////////////////
153 // ComponentUI methods
154 ////////////////////
155
156 /**
157 * Invokes the <code>contains</code> method on each UI handled by this object.
158 *
159 * @return the value obtained from the first UI, which is
160 * the UI obtained from the default <code>LookAndFeel</code>
161 */
162 public boolean contains(JComponent a, int b, int c) {
163 boolean returnValue =
164 uis.elementAt(0).contains(a,b,c);
165 for (int i = 1; i < uis.size(); i++) {
166 uis.elementAt(i).contains(a,b,c);
167 }
168 return returnValue;
169 }
170
171 /**
172 * Invokes the <code>update</code> method on each UI handled by this object.
173 */
174 public void update(Graphics a, JComponent b) {
175 for (int i = 0; i < uis.size(); i++) {
176 uis.elementAt(i).update(a,b);
177 }
178 }
179
180 /**
181 * Returns a multiplexing UI instance if any of the auxiliary
182 * <code>LookAndFeel</code>s supports this UI. Otherwise, just returns the
183 * UI object obtained from the default <code>LookAndFeel</code>.
184 */
185 public static ComponentUI createUI(JComponent a) {
186 MultiFileChooserUI mui = new MultiFileChooserUI();
187 return MultiLookAndFeel.createUIs(mui, mui.uis, a);
188 }
189
190 /**
191 * Invokes the <code>installUI</code> method on each UI handled by this object.
192 */
193 public void installUI(JComponent a) {
194 for (int i = 0; i < uis.size(); i++) {
195 uis.elementAt(i).installUI(a);
196 }
197 }
198
199 /**
200 * Invokes the <code>uninstallUI</code> method on each UI handled by this object.
201 */
202 public void uninstallUI(JComponent a) {
203 for (int i = 0; i < uis.size(); i++) {
204 uis.elementAt(i).uninstallUI(a);
205 }
206 }
207
208 /**
209 * Invokes the <code>paint</code> method on each UI handled by this object.
210 */
211 public void paint(Graphics a, JComponent b) {
212 for (int i = 0; i < uis.size(); i++) {
213 uis.elementAt(i).paint(a,b);
214 }
215 }
216
217 /**
218 * Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
219 *
220 * @return the value obtained from the first UI, which is
221 * the UI obtained from the default <code>LookAndFeel</code>
222 */
223 public Dimension getPreferredSize(JComponent a) {
224 Dimension returnValue =
225 uis.elementAt(0).getPreferredSize(a);
226 for (int i = 1; i < uis.size(); i++) {
227 uis.elementAt(i).getPreferredSize(a);
228 }
229 return returnValue;
230 }
231
232 /**
233 * Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
234 *
235 * @return the value obtained from the first UI, which is
236 * the UI obtained from the default <code>LookAndFeel</code>
237 */
238 public Dimension getMinimumSize(JComponent a) {
239 Dimension returnValue =
240 uis.elementAt(0).getMinimumSize(a);
241 for (int i = 1; i < uis.size(); i++) {
242 uis.elementAt(i).getMinimumSize(a);
243 }
244 return returnValue;
245 }
246
247 /**
248 * Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
249 *
250 * @return the value obtained from the first UI, which is
251 * the UI obtained from the default <code>LookAndFeel</code>
252 */
253 public Dimension getMaximumSize(JComponent a) {
254 Dimension returnValue =
255 uis.elementAt(0).getMaximumSize(a);
256 for (int i = 1; i < uis.size(); i++) {
257 uis.elementAt(i).getMaximumSize(a);
258 }
259 return returnValue;
260 }
261
262 /**
263 * Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
264 *
265 * @return the value obtained from the first UI, which is
266 * the UI obtained from the default <code>LookAndFeel</code>
267 */
268 public int getAccessibleChildrenCount(JComponent a) {
269 int returnValue =
270 uis.elementAt(0).getAccessibleChildrenCount(a);
271 for (int i = 1; i < uis.size(); i++) {
272 uis.elementAt(i).getAccessibleChildrenCount(a);
273 }
274 return returnValue;
275 }
276
277 /**
278 * Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
279 *
280 * @return the value obtained from the first UI, which is
281 * the UI obtained from the default <code>LookAndFeel</code>
282 */
283 public Accessible getAccessibleChild(JComponent a, int b) {
284 Accessible returnValue =
285 uis.elementAt(0).getAccessibleChild(a,b);
286 for (int i = 1; i < uis.size(); i++) {
287 uis.elementAt(i).getAccessibleChild(a,b);
288 }
289 return returnValue;
290 }
291 }
|