1 7 package javax.swing.plaf.multi; 8 9 import java.util.Vector ; 10 import javax.swing.plaf.TabbedPaneUI ; 11 import javax.swing.JTabbedPane ; 12 import java.awt.Rectangle ; 13 import javax.swing.plaf.ComponentUI ; 14 import javax.swing.JComponent ; 15 import java.awt.Graphics ; 16 import java.awt.Dimension ; 17 import javax.accessibility.Accessible ; 18 19 27 public class MultiTabbedPaneUI extends TabbedPaneUI { 28 29 35 protected Vector uis = new Vector (); 36 37 41 46 public ComponentUI [] getUIs() { 47 return MultiLookAndFeel.uisToArray(uis); 48 } 49 50 54 60 public int tabForCoordinate(JTabbedPane a, int b, int c) { 61 int returnValue = 62 ((TabbedPaneUI ) (uis.elementAt(0))).tabForCoordinate(a,b,c); 63 for (int i = 1; i < uis.size(); i++) { 64 ((TabbedPaneUI ) (uis.elementAt(i))).tabForCoordinate(a,b,c); 65 } 66 return returnValue; 67 } 68 69 75 public Rectangle getTabBounds(JTabbedPane a, int b) { 76 Rectangle returnValue = 77 ((TabbedPaneUI ) (uis.elementAt(0))).getTabBounds(a,b); 78 for (int i = 1; i < uis.size(); i++) { 79 ((TabbedPaneUI ) (uis.elementAt(i))).getTabBounds(a,b); 80 } 81 return returnValue; 82 } 83 84 90 public int getTabRunCount(JTabbedPane a) { 91 int returnValue = 92 ((TabbedPaneUI ) (uis.elementAt(0))).getTabRunCount(a); 93 for (int i = 1; i < uis.size(); i++) { 94 ((TabbedPaneUI ) (uis.elementAt(i))).getTabRunCount(a); 95 } 96 return returnValue; 97 } 98 99 103 109 public boolean contains(JComponent a, int b, int c) { 110 boolean returnValue = 111 ((ComponentUI ) (uis.elementAt(0))).contains(a,b,c); 112 for (int i = 1; i < uis.size(); i++) { 113 ((ComponentUI ) (uis.elementAt(i))).contains(a,b,c); 114 } 115 return returnValue; 116 } 117 118 121 public void update(Graphics a, JComponent b) { 122 for (int i = 0; i < uis.size(); i++) { 123 ((ComponentUI ) (uis.elementAt(i))).update(a,b); 124 } 125 } 126 127 132 public static ComponentUI createUI(JComponent a) { 133 ComponentUI mui = new MultiTabbedPaneUI (); 134 return MultiLookAndFeel.createUIs(mui, 135 ((MultiTabbedPaneUI ) mui).uis, 136 a); 137 } 138 139 142 public void installUI(JComponent a) { 143 for (int i = 0; i < uis.size(); i++) { 144 ((ComponentUI ) (uis.elementAt(i))).installUI(a); 145 } 146 } 147 148 151 public void uninstallUI(JComponent a) { 152 for (int i = 0; i < uis.size(); i++) { 153 ((ComponentUI ) (uis.elementAt(i))).uninstallUI(a); 154 } 155 } 156 157 160 public void paint(Graphics a, JComponent b) { 161 for (int i = 0; i < uis.size(); i++) { 162 ((ComponentUI ) (uis.elementAt(i))).paint(a,b); 163 } 164 } 165 166 172 public Dimension getPreferredSize(JComponent a) { 173 Dimension returnValue = 174 ((ComponentUI ) (uis.elementAt(0))).getPreferredSize(a); 175 for (int i = 1; i < uis.size(); i++) { 176 ((ComponentUI ) (uis.elementAt(i))).getPreferredSize(a); 177 } 178 return returnValue; 179 } 180 181 187 public Dimension getMinimumSize(JComponent a) { 188 Dimension returnValue = 189 ((ComponentUI ) (uis.elementAt(0))).getMinimumSize(a); 190 for (int i = 1; i < uis.size(); i++) { 191 ((ComponentUI ) (uis.elementAt(i))).getMinimumSize(a); 192 } 193 return returnValue; 194 } 195 196 202 public Dimension getMaximumSize(JComponent a) { 203 Dimension returnValue = 204 ((ComponentUI ) (uis.elementAt(0))).getMaximumSize(a); 205 for (int i = 1; i < uis.size(); i++) { 206 ((ComponentUI ) (uis.elementAt(i))).getMaximumSize(a); 207 } 208 return returnValue; 209 } 210 211 217 public int getAccessibleChildrenCount(JComponent a) { 218 int returnValue = 219 ((ComponentUI ) (uis.elementAt(0))).getAccessibleChildrenCount(a); 220 for (int i = 1; i < uis.size(); i++) { 221 ((ComponentUI ) (uis.elementAt(i))).getAccessibleChildrenCount(a); 222 } 223 return returnValue; 224 } 225 226 232 public Accessible getAccessibleChild(JComponent a, int b) { 233 Accessible returnValue = 234 ((ComponentUI ) (uis.elementAt(0))).getAccessibleChild(a,b); 235 for (int i = 1; i < uis.size(); i++) { 236 ((ComponentUI ) (uis.elementAt(i))).getAccessibleChild(a,b); 237 } 238 return returnValue; 239 } 240 } 241 | Popular Tags |