1 7 package javax.swing.plaf.multi; 8 9 import java.util.Vector ; 10 import javax.swing.plaf.OptionPaneUI ; 11 import javax.swing.JOptionPane ; 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 MultiOptionPaneUI extends OptionPaneUI { 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 selectInitialValue(JOptionPane a) { 57 for (int i = 0; i < uis.size(); i++) { 58 ((OptionPaneUI ) (uis.elementAt(i))).selectInitialValue(a); 59 } 60 } 61 62 68 public boolean containsCustomComponents(JOptionPane a) { 69 boolean returnValue = 70 ((OptionPaneUI ) (uis.elementAt(0))).containsCustomComponents(a); 71 for (int i = 1; i < uis.size(); i++) { 72 ((OptionPaneUI ) (uis.elementAt(i))).containsCustomComponents(a); 73 } 74 return returnValue; 75 } 76 77 81 87 public boolean contains(JComponent a, int b, int c) { 88 boolean returnValue = 89 ((ComponentUI ) (uis.elementAt(0))).contains(a,b,c); 90 for (int i = 1; i < uis.size(); i++) { 91 ((ComponentUI ) (uis.elementAt(i))).contains(a,b,c); 92 } 93 return returnValue; 94 } 95 96 99 public void update(Graphics a, JComponent b) { 100 for (int i = 0; i < uis.size(); i++) { 101 ((ComponentUI ) (uis.elementAt(i))).update(a,b); 102 } 103 } 104 105 110 public static ComponentUI createUI(JComponent a) { 111 ComponentUI mui = new MultiOptionPaneUI (); 112 return MultiLookAndFeel.createUIs(mui, 113 ((MultiOptionPaneUI ) mui).uis, 114 a); 115 } 116 117 120 public void installUI(JComponent a) { 121 for (int i = 0; i < uis.size(); i++) { 122 ((ComponentUI ) (uis.elementAt(i))).installUI(a); 123 } 124 } 125 126 129 public void uninstallUI(JComponent a) { 130 for (int i = 0; i < uis.size(); i++) { 131 ((ComponentUI ) (uis.elementAt(i))).uninstallUI(a); 132 } 133 } 134 135 138 public void paint(Graphics a, JComponent b) { 139 for (int i = 0; i < uis.size(); i++) { 140 ((ComponentUI ) (uis.elementAt(i))).paint(a,b); 141 } 142 } 143 144 150 public Dimension getPreferredSize(JComponent a) { 151 Dimension returnValue = 152 ((ComponentUI ) (uis.elementAt(0))).getPreferredSize(a); 153 for (int i = 1; i < uis.size(); i++) { 154 ((ComponentUI ) (uis.elementAt(i))).getPreferredSize(a); 155 } 156 return returnValue; 157 } 158 159 165 public Dimension getMinimumSize(JComponent a) { 166 Dimension returnValue = 167 ((ComponentUI ) (uis.elementAt(0))).getMinimumSize(a); 168 for (int i = 1; i < uis.size(); i++) { 169 ((ComponentUI ) (uis.elementAt(i))).getMinimumSize(a); 170 } 171 return returnValue; 172 } 173 174 180 public Dimension getMaximumSize(JComponent a) { 181 Dimension returnValue = 182 ((ComponentUI ) (uis.elementAt(0))).getMaximumSize(a); 183 for (int i = 1; i < uis.size(); i++) { 184 ((ComponentUI ) (uis.elementAt(i))).getMaximumSize(a); 185 } 186 return returnValue; 187 } 188 189 195 public int getAccessibleChildrenCount(JComponent a) { 196 int returnValue = 197 ((ComponentUI ) (uis.elementAt(0))).getAccessibleChildrenCount(a); 198 for (int i = 1; i < uis.size(); i++) { 199 ((ComponentUI ) (uis.elementAt(i))).getAccessibleChildrenCount(a); 200 } 201 return returnValue; 202 } 203 204 210 public Accessible getAccessibleChild(JComponent a, int b) { 211 Accessible returnValue = 212 ((ComponentUI ) (uis.elementAt(0))).getAccessibleChild(a,b); 213 for (int i = 1; i < uis.size(); i++) { 214 ((ComponentUI ) (uis.elementAt(i))).getAccessibleChild(a,b); 215 } 216 return returnValue; 217 } 218 } 219 | Popular Tags |