src/share/classes/javax/swing/plaf/multi/MultiPopupMenuUI.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>PopupMenuUI</code>s.
  40  *
  41  * <p>This file was automatically generated by AutoMulti.
  42  *
  43  * @author  Otto Multey
  44  */
  45 public class MultiPopupMenuUI extends PopupMenuUI {
  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     public ComponentUI[] getUIs() {
  65         return MultiLookAndFeel.uisToArray(uis);
  66     }
  67 
  68 ////////////////////
  69 // PopupMenuUI methods
  70 ////////////////////
  71 
  72     /**
  73      * Invokes the <code>isPopupTrigger</code> method on each UI handled by this object.


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


  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>PopupMenuUI</code>s.
  40  *
  41  * <p>This file was automatically generated by AutoMulti.
  42  *
  43  * @author  Otto Multey
  44  */
  45 public class MultiPopupMenuUI extends PopupMenuUI {
  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     public ComponentUI[] getUIs() {
  65         return MultiLookAndFeel.uisToArray(uis);
  66     }
  67 
  68 ////////////////////
  69 // PopupMenuUI methods
  70 ////////////////////
  71 
  72     /**
  73      * Invokes the <code>isPopupTrigger</code> method on each UI handled by this object.


  96         Popup returnValue =
  97             ((PopupMenuUI) (uis.elementAt(0))).getPopup(a,b,c);
  98         for (int i = 1; i < uis.size(); i++) {
  99             ((PopupMenuUI) (uis.elementAt(i))).getPopup(a,b,c);
 100         }
 101         return returnValue;
 102     }
 103 
 104 ////////////////////
 105 // ComponentUI methods
 106 ////////////////////
 107 
 108     /**
 109      * Invokes the <code>contains</code> method on each UI handled by this object.
 110      *
 111      * @return the value obtained from the first UI, which is
 112      * the UI obtained from the default <code>LookAndFeel</code>
 113      */
 114     public boolean contains(JComponent a, int b, int c) {
 115         boolean returnValue =
 116             uis.elementAt(0).contains(a,b,c);
 117         for (int i = 1; i < uis.size(); i++) {
 118             uis.elementAt(i).contains(a,b,c);
 119         }
 120         return returnValue;
 121     }
 122 
 123     /**
 124      * Invokes the <code>update</code> method on each UI handled by this object.
 125      */
 126     public void update(Graphics a, JComponent b) {
 127         for (int i = 0; i < uis.size(); i++) {
 128             uis.elementAt(i).update(a,b);
 129         }
 130     }
 131 
 132     /**
 133      * Returns a multiplexing UI instance if any of the auxiliary
 134      * <code>LookAndFeel</code>s supports this UI.  Otherwise, just returns the
 135      * UI object obtained from the default <code>LookAndFeel</code>.
 136      */
 137     public static ComponentUI createUI(JComponent a) {
 138         MultiPopupMenuUI mui = new MultiPopupMenuUI();
 139         return MultiLookAndFeel.createUIs(mui, mui.uis, a);


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