src/share/classes/javax/swing/plaf/multi/MultiFileChooserUI.java

Print this page




  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      * @return an array of the UI delegates
  67      */
  68     public ComponentUI[] getUIs() {
  69         return MultiLookAndFeel.uisToArray(uis);
  70     }
  71 
  72 ////////////////////
  73 // FileChooserUI methods
  74 ////////////////////
  75 


 146      * Invokes the <code>ensureFileIsVisible</code> method on each UI handled by this object.
 147      */
 148     public void ensureFileIsVisible(JFileChooser a, File b) {
 149         for (int i = 0; i < uis.size(); i++) {
 150             ((FileChooserUI) (uis.elementAt(i))).ensureFileIsVisible(a,b);
 151         }
 152     }
 153 
 154 ////////////////////
 155 // ComponentUI methods
 156 ////////////////////
 157 
 158     /**
 159      * Invokes the <code>contains</code> method on each UI handled by this object.
 160      *
 161      * @return the value obtained from the first UI, which is
 162      * the UI obtained from the default <code>LookAndFeel</code>
 163      */
 164     public boolean contains(JComponent a, int b, int c) {
 165         boolean returnValue =
 166             ((ComponentUI) (uis.elementAt(0))).contains(a,b,c);
 167         for (int i = 1; i < uis.size(); i++) {
 168             ((ComponentUI) (uis.elementAt(i))).contains(a,b,c);
 169         }
 170         return returnValue;
 171     }
 172 
 173     /**
 174      * Invokes the <code>update</code> method on each UI handled by this object.
 175      */
 176     public void update(Graphics a, JComponent b) {
 177         for (int i = 0; i < uis.size(); i++) {
 178             ((ComponentUI) (uis.elementAt(i))).update(a,b);
 179         }
 180     }
 181 
 182     /**
 183      * Returns a multiplexing UI instance if any of the auxiliary
 184      * <code>LookAndFeel</code>s supports this UI.  Otherwise, just returns the
 185      * UI object obtained from the default <code>LookAndFeel</code>.
 186      *
 187      * @param  a the component to create the UI for
 188      * @return the UI delegate created
 189      */
 190     public static ComponentUI createUI(JComponent a) {
 191         ComponentUI mui = new MultiFileChooserUI();
 192         return MultiLookAndFeel.createUIs(mui,
 193                                           ((MultiFileChooserUI) mui).uis,
 194                                           a);
 195     }
 196 
 197     /**
 198      * Invokes the <code>installUI</code> method on each UI handled by this object.
 199      */
 200     public void installUI(JComponent a) {
 201         for (int i = 0; i < uis.size(); i++) {
 202             ((ComponentUI) (uis.elementAt(i))).installUI(a);
 203         }
 204     }
 205 
 206     /**
 207      * Invokes the <code>uninstallUI</code> method on each UI handled by this object.
 208      */
 209     public void uninstallUI(JComponent a) {
 210         for (int i = 0; i < uis.size(); i++) {
 211             ((ComponentUI) (uis.elementAt(i))).uninstallUI(a);
 212         }
 213     }
 214 
 215     /**
 216      * Invokes the <code>paint</code> method on each UI handled by this object.
 217      */
 218     public void paint(Graphics a, JComponent b) {
 219         for (int i = 0; i < uis.size(); i++) {
 220             ((ComponentUI) (uis.elementAt(i))).paint(a,b);
 221         }
 222     }
 223 
 224     /**
 225      * Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
 226      *
 227      * @return the value obtained from the first UI, which is
 228      * the UI obtained from the default <code>LookAndFeel</code>
 229      */
 230     public Dimension getPreferredSize(JComponent a) {
 231         Dimension returnValue =
 232             ((ComponentUI) (uis.elementAt(0))).getPreferredSize(a);
 233         for (int i = 1; i < uis.size(); i++) {
 234             ((ComponentUI) (uis.elementAt(i))).getPreferredSize(a);
 235         }
 236         return returnValue;
 237     }
 238 
 239     /**
 240      * Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
 241      *
 242      * @return the value obtained from the first UI, which is
 243      * the UI obtained from the default <code>LookAndFeel</code>
 244      */
 245     public Dimension getMinimumSize(JComponent a) {
 246         Dimension returnValue =
 247             ((ComponentUI) (uis.elementAt(0))).getMinimumSize(a);
 248         for (int i = 1; i < uis.size(); i++) {
 249             ((ComponentUI) (uis.elementAt(i))).getMinimumSize(a);
 250         }
 251         return returnValue;
 252     }
 253 
 254     /**
 255      * Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
 256      *
 257      * @return the value obtained from the first UI, which is
 258      * the UI obtained from the default <code>LookAndFeel</code>
 259      */
 260     public Dimension getMaximumSize(JComponent a) {
 261         Dimension returnValue =
 262             ((ComponentUI) (uis.elementAt(0))).getMaximumSize(a);
 263         for (int i = 1; i < uis.size(); i++) {
 264             ((ComponentUI) (uis.elementAt(i))).getMaximumSize(a);
 265         }
 266         return returnValue;
 267     }
 268 
 269     /**
 270      * Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
 271      *
 272      * @return the value obtained from the first UI, which is
 273      * the UI obtained from the default <code>LookAndFeel</code>
 274      */
 275     public int getAccessibleChildrenCount(JComponent a) {
 276         int returnValue =
 277             ((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a);
 278         for (int i = 1; i < uis.size(); i++) {
 279             ((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a);
 280         }
 281         return returnValue;
 282     }
 283 
 284     /**
 285      * Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
 286      *
 287      * @return the value obtained from the first UI, which is
 288      * the UI obtained from the default <code>LookAndFeel</code>
 289      */
 290     public Accessible getAccessibleChild(JComponent a, int b) {
 291         Accessible returnValue =
 292             ((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b);
 293         for (int i = 1; i < uis.size(); i++) {
 294             ((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b);
 295         }
 296         return returnValue;
 297     }
 298 }


  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      * @return an array of the UI delegates
  67      */
  68     public ComponentUI[] getUIs() {
  69         return MultiLookAndFeel.uisToArray(uis);
  70     }
  71 
  72 ////////////////////
  73 // FileChooserUI methods
  74 ////////////////////
  75 


 146      * Invokes the <code>ensureFileIsVisible</code> method on each UI handled by this object.
 147      */
 148     public void ensureFileIsVisible(JFileChooser a, File b) {
 149         for (int i = 0; i < uis.size(); i++) {
 150             ((FileChooserUI) (uis.elementAt(i))).ensureFileIsVisible(a,b);
 151         }
 152     }
 153 
 154 ////////////////////
 155 // ComponentUI methods
 156 ////////////////////
 157 
 158     /**
 159      * Invokes the <code>contains</code> method on each UI handled by this object.
 160      *
 161      * @return the value obtained from the first UI, which is
 162      * the UI obtained from the default <code>LookAndFeel</code>
 163      */
 164     public boolean contains(JComponent a, int b, int c) {
 165         boolean returnValue =
 166             uis.elementAt(0).contains(a,b,c);
 167         for (int i = 1; i < uis.size(); i++) {
 168             uis.elementAt(i).contains(a,b,c);
 169         }
 170         return returnValue;
 171     }
 172 
 173     /**
 174      * Invokes the <code>update</code> method on each UI handled by this object.
 175      */
 176     public void update(Graphics a, JComponent b) {
 177         for (int i = 0; i < uis.size(); i++) {
 178             uis.elementAt(i).update(a,b);
 179         }
 180     }
 181 
 182     /**
 183      * Returns a multiplexing UI instance if any of the auxiliary
 184      * <code>LookAndFeel</code>s supports this UI.  Otherwise, just returns the
 185      * UI object obtained from the default <code>LookAndFeel</code>.
 186      *
 187      * @param  a the component to create the UI for
 188      * @return the UI delegate created
 189      */
 190     public static ComponentUI createUI(JComponent a) {
 191         MultiFileChooserUI mui = new MultiFileChooserUI();
 192         return MultiLookAndFeel.createUIs(mui, mui.uis, a);


 193     }
 194 
 195     /**
 196      * Invokes the <code>installUI</code> method on each UI handled by this object.
 197      */
 198     public void installUI(JComponent a) {
 199         for (int i = 0; i < uis.size(); i++) {
 200             uis.elementAt(i).installUI(a);
 201         }
 202     }
 203 
 204     /**
 205      * Invokes the <code>uninstallUI</code> method on each UI handled by this object.
 206      */
 207     public void uninstallUI(JComponent a) {
 208         for (int i = 0; i < uis.size(); i++) {
 209             uis.elementAt(i).uninstallUI(a);
 210         }
 211     }
 212 
 213     /**
 214      * Invokes the <code>paint</code> method on each UI handled by this object.
 215      */
 216     public void paint(Graphics a, JComponent b) {
 217         for (int i = 0; i < uis.size(); i++) {
 218             uis.elementAt(i).paint(a,b);
 219         }
 220     }
 221 
 222     /**
 223      * Invokes the <code>getPreferredSize</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 getPreferredSize(JComponent a) {
 229         Dimension returnValue =
 230             uis.elementAt(0).getPreferredSize(a);
 231         for (int i = 1; i < uis.size(); i++) {
 232             uis.elementAt(i).getPreferredSize(a);
 233         }
 234         return returnValue;
 235     }
 236 
 237     /**
 238      * Invokes the <code>getMinimumSize</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 Dimension getMinimumSize(JComponent a) {
 244         Dimension returnValue =
 245             uis.elementAt(0).getMinimumSize(a);
 246         for (int i = 1; i < uis.size(); i++) {
 247             uis.elementAt(i).getMinimumSize(a);
 248         }
 249         return returnValue;
 250     }
 251 
 252     /**
 253      * Invokes the <code>getMaximumSize</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 Dimension getMaximumSize(JComponent a) {
 259         Dimension returnValue =
 260             uis.elementAt(0).getMaximumSize(a);
 261         for (int i = 1; i < uis.size(); i++) {
 262             uis.elementAt(i).getMaximumSize(a);
 263         }
 264         return returnValue;
 265     }
 266 
 267     /**
 268      * Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
 269      *
 270      * @return the value obtained from the first UI, which is
 271      * the UI obtained from the default <code>LookAndFeel</code>
 272      */
 273     public int getAccessibleChildrenCount(JComponent a) {
 274         int returnValue =
 275             uis.elementAt(0).getAccessibleChildrenCount(a);
 276         for (int i = 1; i < uis.size(); i++) {
 277             uis.elementAt(i).getAccessibleChildrenCount(a);
 278         }
 279         return returnValue;
 280     }
 281 
 282     /**
 283      * Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
 284      *
 285      * @return the value obtained from the first UI, which is
 286      * the UI obtained from the default <code>LookAndFeel</code>
 287      */
 288     public Accessible getAccessibleChild(JComponent a, int b) {
 289         Accessible returnValue =
 290             uis.elementAt(0).getAccessibleChild(a,b);
 291         for (int i = 1; i < uis.size(); i++) {
 292             uis.elementAt(i).getAccessibleChild(a,b);
 293         }
 294         return returnValue;
 295     }
 296 }