1. /*
  2. * @(#)ParsedSynthStyle.java 1.3 03/12/19
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package javax.swing.plaf.synth;
  8. import java.awt.*;
  9. import javax.swing.*;
  10. import sun.swing.plaf.synth.*;
  11. /**
  12. * ParsedSynthStyle are the SynthStyle's that SynthParser creates.
  13. *
  14. * @version 1.3, 12/19/03
  15. * @author Scott Violet
  16. */
  17. class ParsedSynthStyle extends DefaultSynthStyle {
  18. private static SynthPainter DELEGATING_PAINTER_INSTANCE = new
  19. DelegatingPainter();
  20. private PainterInfo[] _painters;
  21. private static PainterInfo[] mergePainterInfo(PainterInfo[] old,
  22. PainterInfo[] newPI) {
  23. if (old == null) {
  24. return newPI;
  25. }
  26. if (newPI == null) {
  27. return old;
  28. }
  29. int oldLength = old.length;
  30. int newLength = newPI.length;
  31. int dups = 0;
  32. PainterInfo[] merged = new PainterInfo[oldLength + newLength];
  33. System.arraycopy(old, 0, merged, 0, oldLength);
  34. for (int newCounter = 0; newCounter < newLength; newCounter++) {
  35. boolean found = false;
  36. for (int oldCounter = 0; oldCounter < oldLength - dups;
  37. oldCounter++) {
  38. if (newPI[newCounter].equalsPainter(old[oldCounter])) {
  39. merged[oldCounter] = newPI[newCounter];
  40. dups++;
  41. found = true;
  42. break;
  43. }
  44. }
  45. if (!found) {
  46. merged[oldLength + newCounter - dups] = newPI[newCounter];
  47. }
  48. }
  49. if (dups > 0) {
  50. PainterInfo[] tmp = merged;
  51. merged = new PainterInfo[merged.length - dups];
  52. System.arraycopy(tmp, 0, merged, 0, merged.length);
  53. }
  54. return merged;
  55. }
  56. public ParsedSynthStyle() {
  57. }
  58. public ParsedSynthStyle(DefaultSynthStyle style) {
  59. super(style);
  60. if (style instanceof ParsedSynthStyle) {
  61. ParsedSynthStyle pStyle = (ParsedSynthStyle)style;
  62. if (pStyle._painters != null) {
  63. _painters = pStyle._painters;
  64. }
  65. }
  66. }
  67. public SynthPainter getPainter(SynthContext ss) {
  68. return DELEGATING_PAINTER_INSTANCE;
  69. }
  70. public void setPainters(PainterInfo[] info) {
  71. _painters = info;
  72. }
  73. public DefaultSynthStyle addTo(DefaultSynthStyle style) {
  74. if (!(style instanceof ParsedSynthStyle)) {
  75. style = new ParsedSynthStyle(style);
  76. }
  77. ParsedSynthStyle pStyle = (ParsedSynthStyle)super.addTo(style);
  78. pStyle._painters = mergePainterInfo(pStyle._painters, _painters);
  79. return pStyle;
  80. }
  81. private SynthPainter getBestPainter(SynthContext context, String method,
  82. int direction) {
  83. // Check the state info first
  84. StateInfo info = (StateInfo)getStateInfo(context.getComponentState());
  85. SynthPainter painter;
  86. if (info != null) {
  87. if ((painter = getBestPainter(info.getPainters(), method,
  88. direction)) != null) {
  89. return painter;
  90. }
  91. }
  92. if ((painter = getBestPainter(_painters, method, direction)) != null) {
  93. return painter;
  94. }
  95. return SynthPainter.NULL_PAINTER;
  96. }
  97. private SynthPainter getBestPainter(PainterInfo[] info, String method,
  98. int direction) {
  99. if (info != null) {
  100. // Painter specified with no method
  101. SynthPainter nullPainter = null;
  102. // Painter specified for this method
  103. SynthPainter methodPainter = null;
  104. for (int counter = info.length - 1; counter >= 0; counter--) {
  105. PainterInfo pi = info[counter];
  106. if (pi.getMethod() == method) {
  107. if (pi.getDirection() == direction) {
  108. return pi.getPainter();
  109. }
  110. else if (methodPainter == null &&pi.getDirection() == -1) {
  111. methodPainter = pi.getPainter();
  112. }
  113. }
  114. else if (nullPainter == null && pi.getMethod() == null) {
  115. nullPainter = pi.getPainter();
  116. }
  117. }
  118. if (methodPainter != null) {
  119. return methodPainter;
  120. }
  121. return nullPainter;
  122. }
  123. return null;
  124. }
  125. public String toString() {
  126. StringBuffer text = new StringBuffer(super.toString());
  127. if (_painters != null) {
  128. text.append(",painters=[");
  129. for (int i = 0; i < +_painters.length; i++) {
  130. text.append(_painters[i].toString());
  131. }
  132. text.append("]");
  133. }
  134. return text.toString();
  135. }
  136. static class StateInfo extends DefaultSynthStyle.StateInfo {
  137. private PainterInfo[] _painterInfo;
  138. public StateInfo() {
  139. }
  140. public StateInfo(DefaultSynthStyle.StateInfo info) {
  141. super(info);
  142. if (info instanceof StateInfo) {
  143. _painterInfo = ((StateInfo)info)._painterInfo;
  144. }
  145. }
  146. public void setPainters(PainterInfo[] painterInfo) {
  147. _painterInfo = painterInfo;
  148. }
  149. public PainterInfo[] getPainters() {
  150. return _painterInfo;
  151. }
  152. public Object clone() {
  153. return new StateInfo(this);
  154. }
  155. public DefaultSynthStyle.StateInfo addTo(
  156. DefaultSynthStyle.StateInfo info) {
  157. if (!(info instanceof StateInfo)) {
  158. info = new StateInfo(info);
  159. }
  160. else {
  161. info = super.addTo(info);
  162. StateInfo si = (StateInfo)info;
  163. si._painterInfo = mergePainterInfo(si._painterInfo,
  164. _painterInfo);
  165. }
  166. return info;
  167. }
  168. public String toString() {
  169. StringBuffer text = new StringBuffer(super.toString());
  170. text.append(",painters=[");
  171. if (_painterInfo != null) {
  172. for (int i = 0; i < +_painterInfo.length; i++) {
  173. text.append(" ").append(_painterInfo[i].toString());
  174. }
  175. }
  176. text.append("]");
  177. return text.toString();
  178. }
  179. }
  180. static class PainterInfo {
  181. private String _method;
  182. private SynthPainter _painter;
  183. private int _direction;
  184. PainterInfo(String method, SynthPainter painter, int direction) {
  185. if (method != null) {
  186. _method = method.intern();
  187. }
  188. _painter = painter;
  189. _direction = direction;
  190. }
  191. String getMethod() {
  192. return _method;
  193. }
  194. SynthPainter getPainter() {
  195. return _painter;
  196. }
  197. int getDirection() {
  198. return _direction;
  199. }
  200. private boolean equalsPainter(PainterInfo info) {
  201. return (_method == info._method && _direction == info._direction);
  202. }
  203. public String toString() {
  204. return "PainterInfo {method=" + _method + ",direction=" +
  205. _direction + ",painter=" + _painter +"}";
  206. }
  207. }
  208. private static class DelegatingPainter extends SynthPainter {
  209. private static SynthPainter getPainter(SynthContext context,
  210. String method, int direction) {
  211. return ((ParsedSynthStyle)context.getStyle()).getBestPainter(
  212. context, method, direction);
  213. }
  214. public void paintArrowButtonBackground(SynthContext context,
  215. Graphics g, int x, int y, int w, int h) {
  216. getPainter(context, "arrowButtonBackground", -1).
  217. paintArrowButtonBackground(context, g, x, y, w, h);
  218. }
  219. public void paintArrowButtonBorder(SynthContext context,
  220. Graphics g, int x, int y, int w, int h) {
  221. getPainter(context, "arrowButtonBorder", -1).
  222. paintArrowButtonBorder(context, g, x, y, w, h);
  223. }
  224. public void paintArrowButtonForeground(SynthContext context,
  225. Graphics g, int x, int y, int w, int h, int direction) {
  226. getPainter(context, "arrowButtonForeground", direction).
  227. paintArrowButtonForeground(context, g, x, y, w, h, direction);
  228. }
  229. public void paintButtonBackground(SynthContext context,
  230. Graphics g, int x, int y, int w, int h) {
  231. getPainter(context, "buttonBackground", -1).
  232. paintButtonBackground(context, g, x, y, w, h);
  233. }
  234. public void paintButtonBorder(SynthContext context,
  235. Graphics g, int x, int y, int w, int h) {
  236. getPainter(context, "buttonBorder", -1).
  237. paintButtonBorder(context, g, x, y, w, h);
  238. }
  239. public void paintCheckBoxMenuItemBackground(SynthContext context,
  240. Graphics g, int x, int y, int w, int h) {
  241. getPainter(context, "checkBoxMenuItemBackground", -1).
  242. paintCheckBoxMenuItemBackground(context, g, x, y, w, h);
  243. }
  244. public void paintCheckBoxMenuItemBorder(SynthContext context,
  245. Graphics g, int x, int y, int w, int h) {
  246. getPainter(context, "checkBoxMenuItemBorder", -1).
  247. paintCheckBoxMenuItemBorder(context, g, x, y, w, h);
  248. }
  249. public void paintCheckBoxBackground(SynthContext context,
  250. Graphics g, int x, int y, int w, int h) {
  251. getPainter(context, "checkBoxBackground", -1).
  252. paintCheckBoxBackground(context, g, x, y, w, h);
  253. }
  254. public void paintCheckBoxBorder(SynthContext context,
  255. Graphics g, int x, int y, int w, int h) {
  256. getPainter(context, "checkBoxBorder", -1).
  257. paintCheckBoxBorder(context, g, x, y, w, h);
  258. }
  259. public void paintColorChooserBackground(SynthContext context,
  260. Graphics g, int x, int y, int w, int h) {
  261. getPainter(context, "colorChooserBackground", -1).
  262. paintColorChooserBackground(context, g, x, y, w, h);
  263. }
  264. public void paintColorChooserBorder(SynthContext context,
  265. Graphics g, int x, int y, int w, int h) {
  266. getPainter(context, "colorChooserBorder", -1).
  267. paintColorChooserBorder(context, g, x, y, w, h);
  268. }
  269. public void paintComboBoxBackground(SynthContext context,
  270. Graphics g, int x, int y, int w, int h) {
  271. getPainter(context, "comboBoxBackground", -1).
  272. paintComboBoxBackground(context, g, x, y, w, h);
  273. }
  274. public void paintComboBoxBorder(SynthContext context,
  275. Graphics g, int x, int y, int w, int h) {
  276. getPainter(context, "comboBoxBorder", -1).
  277. paintComboBoxBorder(context, g, x, y, w, h);
  278. }
  279. public void paintDesktopIconBackground(SynthContext context,
  280. Graphics g, int x, int y, int w, int h) {
  281. getPainter(context, "desktopIconBackground", -1).
  282. paintDesktopIconBackground(context, g, x, y, w, h);
  283. }
  284. public void paintDesktopIconBorder(SynthContext context,
  285. Graphics g, int x, int y, int w, int h) {
  286. getPainter(context, "desktopIconBorder", -1).
  287. paintDesktopIconBorder(context, g, x, y, w, h);
  288. }
  289. public void paintDesktopPaneBackground(SynthContext context,
  290. Graphics g, int x, int y, int w, int h) {
  291. getPainter(context, "desktopPaneBackground", -1).
  292. paintDesktopPaneBackground(context, g, x, y, w, h);
  293. }
  294. public void paintDesktopPaneBorder(SynthContext context,
  295. Graphics g, int x, int y, int w, int h) {
  296. getPainter(context, "desktopPaneBorder", -1).
  297. paintDesktopPaneBorder(context, g, x, y, w, h);
  298. }
  299. public void paintEditorPaneBackground(SynthContext context,
  300. Graphics g, int x, int y, int w, int h) {
  301. getPainter(context, "editorPaneBackground", -1).
  302. paintEditorPaneBackground(context, g, x, y, w, h);
  303. }
  304. public void paintEditorPaneBorder(SynthContext context,
  305. Graphics g, int x, int y, int w, int h) {
  306. getPainter(context, "editorPaneBorder", -1).
  307. paintEditorPaneBorder(context, g, x, y, w, h);
  308. }
  309. public void paintFileChooserBackground(SynthContext context,
  310. Graphics g, int x, int y, int w, int h) {
  311. getPainter(context, "fileChooserBackground", -1).
  312. paintFileChooserBackground(context, g, x, y, w, h);
  313. }
  314. public void paintFileChooserBorder(SynthContext context,
  315. Graphics g, int x, int y, int w, int h) {
  316. getPainter(context, "fileChooserBorder", -1).
  317. paintFileChooserBorder(context, g, x, y, w, h);
  318. }
  319. public void paintFormattedTextFieldBackground(SynthContext context,
  320. Graphics g, int x, int y, int w, int h) {
  321. getPainter(context, "formattedTextFieldBackground", -1).
  322. paintFormattedTextFieldBackground(context, g, x, y, w, h);
  323. }
  324. public void paintFormattedTextFieldBorder(SynthContext context,
  325. Graphics g, int x, int y, int w, int h) {
  326. getPainter(context, "formattedTextFieldBorder", -1).
  327. paintFormattedTextFieldBorder(context, g, x, y, w, h);
  328. }
  329. public void paintInternalFrameTitlePaneBackground(SynthContext context,
  330. Graphics g, int x, int y, int w, int h) {
  331. getPainter(context, "internalFrameTitlePaneBackground", -1).
  332. paintInternalFrameTitlePaneBackground(context, g, x, y, w, h);
  333. }
  334. public void paintInternalFrameTitlePaneBorder(SynthContext context,
  335. Graphics g, int x, int y, int w, int h) {
  336. getPainter(context, "internalFrameTitlePaneBorder", -1).
  337. paintInternalFrameTitlePaneBorder(context, g, x, y, w, h);
  338. }
  339. public void paintInternalFrameBackground(SynthContext context,
  340. Graphics g, int x, int y, int w, int h) {
  341. getPainter(context, "internalFrameBackground", -1).
  342. paintInternalFrameBackground(context, g, x, y, w, h);
  343. }
  344. public void paintInternalFrameBorder(SynthContext context,
  345. Graphics g, int x, int y, int w, int h) {
  346. getPainter(context, "internalFrameBorder", -1).
  347. paintInternalFrameBorder(context, g, x, y, w, h);
  348. }
  349. public void paintLabelBackground(SynthContext context,
  350. Graphics g, int x, int y, int w, int h) {
  351. getPainter(context, "labelBackground", -1).
  352. paintLabelBackground(context, g, x, y, w, h);
  353. }
  354. public void paintLabelBorder(SynthContext context,
  355. Graphics g, int x, int y, int w, int h) {
  356. getPainter(context, "labelBorder", -1).
  357. paintLabelBorder(context, g, x, y, w, h);
  358. }
  359. public void paintListBackground(SynthContext context,
  360. Graphics g, int x, int y, int w, int h) {
  361. getPainter(context, "listBackground", -1).
  362. paintListBackground(context, g, x, y, w, h);
  363. }
  364. public void paintListBorder(SynthContext context,
  365. Graphics g, int x, int y, int w, int h) {
  366. getPainter(context, "listBorder", -1).
  367. paintListBorder(context, g, x, y, w, h);
  368. }
  369. public void paintMenuBarBackground(SynthContext context,
  370. Graphics g, int x, int y, int w, int h) {
  371. getPainter(context, "menuBarBackground", -1).
  372. paintMenuBarBackground(context, g, x, y, w, h);
  373. }
  374. public void paintMenuBarBorder(SynthContext context,
  375. Graphics g, int x, int y, int w, int h) {
  376. getPainter(context, "menuBarBorder", -1).
  377. paintMenuBarBorder(context, g, x, y, w, h);
  378. }
  379. public void paintMenuItemBackground(SynthContext context,
  380. Graphics g, int x, int y, int w, int h) {
  381. getPainter(context, "menuItemBackground", -1).
  382. paintMenuItemBackground(context, g, x, y, w, h);
  383. }
  384. public void paintMenuItemBorder(SynthContext context,
  385. Graphics g, int x, int y, int w, int h) {
  386. getPainter(context, "menuItemBorder", -1).
  387. paintMenuItemBorder(context, g, x, y, w, h);
  388. }
  389. public void paintMenuBackground(SynthContext context,
  390. Graphics g, int x, int y, int w, int h) {
  391. getPainter(context, "menuBackground", -1).
  392. paintMenuBackground(context, g, x, y, w, h);
  393. }
  394. public void paintMenuBorder(SynthContext context,
  395. Graphics g, int x, int y, int w, int h) {
  396. getPainter(context, "menuBorder", -1).
  397. paintMenuBorder(context, g, x, y, w, h);
  398. }
  399. public void paintOptionPaneBackground(SynthContext context,
  400. Graphics g, int x, int y, int w, int h) {
  401. getPainter(context, "optionPaneBackground", -1).
  402. paintOptionPaneBackground(context, g, x, y, w, h);
  403. }
  404. public void paintOptionPaneBorder(SynthContext context,
  405. Graphics g, int x, int y, int w, int h) {
  406. getPainter(context, "optionPaneBorder", -1).
  407. paintOptionPaneBorder(context, g, x, y, w, h);
  408. }
  409. public void paintPanelBackground(SynthContext context,
  410. Graphics g, int x, int y, int w, int h) {
  411. getPainter(context, "panelBackground", -1).
  412. paintPanelBackground(context, g, x, y, w, h);
  413. }
  414. public void paintPanelBorder(SynthContext context,
  415. Graphics g, int x, int y, int w, int h) {
  416. getPainter(context, "panelBorder", -1).
  417. paintPanelBorder(context, g, x, y, w, h);
  418. }
  419. public void paintPasswordFieldBackground(SynthContext context,
  420. Graphics g, int x, int y, int w, int h) {
  421. getPainter(context, "passwordFieldBackground", -1).
  422. paintPasswordFieldBackground(context, g, x, y, w, h);
  423. }
  424. public void paintPasswordFieldBorder(SynthContext context,
  425. Graphics g, int x, int y, int w, int h) {
  426. getPainter(context, "passwordFieldBorder", -1).
  427. paintPasswordFieldBorder(context, g, x, y, w, h);
  428. }
  429. public void paintPopupMenuBackground(SynthContext context,
  430. Graphics g, int x, int y, int w, int h) {
  431. getPainter(context, "popupMenuBackground", -1).
  432. paintPopupMenuBackground(context, g, x, y, w, h);
  433. }
  434. public void paintPopupMenuBorder(SynthContext context,
  435. Graphics g, int x, int y, int w, int h) {
  436. getPainter(context, "popupMenuBorder", -1).
  437. paintPopupMenuBorder(context, g, x, y, w, h);
  438. }
  439. public void paintProgressBarBackground(SynthContext context,
  440. Graphics g, int x, int y, int w, int h) {
  441. getPainter(context, "progressBarBackground", -1).
  442. paintProgressBarBackground(context, g, x, y, w, h);
  443. }
  444. public void paintProgressBarBorder(SynthContext context,
  445. Graphics g, int x, int y, int w, int h) {
  446. getPainter(context, "progressBarBorder", -1).
  447. paintProgressBarBorder(context, g, x, y, w, h);
  448. }
  449. public void paintProgressBarForeground(SynthContext context,
  450. Graphics g, int x, int y, int w, int h, int direction) {
  451. getPainter(context, "progressBarForeground", direction).
  452. paintProgressBarForeground(context, g, x, y, w, h, direction);
  453. }
  454. public void paintRadioButtonMenuItemBackground(SynthContext context,
  455. Graphics g, int x, int y, int w, int h) {
  456. getPainter(context, "radioButtonMenuItemBackground", -1).
  457. paintRadioButtonMenuItemBackground(context, g, x, y, w, h);
  458. }
  459. public void paintRadioButtonMenuItemBorder(SynthContext context,
  460. Graphics g, int x, int y, int w, int h) {
  461. getPainter(context, "radioButtonMenuItemBorder", -1).
  462. paintRadioButtonMenuItemBorder(context, g, x, y, w, h);
  463. }
  464. public void paintRadioButtonBackground(SynthContext context,
  465. Graphics g, int x, int y, int w, int h) {
  466. getPainter(context, "radioButtonBackground", -1).
  467. paintRadioButtonBackground(context, g, x, y, w, h);
  468. }
  469. public void paintRadioButtonBorder(SynthContext context,
  470. Graphics g, int x, int y, int w, int h) {
  471. getPainter(context, "radioButtonBorder", -1).
  472. paintRadioButtonBorder(context, g, x, y, w, h);
  473. }
  474. public void paintRootPaneBackground(SynthContext context,
  475. Graphics g, int x, int y, int w, int h) {
  476. getPainter(context, "rootPaneBackground", -1).
  477. paintRootPaneBackground(context, g, x, y, w, h);
  478. }
  479. public void paintRootPaneBorder(SynthContext context,
  480. Graphics g, int x, int y, int w, int h) {
  481. getPainter(context, "rootPaneBorder", -1).
  482. paintRootPaneBorder(context, g, x, y, w, h);
  483. }
  484. public void paintScrollBarBackground(SynthContext context,
  485. Graphics g, int x, int y, int w, int h) {
  486. getPainter(context, "scrollBarBackground", -1).
  487. paintScrollBarBackground(context, g, x, y, w, h);
  488. }
  489. public void paintScrollBarBorder(SynthContext context,
  490. Graphics g, int x, int y, int w, int h) {
  491. getPainter(context, "scrollBarBorder", -1).
  492. paintScrollBarBorder(context, g, x, y, w, h);
  493. }
  494. public void paintScrollBarThumbBackground(SynthContext context,
  495. Graphics g, int x, int y, int w, int h, int direction) {
  496. getPainter(context, "scrollBarThumbBackground", direction).
  497. paintScrollBarThumbBackground(context, g, x, y, w, h, direction);
  498. }
  499. public void paintScrollBarThumbBorder(SynthContext context,
  500. Graphics g, int x, int y, int w, int h, int direction) {
  501. getPainter(context, "scrollBarThumbBorder", direction).
  502. paintScrollBarThumbBorder(context, g, x, y, w, h, direction);
  503. }
  504. public void paintScrollBarTrackBackground(SynthContext context,
  505. Graphics g, int x, int y, int w, int h) {
  506. getPainter(context, "scrollBarTrackBackground", -1).
  507. paintScrollBarTrackBackground(context, g, x, y, w, h);
  508. }
  509. public void paintScrollBarTrackBorder(SynthContext context,
  510. Graphics g, int x, int y, int w, int h) {
  511. getPainter(context, "scrollBarTrackBorder", -1).
  512. paintScrollBarTrackBorder(context, g, x, y, w, h);
  513. }
  514. public void paintScrollPaneBackground(SynthContext context,
  515. Graphics g, int x, int y, int w, int h) {
  516. getPainter(context, "scrollPaneBackground", -1).
  517. paintScrollPaneBackground(context, g, x, y, w, h);
  518. }
  519. public void paintScrollPaneBorder(SynthContext context,
  520. Graphics g, int x, int y, int w, int h) {
  521. getPainter(context, "scrollPaneBorder", -1).
  522. paintScrollPaneBorder(context, g, x, y, w, h);
  523. }
  524. public void paintSeparatorBackground(SynthContext context,
  525. Graphics g, int x, int y, int w, int h) {
  526. getPainter(context, "separatorBackground", -1).
  527. paintSeparatorBackground(context, g, x, y, w, h);
  528. }
  529. public void paintSeparatorBorder(SynthContext context,
  530. Graphics g, int x, int y, int w, int h) {
  531. getPainter(context, "separatorBorder", -1).
  532. paintSeparatorBorder(context, g, x, y, w, h);
  533. }
  534. public void paintSeparatorForeground(SynthContext context,
  535. Graphics g, int x, int y, int w, int h, int direction) {
  536. getPainter(context, "separatorForeground", direction).
  537. paintSeparatorForeground(context, g, x, y, w, h, direction);
  538. }
  539. public void paintSliderBackground(SynthContext context,
  540. Graphics g, int x, int y, int w, int h) {
  541. getPainter(context, "sliderBackground", -1).
  542. paintSliderBackground(context, g, x, y, w, h);
  543. }
  544. public void paintSliderBorder(SynthContext context,
  545. Graphics g, int x, int y, int w, int h) {
  546. getPainter(context, "sliderBorder", -1).
  547. paintSliderBorder(context, g, x, y, w, h);
  548. }
  549. public void paintSliderThumbBackground(SynthContext context,
  550. Graphics g, int x, int y, int w, int h, int direction) {
  551. getPainter(context, "sliderThumbBackground", direction).
  552. paintSliderThumbBackground(context, g, x, y, w, h, direction);
  553. }
  554. public void paintSliderThumbBorder(SynthContext context,
  555. Graphics g, int x, int y, int w, int h, int direction) {
  556. getPainter(context, "sliderThumbBorder", direction).
  557. paintSliderThumbBorder(context, g, x, y, w, h, direction);
  558. }
  559. public void paintSliderTrackBackground(SynthContext context,
  560. Graphics g, int x, int y, int w, int h) {
  561. getPainter(context, "sliderTrackBackground", -1).
  562. paintSliderTrackBackground(context, g, x, y, w, h);
  563. }
  564. public void paintSliderTrackBorder(SynthContext context,
  565. Graphics g, int x, int y, int w, int h) {
  566. getPainter(context, "sliderTrackBorder", -1).
  567. paintSliderTrackBorder(context, g, x, y, w, h);
  568. }
  569. public void paintSpinnerBackground(SynthContext context,
  570. Graphics g, int x, int y, int w, int h) {
  571. getPainter(context, "spinnerBackground", -1).
  572. paintSpinnerBackground(context, g, x, y, w, h);
  573. }
  574. public void paintSpinnerBorder(SynthContext context,
  575. Graphics g, int x, int y, int w, int h) {
  576. getPainter(context, "spinnerBorder", -1).
  577. paintSpinnerBorder(context, g, x, y, w, h);
  578. }
  579. public void paintSplitPaneDividerBackground(SynthContext context,
  580. Graphics g, int x, int y, int w, int h) {
  581. getPainter(context, "splitPaneDividerBackground", -1).
  582. paintSplitPaneDividerBackground(context, g, x, y, w, h);
  583. }
  584. public void paintSplitPaneDividerForeground(SynthContext context,
  585. Graphics g, int x, int y, int w, int h, int direction) {
  586. getPainter(context, "splitPaneDividerForeground", direction).
  587. paintSplitPaneDividerForeground(context, g, x, y, w, h, direction);
  588. }
  589. public void paintSplitPaneDragDivider(SynthContext context,
  590. Graphics g, int x, int y, int w, int h, int direction) {
  591. getPainter(context, "splitPaneDragDivider", direction).
  592. paintSplitPaneDragDivider(context, g, x, y, w, h, direction);
  593. }
  594. public void paintSplitPaneBackground(SynthContext context,
  595. Graphics g, int x, int y, int w, int h) {
  596. getPainter(context, "splitPaneBackground", -1).
  597. paintSplitPaneBackground(context, g, x, y, w, h);
  598. }
  599. public void paintSplitPaneBorder(SynthContext context,
  600. Graphics g, int x, int y, int w, int h) {
  601. getPainter(context, "splitPaneBorder", -1).
  602. paintSplitPaneBorder(context, g, x, y, w, h);
  603. }
  604. public void paintTabbedPaneBackground(SynthContext context,
  605. Graphics g, int x, int y, int w, int h) {
  606. getPainter(context, "tabbedPaneBackground", -1).
  607. paintTabbedPaneBackground(context, g, x, y, w, h);
  608. }
  609. public void paintTabbedPaneBorder(SynthContext context,
  610. Graphics g, int x, int y, int w, int h) {
  611. getPainter(context, "tabbedPaneBorder", -1).
  612. paintTabbedPaneBorder(context, g, x, y, w, h);
  613. }
  614. public void paintTabbedPaneTabAreaBackground(SynthContext context,
  615. Graphics g, int x, int y, int w, int h) {
  616. getPainter(context, "tabbedPaneTabAreaBackground", -1).
  617. paintTabbedPaneTabAreaBackground(context, g, x, y, w, h);
  618. }
  619. public void paintTabbedPaneTabAreaBorder(SynthContext context,
  620. Graphics g, int x, int y, int w, int h) {
  621. getPainter(context, "tabbedPaneTabAreaBorder", -1).
  622. paintTabbedPaneTabAreaBorder(context, g, x, y, w, h);
  623. }
  624. public void paintTabbedPaneTabBackground(SynthContext context,
  625. Graphics g, int x, int y, int w, int h, int direction) {
  626. getPainter(context, "tabbedPaneTabBackground", -1).
  627. paintTabbedPaneTabBackground(context, g, x, y, w, h, direction);
  628. }
  629. public void paintTabbedPaneTabBorder(SynthContext context,
  630. Graphics g, int x, int y, int w, int h, int direction) {
  631. getPainter(context, "tabbedPaneTabBorder", -1).
  632. paintTabbedPaneTabBorder(context, g, x, y, w, h, direction);
  633. }
  634. public void paintTabbedPaneContentBackground(SynthContext context,
  635. Graphics g, int x, int y, int w, int h) {
  636. getPainter(context, "tabbedPaneContentBackground", -1).
  637. paintTabbedPaneContentBackground(context, g, x, y, w, h);
  638. }
  639. public void paintTabbedPaneContentBorder(SynthContext context,
  640. Graphics g, int x, int y, int w, int h) {
  641. getPainter(context, "tabbedPaneContentBorder", -1).
  642. paintTabbedPaneContentBorder(context, g, x, y, w, h);
  643. }
  644. public void paintTableHeaderBackground(SynthContext context,
  645. Graphics g, int x, int y, int w, int h) {
  646. getPainter(context, "tableHeaderBackground", -1).
  647. paintTableHeaderBackground(context, g, x, y, w, h);
  648. }
  649. public void paintTableHeaderBorder(SynthContext context,
  650. Graphics g, int x, int y, int w, int h) {
  651. getPainter(context, "tableHeaderBorder", -1).
  652. paintTableHeaderBorder(context, g, x, y, w, h);
  653. }
  654. public void paintTableBackground(SynthContext context,
  655. Graphics g, int x, int y, int w, int h) {
  656. getPainter(context, "tableBackground", -1).
  657. paintTableBackground(context, g, x, y, w, h);
  658. }
  659. public void paintTableBorder(SynthContext context,
  660. Graphics g, int x, int y, int w, int h) {
  661. getPainter(context, "tableBorder", -1).
  662. paintTableBorder(context, g, x, y, w, h);
  663. }
  664. public void paintTextAreaBackground(SynthContext context,
  665. Graphics g, int x, int y, int w, int h) {
  666. getPainter(context, "textAreaBackground", -1).
  667. paintTextAreaBackground(context, g, x, y, w, h);
  668. }
  669. public void paintTextAreaBorder(SynthContext context,
  670. Graphics g, int x, int y, int w, int h) {
  671. getPainter(context, "textAreaBorder", -1).
  672. paintTextAreaBorder(context, g, x, y, w, h);
  673. }
  674. public void paintTextPaneBackground(SynthContext context,
  675. Graphics g, int x, int y, int w, int h) {
  676. getPainter(context, "textPaneBackground", -1).
  677. paintTextPaneBackground(context, g, x, y, w, h);
  678. }
  679. public void paintTextPaneBorder(SynthContext context,
  680. Graphics g, int x, int y, int w, int h) {
  681. getPainter(context, "textPaneBorder", -1).
  682. paintTextPaneBorder(context, g, x, y, w, h);
  683. }
  684. public void paintTextFieldBackground(SynthContext context,
  685. Graphics g, int x, int y, int w, int h) {
  686. getPainter(context, "textFieldBackground", -1).
  687. paintTextFieldBackground(context, g, x, y, w, h);
  688. }
  689. public void paintTextFieldBorder(SynthContext context,
  690. Graphics g, int x, int y, int w, int h) {
  691. getPainter(context, "textFieldBorder", -1).
  692. paintTextFieldBorder(context, g, x, y, w, h);
  693. }
  694. public void paintToggleButtonBackground(SynthContext context,
  695. Graphics g, int x, int y, int w, int h) {
  696. getPainter(context, "toggleButtonBackground", -1).
  697. paintToggleButtonBackground(context, g, x, y, w, h);
  698. }
  699. public void paintToggleButtonBorder(SynthContext context,
  700. Graphics g, int x, int y, int w, int h) {
  701. getPainter(context, "toggleButtonBorder", -1).
  702. paintToggleButtonBorder(context, g, x, y, w, h);
  703. }
  704. public void paintToolBarBackground(SynthContext context,
  705. Graphics g, int x, int y, int w, int h) {
  706. getPainter(context, "toolBarBackground", -1).
  707. paintToolBarBackground(context, g, x, y, w, h);
  708. }
  709. public void paintToolBarBorder(SynthContext context,
  710. Graphics g, int x, int y, int w, int h) {
  711. getPainter(context, "toolBarBorder", -1).
  712. paintToolBarBorder(context, g, x, y, w, h);
  713. }
  714. public void paintToolBarContentBackground(SynthContext context,
  715. Graphics g, int x, int y, int w, int h) {
  716. getPainter(context, "toolBarContentBackground", -1).
  717. paintToolBarContentBackground(context, g, x, y, w, h);
  718. }
  719. public void paintToolBarContentBorder(SynthContext context,
  720. Graphics g, int x, int y, int w, int h) {
  721. getPainter(context, "toolBarContentBorder", -1).
  722. paintToolBarContentBorder(context, g, x, y, w, h);
  723. }
  724. public void paintToolBarDragWindowBackground(SynthContext context,
  725. Graphics g, int x, int y, int w, int h) {
  726. getPainter(context, "toolBarDragWindowBackground", -1).
  727. paintToolBarDragWindowBackground(context, g, x, y, w, h);
  728. }
  729. public void paintToolBarDragWindowBorder(SynthContext context,
  730. Graphics g, int x, int y, int w, int h) {
  731. getPainter(context, "toolBarDragWindowBorder", -1).
  732. paintToolBarDragWindowBorder(context, g, x, y, w, h);
  733. }
  734. public void paintToolTipBackground(SynthContext context,
  735. Graphics g, int x, int y, int w, int h) {
  736. getPainter(context, "toolTipBackground", -1).
  737. paintToolTipBackground(context, g, x, y, w, h);
  738. }
  739. public void paintToolTipBorder(SynthContext context,
  740. Graphics g, int x, int y, int w, int h) {
  741. getPainter(context, "toolTipBorder", -1).
  742. paintToolTipBorder(context, g, x, y, w, h);
  743. }
  744. public void paintTreeBackground(SynthContext context,
  745. Graphics g, int x, int y, int w, int h) {
  746. getPainter(context, "treeBackground", -1).
  747. paintTreeBackground(context, g, x, y, w, h);
  748. }
  749. public void paintTreeBorder(SynthContext context,
  750. Graphics g, int x, int y, int w, int h) {
  751. getPainter(context, "treeBorder", -1).
  752. paintTreeBorder(context, g, x, y, w, h);
  753. }
  754. public void paintTreeCellBackground(SynthContext context,
  755. Graphics g, int x, int y, int w, int h) {
  756. getPainter(context, "treeCellBackground", -1).
  757. paintTreeCellBackground(context, g, x, y, w, h);
  758. }
  759. public void paintTreeCellBorder(SynthContext context,
  760. Graphics g, int x, int y, int w, int h) {
  761. getPainter(context, "treeCellBorder", -1).
  762. paintTreeCellBorder(context, g, x, y, w, h);
  763. }
  764. public void paintTreeCellFocus(SynthContext context,
  765. Graphics g, int x, int y, int w, int h) {
  766. getPainter(context, "treeCellFocus", -1).
  767. paintTreeCellFocus(context, g, x, y, w, h);
  768. }
  769. public void paintViewportBackground(SynthContext context,
  770. Graphics g, int x, int y, int w, int h) {
  771. getPainter(context, "viewportBackground", -1).
  772. paintViewportBackground(context, g, x, y, w, h);
  773. }
  774. public void paintViewportBorder(SynthContext context,
  775. Graphics g, int x, int y, int w, int h) {
  776. getPainter(context, "viewportBorder", -1).
  777. paintViewportBorder(context, g, x, y, w, h);
  778. }
  779. }
  780. }