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

Print this page




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


 108         int returnValue =
 109             ((TabbedPaneUI) (uis.elementAt(0))).getTabRunCount(a);
 110         for (int i = 1; i < uis.size(); i++) {
 111             ((TabbedPaneUI) (uis.elementAt(i))).getTabRunCount(a);
 112         }
 113         return returnValue;
 114     }
 115 
 116 ////////////////////
 117 // ComponentUI methods
 118 ////////////////////
 119 
 120     /**
 121      * Invokes the <code>contains</code> method on each UI handled by this object.
 122      *
 123      * @return the value obtained from the first UI, which is
 124      * the UI obtained from the default <code>LookAndFeel</code>
 125      */
 126     public boolean contains(JComponent a, int b, int c) {
 127         boolean returnValue =
 128             ((ComponentUI) (uis.elementAt(0))).contains(a,b,c);
 129         for (int i = 1; i < uis.size(); i++) {
 130             ((ComponentUI) (uis.elementAt(i))).contains(a,b,c);
 131         }
 132         return returnValue;
 133     }
 134 
 135     /**
 136      * Invokes the <code>update</code> method on each UI handled by this object.
 137      */
 138     public void update(Graphics a, JComponent b) {
 139         for (int i = 0; i < uis.size(); i++) {
 140             ((ComponentUI) (uis.elementAt(i))).update(a,b);
 141         }
 142     }
 143 
 144     /**
 145      * Returns a multiplexing UI instance if any of the auxiliary
 146      * <code>LookAndFeel</code>s supports this UI.  Otherwise, just returns the
 147      * UI object obtained from the default <code>LookAndFeel</code>.
 148      */
 149     public static ComponentUI createUI(JComponent a) {
 150         ComponentUI mui = new MultiTabbedPaneUI();
 151         return MultiLookAndFeel.createUIs(mui,
 152                                           ((MultiTabbedPaneUI) mui).uis,
 153                                           a);
 154     }
 155 
 156     /**
 157      * Invokes the <code>installUI</code> method on each UI handled by this object.
 158      */
 159     public void installUI(JComponent a) {
 160         for (int i = 0; i < uis.size(); i++) {
 161             ((ComponentUI) (uis.elementAt(i))).installUI(a);
 162         }
 163     }
 164 
 165     /**
 166      * Invokes the <code>uninstallUI</code> method on each UI handled by this object.
 167      */
 168     public void uninstallUI(JComponent a) {
 169         for (int i = 0; i < uis.size(); i++) {
 170             ((ComponentUI) (uis.elementAt(i))).uninstallUI(a);
 171         }
 172     }
 173 
 174     /**
 175      * Invokes the <code>paint</code> method on each UI handled by this object.
 176      */
 177     public void paint(Graphics a, JComponent b) {
 178         for (int i = 0; i < uis.size(); i++) {
 179             ((ComponentUI) (uis.elementAt(i))).paint(a,b);
 180         }
 181     }
 182 
 183     /**
 184      * Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
 185      *
 186      * @return the value obtained from the first UI, which is
 187      * the UI obtained from the default <code>LookAndFeel</code>
 188      */
 189     public Dimension getPreferredSize(JComponent a) {
 190         Dimension returnValue =
 191             ((ComponentUI) (uis.elementAt(0))).getPreferredSize(a);
 192         for (int i = 1; i < uis.size(); i++) {
 193             ((ComponentUI) (uis.elementAt(i))).getPreferredSize(a);
 194         }
 195         return returnValue;
 196     }
 197 
 198     /**
 199      * Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
 200      *
 201      * @return the value obtained from the first UI, which is
 202      * the UI obtained from the default <code>LookAndFeel</code>
 203      */
 204     public Dimension getMinimumSize(JComponent a) {
 205         Dimension returnValue =
 206             ((ComponentUI) (uis.elementAt(0))).getMinimumSize(a);
 207         for (int i = 1; i < uis.size(); i++) {
 208             ((ComponentUI) (uis.elementAt(i))).getMinimumSize(a);
 209         }
 210         return returnValue;
 211     }
 212 
 213     /**
 214      * Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
 215      *
 216      * @return the value obtained from the first UI, which is
 217      * the UI obtained from the default <code>LookAndFeel</code>
 218      */
 219     public Dimension getMaximumSize(JComponent a) {
 220         Dimension returnValue =
 221             ((ComponentUI) (uis.elementAt(0))).getMaximumSize(a);
 222         for (int i = 1; i < uis.size(); i++) {
 223             ((ComponentUI) (uis.elementAt(i))).getMaximumSize(a);
 224         }
 225         return returnValue;
 226     }
 227 
 228     /**
 229      * Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
 230      *
 231      * @return the value obtained from the first UI, which is
 232      * the UI obtained from the default <code>LookAndFeel</code>
 233      */
 234     public int getAccessibleChildrenCount(JComponent a) {
 235         int returnValue =
 236             ((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a);
 237         for (int i = 1; i < uis.size(); i++) {
 238             ((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a);
 239         }
 240         return returnValue;
 241     }
 242 
 243     /**
 244      * Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
 245      *
 246      * @return the value obtained from the first UI, which is
 247      * the UI obtained from the default <code>LookAndFeel</code>
 248      */
 249     public Accessible getAccessibleChild(JComponent a, int b) {
 250         Accessible returnValue =
 251             ((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b);
 252         for (int i = 1; i < uis.size(); i++) {
 253             ((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b);
 254         }
 255         return returnValue;
 256     }
 257 }


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


 108         int returnValue =
 109             ((TabbedPaneUI) (uis.elementAt(0))).getTabRunCount(a);
 110         for (int i = 1; i < uis.size(); i++) {
 111             ((TabbedPaneUI) (uis.elementAt(i))).getTabRunCount(a);
 112         }
 113         return returnValue;
 114     }
 115 
 116 ////////////////////
 117 // ComponentUI methods
 118 ////////////////////
 119 
 120     /**
 121      * Invokes the <code>contains</code> method on each UI handled by this object.
 122      *
 123      * @return the value obtained from the first UI, which is
 124      * the UI obtained from the default <code>LookAndFeel</code>
 125      */
 126     public boolean contains(JComponent a, int b, int c) {
 127         boolean returnValue =
 128             uis.elementAt(0).contains(a,b,c);
 129         for (int i = 1; i < uis.size(); i++) {
 130             uis.elementAt(i).contains(a,b,c);
 131         }
 132         return returnValue;
 133     }
 134 
 135     /**
 136      * Invokes the <code>update</code> method on each UI handled by this object.
 137      */
 138     public void update(Graphics a, JComponent b) {
 139         for (int i = 0; i < uis.size(); i++) {
 140             uis.elementAt(i).update(a,b);
 141         }
 142     }
 143 
 144     /**
 145      * Returns a multiplexing UI instance if any of the auxiliary
 146      * <code>LookAndFeel</code>s supports this UI.  Otherwise, just returns the
 147      * UI object obtained from the default <code>LookAndFeel</code>.
 148      */
 149     public static ComponentUI createUI(JComponent a) {
 150         MultiTabbedPaneUI mui = new MultiTabbedPaneUI();
 151         return MultiLookAndFeel.createUIs(mui, mui.uis, a);


 152     }
 153 
 154     /**
 155      * Invokes the <code>installUI</code> method on each UI handled by this object.
 156      */
 157     public void installUI(JComponent a) {
 158         for (int i = 0; i < uis.size(); i++) {
 159             uis.elementAt(i).installUI(a);
 160         }
 161     }
 162 
 163     /**
 164      * Invokes the <code>uninstallUI</code> method on each UI handled by this object.
 165      */
 166     public void uninstallUI(JComponent a) {
 167         for (int i = 0; i < uis.size(); i++) {
 168             uis.elementAt(i).uninstallUI(a);
 169         }
 170     }
 171 
 172     /**
 173      * Invokes the <code>paint</code> method on each UI handled by this object.
 174      */
 175     public void paint(Graphics a, JComponent b) {
 176         for (int i = 0; i < uis.size(); i++) {
 177             uis.elementAt(i).paint(a,b);
 178         }
 179     }
 180 
 181     /**
 182      * Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
 183      *
 184      * @return the value obtained from the first UI, which is
 185      * the UI obtained from the default <code>LookAndFeel</code>
 186      */
 187     public Dimension getPreferredSize(JComponent a) {
 188         Dimension returnValue =
 189             uis.elementAt(0).getPreferredSize(a);
 190         for (int i = 1; i < uis.size(); i++) {
 191             uis.elementAt(i).getPreferredSize(a);
 192         }
 193         return returnValue;
 194     }
 195 
 196     /**
 197      * Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
 198      *
 199      * @return the value obtained from the first UI, which is
 200      * the UI obtained from the default <code>LookAndFeel</code>
 201      */
 202     public Dimension getMinimumSize(JComponent a) {
 203         Dimension returnValue =
 204             uis.elementAt(0).getMinimumSize(a);
 205         for (int i = 1; i < uis.size(); i++) {
 206             uis.elementAt(i).getMinimumSize(a);
 207         }
 208         return returnValue;
 209     }
 210 
 211     /**
 212      * Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
 213      *
 214      * @return the value obtained from the first UI, which is
 215      * the UI obtained from the default <code>LookAndFeel</code>
 216      */
 217     public Dimension getMaximumSize(JComponent a) {
 218         Dimension returnValue =
 219             uis.elementAt(0).getMaximumSize(a);
 220         for (int i = 1; i < uis.size(); i++) {
 221             uis.elementAt(i).getMaximumSize(a);
 222         }
 223         return returnValue;
 224     }
 225 
 226     /**
 227      * Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
 228      *
 229      * @return the value obtained from the first UI, which is
 230      * the UI obtained from the default <code>LookAndFeel</code>
 231      */
 232     public int getAccessibleChildrenCount(JComponent a) {
 233         int returnValue =
 234             uis.elementAt(0).getAccessibleChildrenCount(a);
 235         for (int i = 1; i < uis.size(); i++) {
 236             uis.elementAt(i).getAccessibleChildrenCount(a);
 237         }
 238         return returnValue;
 239     }
 240 
 241     /**
 242      * Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
 243      *
 244      * @return the value obtained from the first UI, which is
 245      * the UI obtained from the default <code>LookAndFeel</code>
 246      */
 247     public Accessible getAccessibleChild(JComponent a, int b) {
 248         Accessible returnValue =
 249             uis.elementAt(0).getAccessibleChild(a,b);
 250         for (int i = 1; i < uis.size(); i++) {
 251             uis.elementAt(i).getAccessibleChild(a,b);
 252         }
 253         return returnValue;
 254     }
 255 }