1 7 package javax.swing.plaf.multi; 8 9 import java.util.Vector ; 10 import javax.swing.plaf.MenuBarUI ; 11 import javax.swing.plaf.ComponentUI ; 12 import javax.swing.JComponent ; 13 import java.awt.Graphics ; 14 import java.awt.Dimension ; 15 import javax.accessibility.Accessible ; 16 17 25 public class MultiMenuBarUI extends MenuBarUI { 26 27 33 protected Vector uis = new Vector (); 34 35 39 44 public ComponentUI [] getUIs() { 45 return MultiLookAndFeel.uisToArray(uis); 46 } 47 48 52 56 62 public boolean contains(JComponent a, int b, int c) { 63 boolean returnValue = 64 ((ComponentUI ) (uis.elementAt(0))).contains(a,b,c); 65 for (int i = 1; i < uis.size(); i++) { 66 ((ComponentUI ) (uis.elementAt(i))).contains(a,b,c); 67 } 68 return returnValue; 69 } 70 71 74 public void update(Graphics a, JComponent b) { 75 for (int i = 0; i < uis.size(); i++) { 76 ((ComponentUI ) (uis.elementAt(i))).update(a,b); 77 } 78 } 79 80 85 public static ComponentUI createUI(JComponent a) { 86 ComponentUI mui = new MultiMenuBarUI (); 87 return MultiLookAndFeel.createUIs(mui, 88 ((MultiMenuBarUI ) mui).uis, 89 a); 90 } 91 92 95 public void installUI(JComponent a) { 96 for (int i = 0; i < uis.size(); i++) { 97 ((ComponentUI ) (uis.elementAt(i))).installUI(a); 98 } 99 } 100 101 104 public void uninstallUI(JComponent a) { 105 for (int i = 0; i < uis.size(); i++) { 106 ((ComponentUI ) (uis.elementAt(i))).uninstallUI(a); 107 } 108 } 109 110 113 public void paint(Graphics a, JComponent b) { 114 for (int i = 0; i < uis.size(); i++) { 115 ((ComponentUI ) (uis.elementAt(i))).paint(a,b); 116 } 117 } 118 119 125 public Dimension getPreferredSize(JComponent a) { 126 Dimension returnValue = 127 ((ComponentUI ) (uis.elementAt(0))).getPreferredSize(a); 128 for (int i = 1; i < uis.size(); i++) { 129 ((ComponentUI ) (uis.elementAt(i))).getPreferredSize(a); 130 } 131 return returnValue; 132 } 133 134 140 public Dimension getMinimumSize(JComponent a) { 141 Dimension returnValue = 142 ((ComponentUI ) (uis.elementAt(0))).getMinimumSize(a); 143 for (int i = 1; i < uis.size(); i++) { 144 ((ComponentUI ) (uis.elementAt(i))).getMinimumSize(a); 145 } 146 return returnValue; 147 } 148 149 155 public Dimension getMaximumSize(JComponent a) { 156 Dimension returnValue = 157 ((ComponentUI ) (uis.elementAt(0))).getMaximumSize(a); 158 for (int i = 1; i < uis.size(); i++) { 159 ((ComponentUI ) (uis.elementAt(i))).getMaximumSize(a); 160 } 161 return returnValue; 162 } 163 164 170 public int getAccessibleChildrenCount(JComponent a) { 171 int returnValue = 172 ((ComponentUI ) (uis.elementAt(0))).getAccessibleChildrenCount(a); 173 for (int i = 1; i < uis.size(); i++) { 174 ((ComponentUI ) (uis.elementAt(i))).getAccessibleChildrenCount(a); 175 } 176 return returnValue; 177 } 178 179 185 public Accessible getAccessibleChild(JComponent a, int b) { 186 Accessible returnValue = 187 ((ComponentUI ) (uis.elementAt(0))).getAccessibleChild(a,b); 188 for (int i = 1; i < uis.size(); i++) { 189 ((ComponentUI ) (uis.elementAt(i))).getAccessibleChild(a,b); 190 } 191 return returnValue; 192 } 193 } 194 | Popular Tags |