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

Print this page




  33 import javax.swing.JComponent;
  34 import java.awt.Graphics;
  35 import java.awt.Dimension;
  36 import javax.accessibility.Accessible;
  37 
  38 /**
  39  * A multiplexing UI used to combine <code>TreeUI</code>s.
  40  *
  41  * <p>This file was automatically generated by AutoMulti.
  42  *
  43  * @author  Otto Multey
  44  */
  45 public class MultiTreeUI extends TreeUI {
  46 
  47     /**
  48      * The vector containing the real UIs.  This is populated
  49      * in the call to <code>createUI</code>, and can be obtained by calling
  50      * the <code>getUIs</code> method.  The first element is guaranteed to be the real UI
  51      * obtained from the default look and feel.
  52      */
  53     protected Vector uis = new Vector();
  54 
  55 ////////////////////
  56 // Common UI methods
  57 ////////////////////
  58 
  59     /**
  60      * Returns the list of UIs associated with this multiplexing UI.  This
  61      * allows processing of the UIs by an application aware of multiplexing
  62      * UIs on components.
  63      *
  64      * @return an array of the UI delegates
  65      */
  66     public ComponentUI[] getUIs() {
  67         return MultiLookAndFeel.uisToArray(uis);
  68     }
  69 
  70 ////////////////////
  71 // TreeUI methods
  72 ////////////////////
  73 


 204         TreePath returnValue =
 205             ((TreeUI) (uis.elementAt(0))).getEditingPath(a);
 206         for (int i = 1; i < uis.size(); i++) {
 207             ((TreeUI) (uis.elementAt(i))).getEditingPath(a);
 208         }
 209         return returnValue;
 210     }
 211 
 212 ////////////////////
 213 // ComponentUI methods
 214 ////////////////////
 215 
 216     /**
 217      * Invokes the <code>contains</code> method on each UI handled by this object.
 218      *
 219      * @return the value obtained from the first UI, which is
 220      * the UI obtained from the default <code>LookAndFeel</code>
 221      */
 222     public boolean contains(JComponent a, int b, int c) {
 223         boolean returnValue =
 224             ((ComponentUI) (uis.elementAt(0))).contains(a,b,c);
 225         for (int i = 1; i < uis.size(); i++) {
 226             ((ComponentUI) (uis.elementAt(i))).contains(a,b,c);
 227         }
 228         return returnValue;
 229     }
 230 
 231     /**
 232      * Invokes the <code>update</code> method on each UI handled by this object.
 233      */
 234     public void update(Graphics a, JComponent b) {
 235         for (int i = 0; i < uis.size(); i++) {
 236             ((ComponentUI) (uis.elementAt(i))).update(a,b);
 237         }
 238     }
 239 
 240     /**
 241      * Returns a multiplexing UI instance if any of the auxiliary
 242      * <code>LookAndFeel</code>s supports this UI.  Otherwise, just returns the
 243      * UI object obtained from the default <code>LookAndFeel</code>.
 244      *
 245      * @param  a the component to create the UI for
 246      * @return the UI delegate created
 247      */
 248     public static ComponentUI createUI(JComponent a) {
 249         ComponentUI mui = new MultiTreeUI();
 250         return MultiLookAndFeel.createUIs(mui,
 251                                           ((MultiTreeUI) mui).uis,
 252                                           a);
 253     }
 254 
 255     /**
 256      * Invokes the <code>installUI</code> method on each UI handled by this object.
 257      */
 258     public void installUI(JComponent a) {
 259         for (int i = 0; i < uis.size(); i++) {
 260             ((ComponentUI) (uis.elementAt(i))).installUI(a);
 261         }
 262     }
 263 
 264     /**
 265      * Invokes the <code>uninstallUI</code> method on each UI handled by this object.
 266      */
 267     public void uninstallUI(JComponent a) {
 268         for (int i = 0; i < uis.size(); i++) {
 269             ((ComponentUI) (uis.elementAt(i))).uninstallUI(a);
 270         }
 271     }
 272 
 273     /**
 274      * Invokes the <code>paint</code> method on each UI handled by this object.
 275      */
 276     public void paint(Graphics a, JComponent b) {
 277         for (int i = 0; i < uis.size(); i++) {
 278             ((ComponentUI) (uis.elementAt(i))).paint(a,b);
 279         }
 280     }
 281 
 282     /**
 283      * Invokes the <code>getPreferredSize</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 Dimension getPreferredSize(JComponent a) {
 289         Dimension returnValue =
 290             ((ComponentUI) (uis.elementAt(0))).getPreferredSize(a);
 291         for (int i = 1; i < uis.size(); i++) {
 292             ((ComponentUI) (uis.elementAt(i))).getPreferredSize(a);
 293         }
 294         return returnValue;
 295     }
 296 
 297     /**
 298      * Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
 299      *
 300      * @return the value obtained from the first UI, which is
 301      * the UI obtained from the default <code>LookAndFeel</code>
 302      */
 303     public Dimension getMinimumSize(JComponent a) {
 304         Dimension returnValue =
 305             ((ComponentUI) (uis.elementAt(0))).getMinimumSize(a);
 306         for (int i = 1; i < uis.size(); i++) {
 307             ((ComponentUI) (uis.elementAt(i))).getMinimumSize(a);
 308         }
 309         return returnValue;
 310     }
 311 
 312     /**
 313      * Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
 314      *
 315      * @return the value obtained from the first UI, which is
 316      * the UI obtained from the default <code>LookAndFeel</code>
 317      */
 318     public Dimension getMaximumSize(JComponent a) {
 319         Dimension returnValue =
 320             ((ComponentUI) (uis.elementAt(0))).getMaximumSize(a);
 321         for (int i = 1; i < uis.size(); i++) {
 322             ((ComponentUI) (uis.elementAt(i))).getMaximumSize(a);
 323         }
 324         return returnValue;
 325     }
 326 
 327     /**
 328      * Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
 329      *
 330      * @return the value obtained from the first UI, which is
 331      * the UI obtained from the default <code>LookAndFeel</code>
 332      */
 333     public int getAccessibleChildrenCount(JComponent a) {
 334         int returnValue =
 335             ((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a);
 336         for (int i = 1; i < uis.size(); i++) {
 337             ((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a);
 338         }
 339         return returnValue;
 340     }
 341 
 342     /**
 343      * Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
 344      *
 345      * @return the value obtained from the first UI, which is
 346      * the UI obtained from the default <code>LookAndFeel</code>
 347      */
 348     public Accessible getAccessibleChild(JComponent a, int b) {
 349         Accessible returnValue =
 350             ((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b);
 351         for (int i = 1; i < uis.size(); i++) {
 352             ((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b);
 353         }
 354         return returnValue;
 355     }
 356 }


  33 import javax.swing.JComponent;
  34 import java.awt.Graphics;
  35 import java.awt.Dimension;
  36 import javax.accessibility.Accessible;
  37 
  38 /**
  39  * A multiplexing UI used to combine <code>TreeUI</code>s.
  40  *
  41  * <p>This file was automatically generated by AutoMulti.
  42  *
  43  * @author  Otto Multey
  44  */
  45 public class MultiTreeUI extends TreeUI {
  46 
  47     /**
  48      * The vector containing the real UIs.  This is populated
  49      * in the call to <code>createUI</code>, and can be obtained by calling
  50      * the <code>getUIs</code> method.  The first element is guaranteed to be the real UI
  51      * obtained from the default look and feel.
  52      */
  53     protected Vector<ComponentUI> uis = new Vector<>();
  54 
  55 ////////////////////
  56 // Common UI methods
  57 ////////////////////
  58 
  59     /**
  60      * Returns the list of UIs associated with this multiplexing UI.  This
  61      * allows processing of the UIs by an application aware of multiplexing
  62      * UIs on components.
  63      *
  64      * @return an array of the UI delegates
  65      */
  66     public ComponentUI[] getUIs() {
  67         return MultiLookAndFeel.uisToArray(uis);
  68     }
  69 
  70 ////////////////////
  71 // TreeUI methods
  72 ////////////////////
  73 


 204         TreePath returnValue =
 205             ((TreeUI) (uis.elementAt(0))).getEditingPath(a);
 206         for (int i = 1; i < uis.size(); i++) {
 207             ((TreeUI) (uis.elementAt(i))).getEditingPath(a);
 208         }
 209         return returnValue;
 210     }
 211 
 212 ////////////////////
 213 // ComponentUI methods
 214 ////////////////////
 215 
 216     /**
 217      * Invokes the <code>contains</code> method on each UI handled by this object.
 218      *
 219      * @return the value obtained from the first UI, which is
 220      * the UI obtained from the default <code>LookAndFeel</code>
 221      */
 222     public boolean contains(JComponent a, int b, int c) {
 223         boolean returnValue =
 224             uis.elementAt(0).contains(a,b,c);
 225         for (int i = 1; i < uis.size(); i++) {
 226             uis.elementAt(i).contains(a,b,c);
 227         }
 228         return returnValue;
 229     }
 230 
 231     /**
 232      * Invokes the <code>update</code> method on each UI handled by this object.
 233      */
 234     public void update(Graphics a, JComponent b) {
 235         for (int i = 0; i < uis.size(); i++) {
 236             uis.elementAt(i).update(a,b);
 237         }
 238     }
 239 
 240     /**
 241      * Returns a multiplexing UI instance if any of the auxiliary
 242      * <code>LookAndFeel</code>s supports this UI.  Otherwise, just returns the
 243      * UI object obtained from the default <code>LookAndFeel</code>.
 244      *
 245      * @param  a the component to create the UI for
 246      * @return the UI delegate created
 247      */
 248     public static ComponentUI createUI(JComponent a) {
 249         MultiTreeUI mui = new MultiTreeUI();
 250         return MultiLookAndFeel.createUIs(mui, mui.uis, a);


 251     }
 252 
 253     /**
 254      * Invokes the <code>installUI</code> method on each UI handled by this object.
 255      */
 256     public void installUI(JComponent a) {
 257         for (int i = 0; i < uis.size(); i++) {
 258             uis.elementAt(i).installUI(a);
 259         }
 260     }
 261 
 262     /**
 263      * Invokes the <code>uninstallUI</code> method on each UI handled by this object.
 264      */
 265     public void uninstallUI(JComponent a) {
 266         for (int i = 0; i < uis.size(); i++) {
 267             uis.elementAt(i).uninstallUI(a);
 268         }
 269     }
 270 
 271     /**
 272      * Invokes the <code>paint</code> method on each UI handled by this object.
 273      */
 274     public void paint(Graphics a, JComponent b) {
 275         for (int i = 0; i < uis.size(); i++) {
 276             uis.elementAt(i).paint(a,b);
 277         }
 278     }
 279 
 280     /**
 281      * Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
 282      *
 283      * @return the value obtained from the first UI, which is
 284      * the UI obtained from the default <code>LookAndFeel</code>
 285      */
 286     public Dimension getPreferredSize(JComponent a) {
 287         Dimension returnValue =
 288             uis.elementAt(0).getPreferredSize(a);
 289         for (int i = 1; i < uis.size(); i++) {
 290             uis.elementAt(i).getPreferredSize(a);
 291         }
 292         return returnValue;
 293     }
 294 
 295     /**
 296      * Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
 297      *
 298      * @return the value obtained from the first UI, which is
 299      * the UI obtained from the default <code>LookAndFeel</code>
 300      */
 301     public Dimension getMinimumSize(JComponent a) {
 302         Dimension returnValue =
 303             uis.elementAt(0).getMinimumSize(a);
 304         for (int i = 1; i < uis.size(); i++) {
 305             uis.elementAt(i).getMinimumSize(a);
 306         }
 307         return returnValue;
 308     }
 309 
 310     /**
 311      * Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
 312      *
 313      * @return the value obtained from the first UI, which is
 314      * the UI obtained from the default <code>LookAndFeel</code>
 315      */
 316     public Dimension getMaximumSize(JComponent a) {
 317         Dimension returnValue =
 318             uis.elementAt(0).getMaximumSize(a);
 319         for (int i = 1; i < uis.size(); i++) {
 320             uis.elementAt(i).getMaximumSize(a);
 321         }
 322         return returnValue;
 323     }
 324 
 325     /**
 326      * Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
 327      *
 328      * @return the value obtained from the first UI, which is
 329      * the UI obtained from the default <code>LookAndFeel</code>
 330      */
 331     public int getAccessibleChildrenCount(JComponent a) {
 332         int returnValue =
 333             uis.elementAt(0).getAccessibleChildrenCount(a);
 334         for (int i = 1; i < uis.size(); i++) {
 335             uis.elementAt(i).getAccessibleChildrenCount(a);
 336         }
 337         return returnValue;
 338     }
 339 
 340     /**
 341      * Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
 342      *
 343      * @return the value obtained from the first UI, which is
 344      * the UI obtained from the default <code>LookAndFeel</code>
 345      */
 346     public Accessible getAccessibleChild(JComponent a, int b) {
 347         Accessible returnValue =
 348             uis.elementAt(0).getAccessibleChild(a,b);
 349         for (int i = 1; i < uis.size(); i++) {
 350             uis.elementAt(i).getAccessibleChild(a,b);
 351         }
 352         return returnValue;
 353     }
 354 }