1 7 package javax.swing.plaf.multi; 8 9 import java.util.Vector ; 10 import javax.swing.plaf.ComboBoxUI ; 11 import javax.swing.JComboBox ; 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 MultiComboBoxUI extends ComboBoxUI { 27 28 34 protected Vector uis = new Vector (); 35 36 40 45 public ComponentUI [] getUIs() { 46 return MultiLookAndFeel.uisToArray(uis); 47 } 48 49 53 59 public boolean isFocusTraversable(JComboBox a) { 60 boolean returnValue = 61 ((ComboBoxUI ) (uis.elementAt(0))).isFocusTraversable(a); 62 for (int i = 1; i < uis.size(); i++) { 63 ((ComboBoxUI ) (uis.elementAt(i))).isFocusTraversable(a); 64 } 65 return returnValue; 66 } 67 68 71 public void setPopupVisible(JComboBox a, boolean b) { 72 for (int i = 0; i < uis.size(); i++) { 73 ((ComboBoxUI ) (uis.elementAt(i))).setPopupVisible(a,b); 74 } 75 } 76 77 83 public boolean isPopupVisible(JComboBox a) { 84 boolean returnValue = 85 ((ComboBoxUI ) (uis.elementAt(0))).isPopupVisible(a); 86 for (int i = 1; i < uis.size(); i++) { 87 ((ComboBoxUI ) (uis.elementAt(i))).isPopupVisible(a); 88 } 89 return returnValue; 90 } 91 92 96 102 public boolean contains(JComponent a, int b, int c) { 103 boolean returnValue = 104 ((ComponentUI ) (uis.elementAt(0))).contains(a,b,c); 105 for (int i = 1; i < uis.size(); i++) { 106 ((ComponentUI ) (uis.elementAt(i))).contains(a,b,c); 107 } 108 return returnValue; 109 } 110 111 114 public void update(Graphics a, JComponent b) { 115 for (int i = 0; i < uis.size(); i++) { 116 ((ComponentUI ) (uis.elementAt(i))).update(a,b); 117 } 118 } 119 120 125 public static ComponentUI createUI(JComponent a) { 126 ComponentUI mui = new MultiComboBoxUI (); 127 return MultiLookAndFeel.createUIs(mui, 128 ((MultiComboBoxUI ) mui).uis, 129 a); 130 } 131 132 135 public void installUI(JComponent a) { 136 for (int i = 0; i < uis.size(); i++) { 137 ((ComponentUI ) (uis.elementAt(i))).installUI(a); 138 } 139 } 140 141 144 public void uninstallUI(JComponent a) { 145 for (int i = 0; i < uis.size(); i++) { 146 ((ComponentUI ) (uis.elementAt(i))).uninstallUI(a); 147 } 148 } 149 150 153 public void paint(Graphics a, JComponent b) { 154 for (int i = 0; i < uis.size(); i++) { 155 ((ComponentUI ) (uis.elementAt(i))).paint(a,b); 156 } 157 } 158 159 165 public Dimension getPreferredSize(JComponent a) { 166 Dimension returnValue = 167 ((ComponentUI ) (uis.elementAt(0))).getPreferredSize(a); 168 for (int i = 1; i < uis.size(); i++) { 169 ((ComponentUI ) (uis.elementAt(i))).getPreferredSize(a); 170 } 171 return returnValue; 172 } 173 174 180 public Dimension getMinimumSize(JComponent a) { 181 Dimension returnValue = 182 ((ComponentUI ) (uis.elementAt(0))).getMinimumSize(a); 183 for (int i = 1; i < uis.size(); i++) { 184 ((ComponentUI ) (uis.elementAt(i))).getMinimumSize(a); 185 } 186 return returnValue; 187 } 188 189 195 public Dimension getMaximumSize(JComponent a) { 196 Dimension returnValue = 197 ((ComponentUI ) (uis.elementAt(0))).getMaximumSize(a); 198 for (int i = 1; i < uis.size(); i++) { 199 ((ComponentUI ) (uis.elementAt(i))).getMaximumSize(a); 200 } 201 return returnValue; 202 } 203 204 210 public int getAccessibleChildrenCount(JComponent a) { 211 int returnValue = 212 ((ComponentUI ) (uis.elementAt(0))).getAccessibleChildrenCount(a); 213 for (int i = 1; i < uis.size(); i++) { 214 ((ComponentUI ) (uis.elementAt(i))).getAccessibleChildrenCount(a); 215 } 216 return returnValue; 217 } 218 219 225 public Accessible getAccessibleChild(JComponent a, int b) { 226 Accessible returnValue = 227 ((ComponentUI ) (uis.elementAt(0))).getAccessibleChild(a,b); 228 for (int i = 1; i < uis.size(); i++) { 229 ((ComponentUI ) (uis.elementAt(i))).getAccessibleChild(a,b); 230 } 231 return returnValue; 232 } 233 } 234 | Popular Tags |