1 7 package javax.swing.plaf.multi; 8 9 import java.util.Vector ; 10 import javax.swing.plaf.SplitPaneUI ; 11 import javax.swing.JSplitPane ; 12 import java.awt.Graphics ; 13 import javax.swing.plaf.ComponentUI ; 14 import javax.swing.JComponent ; 15 import java.awt.Dimension ; 16 import javax.accessibility.Accessible ; 17 18 26 public class MultiSplitPaneUI extends SplitPaneUI { 27 28 34 protected Vector uis = new Vector (); 35 36 40 45 public ComponentUI [] getUIs() { 46 return MultiLookAndFeel.uisToArray(uis); 47 } 48 49 53 56 public void resetToPreferredSizes(JSplitPane a) { 57 for (int i = 0; i < uis.size(); i++) { 58 ((SplitPaneUI ) (uis.elementAt(i))).resetToPreferredSizes(a); 59 } 60 } 61 62 65 public void setDividerLocation(JSplitPane a, int b) { 66 for (int i = 0; i < uis.size(); i++) { 67 ((SplitPaneUI ) (uis.elementAt(i))).setDividerLocation(a,b); 68 } 69 } 70 71 77 public int getDividerLocation(JSplitPane a) { 78 int returnValue = 79 ((SplitPaneUI ) (uis.elementAt(0))).getDividerLocation(a); 80 for (int i = 1; i < uis.size(); i++) { 81 ((SplitPaneUI ) (uis.elementAt(i))).getDividerLocation(a); 82 } 83 return returnValue; 84 } 85 86 92 public int getMinimumDividerLocation(JSplitPane a) { 93 int returnValue = 94 ((SplitPaneUI ) (uis.elementAt(0))).getMinimumDividerLocation(a); 95 for (int i = 1; i < uis.size(); i++) { 96 ((SplitPaneUI ) (uis.elementAt(i))).getMinimumDividerLocation(a); 97 } 98 return returnValue; 99 } 100 101 107 public int getMaximumDividerLocation(JSplitPane a) { 108 int returnValue = 109 ((SplitPaneUI ) (uis.elementAt(0))).getMaximumDividerLocation(a); 110 for (int i = 1; i < uis.size(); i++) { 111 ((SplitPaneUI ) (uis.elementAt(i))).getMaximumDividerLocation(a); 112 } 113 return returnValue; 114 } 115 116 119 public void finishedPaintingChildren(JSplitPane a, Graphics b) { 120 for (int i = 0; i < uis.size(); i++) { 121 ((SplitPaneUI ) (uis.elementAt(i))).finishedPaintingChildren(a,b); 122 } 123 } 124 125 129 135 public boolean contains(JComponent a, int b, int c) { 136 boolean returnValue = 137 ((ComponentUI ) (uis.elementAt(0))).contains(a,b,c); 138 for (int i = 1; i < uis.size(); i++) { 139 ((ComponentUI ) (uis.elementAt(i))).contains(a,b,c); 140 } 141 return returnValue; 142 } 143 144 147 public void update(Graphics a, JComponent b) { 148 for (int i = 0; i < uis.size(); i++) { 149 ((ComponentUI ) (uis.elementAt(i))).update(a,b); 150 } 151 } 152 153 158 public static ComponentUI createUI(JComponent a) { 159 ComponentUI mui = new MultiSplitPaneUI (); 160 return MultiLookAndFeel.createUIs(mui, 161 ((MultiSplitPaneUI ) mui).uis, 162 a); 163 } 164 165 168 public void installUI(JComponent a) { 169 for (int i = 0; i < uis.size(); i++) { 170 ((ComponentUI ) (uis.elementAt(i))).installUI(a); 171 } 172 } 173 174 177 public void uninstallUI(JComponent a) { 178 for (int i = 0; i < uis.size(); i++) { 179 ((ComponentUI ) (uis.elementAt(i))).uninstallUI(a); 180 } 181 } 182 183 186 public void paint(Graphics a, JComponent b) { 187 for (int i = 0; i < uis.size(); i++) { 188 ((ComponentUI ) (uis.elementAt(i))).paint(a,b); 189 } 190 } 191 192 198 public Dimension getPreferredSize(JComponent a) { 199 Dimension returnValue = 200 ((ComponentUI ) (uis.elementAt(0))).getPreferredSize(a); 201 for (int i = 1; i < uis.size(); i++) { 202 ((ComponentUI ) (uis.elementAt(i))).getPreferredSize(a); 203 } 204 return returnValue; 205 } 206 207 213 public Dimension getMinimumSize(JComponent a) { 214 Dimension returnValue = 215 ((ComponentUI ) (uis.elementAt(0))).getMinimumSize(a); 216 for (int i = 1; i < uis.size(); i++) { 217 ((ComponentUI ) (uis.elementAt(i))).getMinimumSize(a); 218 } 219 return returnValue; 220 } 221 222 228 public Dimension getMaximumSize(JComponent a) { 229 Dimension returnValue = 230 ((ComponentUI ) (uis.elementAt(0))).getMaximumSize(a); 231 for (int i = 1; i < uis.size(); i++) { 232 ((ComponentUI ) (uis.elementAt(i))).getMaximumSize(a); 233 } 234 return returnValue; 235 } 236 237 243 public int getAccessibleChildrenCount(JComponent a) { 244 int returnValue = 245 ((ComponentUI ) (uis.elementAt(0))).getAccessibleChildrenCount(a); 246 for (int i = 1; i < uis.size(); i++) { 247 ((ComponentUI ) (uis.elementAt(i))).getAccessibleChildrenCount(a); 248 } 249 return returnValue; 250 } 251 252 258 public Accessible getAccessibleChild(JComponent a, int b) { 259 Accessible returnValue = 260 ((ComponentUI ) (uis.elementAt(0))).getAccessibleChild(a,b); 261 for (int i = 1; i < uis.size(); i++) { 262 ((ComponentUI ) (uis.elementAt(i))).getAccessibleChild(a,b); 263 } 264 return returnValue; 265 } 266 } 267 | Popular Tags |