1. /*
  2. * @(#)MultiSplitPaneUI.java 1.26 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package javax.swing.plaf.multi;
  8. import java.util.Vector;
  9. import javax.swing.plaf.SplitPaneUI;
  10. import javax.swing.JSplitPane;
  11. import java.awt.Graphics;
  12. import javax.swing.plaf.ComponentUI;
  13. import javax.swing.JComponent;
  14. import java.awt.Dimension;
  15. import javax.accessibility.Accessible;
  16. /**
  17. * A multiplexing UI used to combine <code>SplitPaneUI</code>s.
  18. *
  19. * <p>This file was automatically generated by AutoMulti.
  20. *
  21. * @version 1.26 01/23/03 13:24:39
  22. * @author Otto Multey
  23. */
  24. public class MultiSplitPaneUI extends SplitPaneUI {
  25. /**
  26. * The vector containing the real UIs. This is populated
  27. * in the call to <code>createUI</code>, and can be obtained by calling
  28. * the <code>getUIs</code> method. The first element is guaranteed to be the real UI
  29. * obtained from the default look and feel.
  30. */
  31. protected Vector uis = new Vector();
  32. ////////////////////
  33. // Common UI methods
  34. ////////////////////
  35. /**
  36. * Returns the list of UIs associated with this multiplexing UI. This
  37. * allows processing of the UIs by an application aware of multiplexing
  38. * UIs on components.
  39. */
  40. public ComponentUI[] getUIs() {
  41. return MultiLookAndFeel.uisToArray(uis);
  42. }
  43. ////////////////////
  44. // SplitPaneUI methods
  45. ////////////////////
  46. /**
  47. * Invokes the <code>resetToPreferredSizes</code> method on each UI handled by this object.
  48. */
  49. public void resetToPreferredSizes(JSplitPane a) {
  50. for (int i = 0; i < uis.size(); i++) {
  51. ((SplitPaneUI) (uis.elementAt(i))).resetToPreferredSizes(a);
  52. }
  53. }
  54. /**
  55. * Invokes the <code>setDividerLocation</code> method on each UI handled by this object.
  56. */
  57. public void setDividerLocation(JSplitPane a, int b) {
  58. for (int i = 0; i < uis.size(); i++) {
  59. ((SplitPaneUI) (uis.elementAt(i))).setDividerLocation(a,b);
  60. }
  61. }
  62. /**
  63. * Invokes the <code>getDividerLocation</code> method on each UI handled by this object.
  64. *
  65. * @return the value obtained from the first UI, which is
  66. * the UI obtained from the default <code>LookAndFeel</code>
  67. */
  68. public int getDividerLocation(JSplitPane a) {
  69. int returnValue =
  70. ((SplitPaneUI) (uis.elementAt(0))).getDividerLocation(a);
  71. for (int i = 1; i < uis.size(); i++) {
  72. ((SplitPaneUI) (uis.elementAt(i))).getDividerLocation(a);
  73. }
  74. return returnValue;
  75. }
  76. /**
  77. * Invokes the <code>getMinimumDividerLocation</code> method on each UI handled by this object.
  78. *
  79. * @return the value obtained from the first UI, which is
  80. * the UI obtained from the default <code>LookAndFeel</code>
  81. */
  82. public int getMinimumDividerLocation(JSplitPane a) {
  83. int returnValue =
  84. ((SplitPaneUI) (uis.elementAt(0))).getMinimumDividerLocation(a);
  85. for (int i = 1; i < uis.size(); i++) {
  86. ((SplitPaneUI) (uis.elementAt(i))).getMinimumDividerLocation(a);
  87. }
  88. return returnValue;
  89. }
  90. /**
  91. * Invokes the <code>getMaximumDividerLocation</code> method on each UI handled by this object.
  92. *
  93. * @return the value obtained from the first UI, which is
  94. * the UI obtained from the default <code>LookAndFeel</code>
  95. */
  96. public int getMaximumDividerLocation(JSplitPane a) {
  97. int returnValue =
  98. ((SplitPaneUI) (uis.elementAt(0))).getMaximumDividerLocation(a);
  99. for (int i = 1; i < uis.size(); i++) {
  100. ((SplitPaneUI) (uis.elementAt(i))).getMaximumDividerLocation(a);
  101. }
  102. return returnValue;
  103. }
  104. /**
  105. * Invokes the <code>finishedPaintingChildren</code> method on each UI handled by this object.
  106. */
  107. public void finishedPaintingChildren(JSplitPane a, Graphics b) {
  108. for (int i = 0; i < uis.size(); i++) {
  109. ((SplitPaneUI) (uis.elementAt(i))).finishedPaintingChildren(a,b);
  110. }
  111. }
  112. ////////////////////
  113. // ComponentUI methods
  114. ////////////////////
  115. /**
  116. * Invokes the <code>contains</code> method on each UI handled by this object.
  117. *
  118. * @return the value obtained from the first UI, which is
  119. * the UI obtained from the default <code>LookAndFeel</code>
  120. */
  121. public boolean contains(JComponent a, int b, int c) {
  122. boolean returnValue =
  123. ((ComponentUI) (uis.elementAt(0))).contains(a,b,c);
  124. for (int i = 1; i < uis.size(); i++) {
  125. ((ComponentUI) (uis.elementAt(i))).contains(a,b,c);
  126. }
  127. return returnValue;
  128. }
  129. /**
  130. * Invokes the <code>update</code> method on each UI handled by this object.
  131. */
  132. public void update(Graphics a, JComponent b) {
  133. for (int i = 0; i < uis.size(); i++) {
  134. ((ComponentUI) (uis.elementAt(i))).update(a,b);
  135. }
  136. }
  137. /**
  138. * Returns a multiplexing UI instance if any of the auxiliary
  139. * <code>LookAndFeel</code>s supports this UI. Otherwise, just returns the
  140. * UI object obtained from the default <code>LookAndFeel</code>.
  141. */
  142. public static ComponentUI createUI(JComponent a) {
  143. ComponentUI mui = new MultiSplitPaneUI();
  144. return MultiLookAndFeel.createUIs(mui,
  145. ((MultiSplitPaneUI) mui).uis,
  146. a);
  147. }
  148. /**
  149. * Invokes the <code>installUI</code> method on each UI handled by this object.
  150. */
  151. public void installUI(JComponent a) {
  152. for (int i = 0; i < uis.size(); i++) {
  153. ((ComponentUI) (uis.elementAt(i))).installUI(a);
  154. }
  155. }
  156. /**
  157. * Invokes the <code>uninstallUI</code> method on each UI handled by this object.
  158. */
  159. public void uninstallUI(JComponent a) {
  160. for (int i = 0; i < uis.size(); i++) {
  161. ((ComponentUI) (uis.elementAt(i))).uninstallUI(a);
  162. }
  163. }
  164. /**
  165. * Invokes the <code>paint</code> method on each UI handled by this object.
  166. */
  167. public void paint(Graphics a, JComponent b) {
  168. for (int i = 0; i < uis.size(); i++) {
  169. ((ComponentUI) (uis.elementAt(i))).paint(a,b);
  170. }
  171. }
  172. /**
  173. * Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
  174. *
  175. * @return the value obtained from the first UI, which is
  176. * the UI obtained from the default <code>LookAndFeel</code>
  177. */
  178. public Dimension getPreferredSize(JComponent a) {
  179. Dimension returnValue =
  180. ((ComponentUI) (uis.elementAt(0))).getPreferredSize(a);
  181. for (int i = 1; i < uis.size(); i++) {
  182. ((ComponentUI) (uis.elementAt(i))).getPreferredSize(a);
  183. }
  184. return returnValue;
  185. }
  186. /**
  187. * Invokes the <code>getMinimumSize</code> method on each UI handled by this object.
  188. *
  189. * @return the value obtained from the first UI, which is
  190. * the UI obtained from the default <code>LookAndFeel</code>
  191. */
  192. public Dimension getMinimumSize(JComponent a) {
  193. Dimension returnValue =
  194. ((ComponentUI) (uis.elementAt(0))).getMinimumSize(a);
  195. for (int i = 1; i < uis.size(); i++) {
  196. ((ComponentUI) (uis.elementAt(i))).getMinimumSize(a);
  197. }
  198. return returnValue;
  199. }
  200. /**
  201. * Invokes the <code>getMaximumSize</code> method on each UI handled by this object.
  202. *
  203. * @return the value obtained from the first UI, which is
  204. * the UI obtained from the default <code>LookAndFeel</code>
  205. */
  206. public Dimension getMaximumSize(JComponent a) {
  207. Dimension returnValue =
  208. ((ComponentUI) (uis.elementAt(0))).getMaximumSize(a);
  209. for (int i = 1; i < uis.size(); i++) {
  210. ((ComponentUI) (uis.elementAt(i))).getMaximumSize(a);
  211. }
  212. return returnValue;
  213. }
  214. /**
  215. * Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
  216. *
  217. * @return the value obtained from the first UI, which is
  218. * the UI obtained from the default <code>LookAndFeel</code>
  219. */
  220. public int getAccessibleChildrenCount(JComponent a) {
  221. int returnValue =
  222. ((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a);
  223. for (int i = 1; i < uis.size(); i++) {
  224. ((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a);
  225. }
  226. return returnValue;
  227. }
  228. /**
  229. * Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
  230. *
  231. * @return the value obtained from the first UI, which is
  232. * the UI obtained from the default <code>LookAndFeel</code>
  233. */
  234. public Accessible getAccessibleChild(JComponent a, int b) {
  235. Accessible returnValue =
  236. ((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b);
  237. for (int i = 1; i < uis.size(); i++) {
  238. ((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b);
  239. }
  240. return returnValue;
  241. }
  242. }