1 7 package javax.swing.plaf.multi; 8 9 import java.util.Vector ; 10 import javax.swing.plaf.FileChooserUI ; 11 import javax.swing.filechooser.FileFilter ; 12 import javax.swing.JFileChooser ; 13 import javax.swing.filechooser.FileView ; 14 import java.lang.String ; 15 import java.io.File ; 16 import javax.swing.plaf.ComponentUI ; 17 import javax.swing.JComponent ; 18 import java.awt.Graphics ; 19 import java.awt.Dimension ; 20 import javax.accessibility.Accessible ; 21 22 30 public class MultiFileChooserUI extends FileChooserUI { 31 32 38 protected Vector uis = new Vector (); 39 40 44 49 public ComponentUI [] getUIs() { 50 return MultiLookAndFeel.uisToArray(uis); 51 } 52 53 57 63 public FileFilter getAcceptAllFileFilter(JFileChooser a) { 64 FileFilter returnValue = 65 ((FileChooserUI ) (uis.elementAt(0))).getAcceptAllFileFilter(a); 66 for (int i = 1; i < uis.size(); i++) { 67 ((FileChooserUI ) (uis.elementAt(i))).getAcceptAllFileFilter(a); 68 } 69 return returnValue; 70 } 71 72 78 public FileView getFileView(JFileChooser a) { 79 FileView returnValue = 80 ((FileChooserUI ) (uis.elementAt(0))).getFileView(a); 81 for (int i = 1; i < uis.size(); i++) { 82 ((FileChooserUI ) (uis.elementAt(i))).getFileView(a); 83 } 84 return returnValue; 85 } 86 87 93 public String getApproveButtonText(JFileChooser a) { 94 String returnValue = 95 ((FileChooserUI ) (uis.elementAt(0))).getApproveButtonText(a); 96 for (int i = 1; i < uis.size(); i++) { 97 ((FileChooserUI ) (uis.elementAt(i))).getApproveButtonText(a); 98 } 99 return returnValue; 100 } 101 102 108 public String getDialogTitle(JFileChooser a) { 109 String returnValue = 110 ((FileChooserUI ) (uis.elementAt(0))).getDialogTitle(a); 111 for (int i = 1; i < uis.size(); i++) { 112 ((FileChooserUI ) (uis.elementAt(i))).getDialogTitle(a); 113 } 114 return returnValue; 115 } 116 117 120 public void rescanCurrentDirectory(JFileChooser a) { 121 for (int i = 0; i < uis.size(); i++) { 122 ((FileChooserUI ) (uis.elementAt(i))).rescanCurrentDirectory(a); 123 } 124 } 125 126 129 public void ensureFileIsVisible(JFileChooser a, File b) { 130 for (int i = 0; i < uis.size(); i++) { 131 ((FileChooserUI ) (uis.elementAt(i))).ensureFileIsVisible(a,b); 132 } 133 } 134 135 139 145 public boolean contains(JComponent a, int b, int c) { 146 boolean returnValue = 147 ((ComponentUI ) (uis.elementAt(0))).contains(a,b,c); 148 for (int i = 1; i < uis.size(); i++) { 149 ((ComponentUI ) (uis.elementAt(i))).contains(a,b,c); 150 } 151 return returnValue; 152 } 153 154 157 public void update(Graphics a, JComponent b) { 158 for (int i = 0; i < uis.size(); i++) { 159 ((ComponentUI ) (uis.elementAt(i))).update(a,b); 160 } 161 } 162 163 168 public static ComponentUI createUI(JComponent a) { 169 ComponentUI mui = new MultiFileChooserUI (); 170 return MultiLookAndFeel.createUIs(mui, 171 ((MultiFileChooserUI ) mui).uis, 172 a); 173 } 174 175 178 public void installUI(JComponent a) { 179 for (int i = 0; i < uis.size(); i++) { 180 ((ComponentUI ) (uis.elementAt(i))).installUI(a); 181 } 182 } 183 184 187 public void uninstallUI(JComponent a) { 188 for (int i = 0; i < uis.size(); i++) { 189 ((ComponentUI ) (uis.elementAt(i))).uninstallUI(a); 190 } 191 } 192 193 196 public void paint(Graphics a, JComponent b) { 197 for (int i = 0; i < uis.size(); i++) { 198 ((ComponentUI ) (uis.elementAt(i))).paint(a,b); 199 } 200 } 201 202 208 public Dimension getPreferredSize(JComponent a) { 209 Dimension returnValue = 210 ((ComponentUI ) (uis.elementAt(0))).getPreferredSize(a); 211 for (int i = 1; i < uis.size(); i++) { 212 ((ComponentUI ) (uis.elementAt(i))).getPreferredSize(a); 213 } 214 return returnValue; 215 } 216 217 223 public Dimension getMinimumSize(JComponent a) { 224 Dimension returnValue = 225 ((ComponentUI ) (uis.elementAt(0))).getMinimumSize(a); 226 for (int i = 1; i < uis.size(); i++) { 227 ((ComponentUI ) (uis.elementAt(i))).getMinimumSize(a); 228 } 229 return returnValue; 230 } 231 232 238 public Dimension getMaximumSize(JComponent a) { 239 Dimension returnValue = 240 ((ComponentUI ) (uis.elementAt(0))).getMaximumSize(a); 241 for (int i = 1; i < uis.size(); i++) { 242 ((ComponentUI ) (uis.elementAt(i))).getMaximumSize(a); 243 } 244 return returnValue; 245 } 246 247 253 public int getAccessibleChildrenCount(JComponent a) { 254 int returnValue = 255 ((ComponentUI ) (uis.elementAt(0))).getAccessibleChildrenCount(a); 256 for (int i = 1; i < uis.size(); i++) { 257 ((ComponentUI ) (uis.elementAt(i))).getAccessibleChildrenCount(a); 258 } 259 return returnValue; 260 } 261 262 268 public Accessible getAccessibleChild(JComponent a, int b) { 269 Accessible returnValue = 270 ((ComponentUI ) (uis.elementAt(0))).getAccessibleChild(a,b); 271 for (int i = 1; i < uis.size(); i++) { 272 ((ComponentUI ) (uis.elementAt(i))).getAccessibleChild(a,b); 273 } 274 return returnValue; 275 } 276 } 277 | Popular Tags |