1 7 package javax.swing.plaf.multi; 8 9 import java.util.Vector ; 10 import javax.swing.plaf.MenuItemUI ; 11 import javax.swing.plaf.ButtonUI ; 12 import javax.swing.plaf.ComponentUI ; 13 import javax.swing.JComponent ; 14 import java.awt.Graphics ; 15 import java.awt.Dimension ; 16 import javax.accessibility.Accessible ; 17 18 26 public class MultiMenuItemUI extends MenuItemUI { 27 28 34 protected Vector uis = new Vector (); 35 36 40 45 public ComponentUI [] getUIs() { 46 return MultiLookAndFeel.uisToArray(uis); 47 } 48 49 53 57 61 67 public boolean contains(JComponent a, int b, int c) { 68 boolean returnValue = 69 ((ComponentUI ) (uis.elementAt(0))).contains(a,b,c); 70 for (int i = 1; i < uis.size(); i++) { 71 ((ComponentUI ) (uis.elementAt(i))).contains(a,b,c); 72 } 73 return returnValue; 74 } 75 76 79 public void update(Graphics a, JComponent b) { 80 for (int i = 0; i < uis.size(); i++) { 81 ((ComponentUI ) (uis.elementAt(i))).update(a,b); 82 } 83 } 84 85 90 public static ComponentUI createUI(JComponent a) { 91 ComponentUI mui = new MultiMenuItemUI (); 92 return MultiLookAndFeel.createUIs(mui, 93 ((MultiMenuItemUI ) mui).uis, 94 a); 95 } 96 97 100 public void installUI(JComponent a) { 101 for (int i = 0; i < uis.size(); i++) { 102 ((ComponentUI ) (uis.elementAt(i))).installUI(a); 103 } 104 } 105 106 109 public void uninstallUI(JComponent a) { 110 for (int i = 0; i < uis.size(); i++) { 111 ((ComponentUI ) (uis.elementAt(i))).uninstallUI(a); 112 } 113 } 114 115 118 public void paint(Graphics a, JComponent b) { 119 for (int i = 0; i < uis.size(); i++) { 120 ((ComponentUI ) (uis.elementAt(i))).paint(a,b); 121 } 122 } 123 124 130 public Dimension getPreferredSize(JComponent a) { 131 Dimension returnValue = 132 ((ComponentUI ) (uis.elementAt(0))).getPreferredSize(a); 133 for (int i = 1; i < uis.size(); i++) { 134 ((ComponentUI ) (uis.elementAt(i))).getPreferredSize(a); 135 } 136 return returnValue; 137 } 138 139 145 public Dimension getMinimumSize(JComponent a) { 146 Dimension returnValue = 147 ((ComponentUI ) (uis.elementAt(0))).getMinimumSize(a); 148 for (int i = 1; i < uis.size(); i++) { 149 ((ComponentUI ) (uis.elementAt(i))).getMinimumSize(a); 150 } 151 return returnValue; 152 } 153 154 160 public Dimension getMaximumSize(JComponent a) { 161 Dimension returnValue = 162 ((ComponentUI ) (uis.elementAt(0))).getMaximumSize(a); 163 for (int i = 1; i < uis.size(); i++) { 164 ((ComponentUI ) (uis.elementAt(i))).getMaximumSize(a); 165 } 166 return returnValue; 167 } 168 169 175 public int getAccessibleChildrenCount(JComponent a) { 176 int returnValue = 177 ((ComponentUI ) (uis.elementAt(0))).getAccessibleChildrenCount(a); 178 for (int i = 1; i < uis.size(); i++) { 179 ((ComponentUI ) (uis.elementAt(i))).getAccessibleChildrenCount(a); 180 } 181 return returnValue; 182 } 183 184 190 public Accessible getAccessibleChild(JComponent a, int b) { 191 Accessible returnValue = 192 ((ComponentUI ) (uis.elementAt(0))).getAccessibleChild(a,b); 193 for (int i = 1; i < uis.size(); i++) { 194 ((ComponentUI ) (uis.elementAt(i))).getAccessibleChild(a,b); 195 } 196 return returnValue; 197 } 198 } 199 | Popular Tags |