1 /*
2  * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * This code is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License version 2 only, as
7  * published by the Free Software Foundation.  Oracle designates this
8  * particular file as subject to the "Classpath" exception as provided
9  * by Oracle in the LICENSE file that accompanied this code.
10  *
11  * This code is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14  * version 2 for more details (a copy is included in the LICENSE file that
15  * accompanied this code).
16  *
17  * You should have received a copy of the GNU General Public License version
18  * 2 along with this work; if not, write to the Free Software Foundation,
19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20  *
21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22  * or visit www.oracle.com if you need additional information or have any
23  * questions.
24  */
25 package javax.swing.plaf.nimbus;
26 
27 import java.awt.*;
28 import java.awt.geom.AffineTransform;
29 import java.awt.geom.NoninvertibleTransformException;
30 import java.awt.image.BufferedImage;
31 import java.util.*;
32 import javax.swing.*;
33 import javax.swing.plaf.synth.SynthContext;
34 import javax.swing.plaf.synth.SynthPainter;
35 import javax.swing.plaf.synth.SynthConstants;
36 
37 import javax.swing.Painter;
38 
39 
40 class SynthPainterImpl extends SynthPainter {
41     private NimbusStyle style;
42 
SynthPainterImpl(NimbusStyle style)43     SynthPainterImpl(NimbusStyle style) {
44         this.style = style;
45     }
46 
47     /**
48      * Paint the provided painter using the provided transform at the specified
49      * position and size. Handles if g is a non 2D Graphics by painting via a
50      * BufferedImage.
51      */
paint(Painter<Object> p, SynthContext ctx, Graphics g, int x, int y, int w, int h, AffineTransform transform)52     private void paint(Painter<Object> p, SynthContext ctx, Graphics g, int x, int y,
53                        int w, int h, AffineTransform transform) {
54         if (p != null) {
55             if (g instanceof Graphics2D){
56                 Graphics2D gfx = (Graphics2D)g;
57                 if (transform!=null){
58                     gfx.transform(transform);
59                 }
60                 gfx.translate(x, y);
61                 p.paint(gfx, ctx.getComponent(), w, h);
62                 gfx.translate(-x, -y);
63                 if (transform!=null){
64                     try {
65                         gfx.transform(transform.createInverse());
66                     } catch (NoninvertibleTransformException e) {
67                         // this should never happen as we are in control of all
68                         // calls into this method and only ever pass in simple
69                         // transforms of rotate, flip and translates
70                         e.printStackTrace();
71                     }
72                 }
73             } else {
74                 // use image if we are printing to a Java 1.1 PrintGraphics as
75                 // it is not a instance of Graphics2D
76                 BufferedImage img = new BufferedImage(w,h,
77                         BufferedImage.TYPE_INT_ARGB);
78                 Graphics2D gfx = img.createGraphics();
79                 if (transform!=null){
80                     gfx.transform(transform);
81                 }
82                 p.paint(gfx, ctx.getComponent(), w, h);
83                 gfx.dispose();
84                 g.drawImage(img,x,y,null);
85                 img = null;
86             }
87         }
88     }
89 
paintBackground(SynthContext ctx, Graphics g, int x, int y, int w, int h, AffineTransform transform)90     private void paintBackground(SynthContext ctx, Graphics g, int x, int y,
91                                  int w, int h, AffineTransform transform) {
92         // if the background color of the component is 100% transparent
93         // then we should not paint any background graphics. This is a solution
94         // for there being no way of turning off Nimbus background painting as
95         // basic components are all non-opaque by default.
96         Component c = ctx.getComponent();
97         Color bg = (c != null) ? c.getBackground() : null;
98         if (bg == null || bg.getAlpha() > 0){
99 
100             Painter<Object> backgroundPainter = style.getBackgroundPainter(ctx);
101             if (backgroundPainter != null) {
102                 paint(backgroundPainter, ctx, g, x, y, w, h,transform);
103             }
104         }
105     }
106 
paintForeground(SynthContext ctx, Graphics g, int x, int y, int w, int h, AffineTransform transform)107     private void paintForeground(SynthContext ctx, Graphics g, int x, int y,
108                                  int w, int h, AffineTransform transform) {
109         Painter<Object> foregroundPainter = style.getForegroundPainter(ctx);
110         if (foregroundPainter != null) {
111             paint(foregroundPainter, ctx, g, x, y, w, h,transform);
112         }
113     }
114 
paintBorder(SynthContext ctx, Graphics g, int x, int y, int w, int h, AffineTransform transform)115     private void paintBorder(SynthContext ctx, Graphics g, int x, int y, int w,
116                              int h, AffineTransform transform) {
117         Painter<Object> borderPainter = style.getBorderPainter(ctx);
118         if (borderPainter != null) {
119             paint(borderPainter, ctx, g, x, y, w, h,transform);
120         }
121     }
122 
paintBackground(SynthContext ctx, Graphics g, int x, int y, int w, int h, int orientation)123     private void paintBackground(SynthContext ctx, Graphics g, int x, int y, int w, int h, int orientation) {
124         Component c = ctx.getComponent();
125         boolean ltr = c.getComponentOrientation().isLeftToRight();
126         // Don't RTL flip JSpliders as they handle it internaly
127         if (ctx.getComponent() instanceof JSlider) ltr = true;
128 
129         if (orientation == SwingConstants.VERTICAL && ltr) {
130             AffineTransform transform = new AffineTransform();
131             transform.scale(-1, 1);
132             transform.rotate(Math.toRadians(90));
133             paintBackground(ctx, g, y, x, h, w, transform);
134         } else if (orientation == SwingConstants.VERTICAL) {
135             AffineTransform transform = new AffineTransform();
136             transform.rotate(Math.toRadians(90));
137             transform.translate(0,-(x+w));
138             paintBackground(ctx, g, y, x, h, w, transform);
139         } else if (orientation == SwingConstants.HORIZONTAL && ltr) {
140             paintBackground(ctx, g, x, y, w, h, null);
141         } else {
142             //horizontal and right-to-left orientation
143             AffineTransform transform = new AffineTransform();
144             transform.translate(x,y);
145             transform.scale(-1, 1);
146             transform.translate(-w,0);
147             paintBackground(ctx, g, 0, 0, w, h, transform);
148         }
149     }
150 
paintBorder(SynthContext ctx, Graphics g, int x, int y, int w, int h, int orientation)151     private void paintBorder(SynthContext ctx, Graphics g, int x, int y, int w, int h, int orientation) {
152         Component c = ctx.getComponent();
153         boolean ltr = c.getComponentOrientation().isLeftToRight();
154         if (orientation == SwingConstants.VERTICAL && ltr) {
155             AffineTransform transform = new AffineTransform();
156             transform.scale(-1, 1);
157             transform.rotate(Math.toRadians(90));
158             paintBorder(ctx, g, y, x, h, w, transform);
159         } else if (orientation == SwingConstants.VERTICAL) {
160             AffineTransform transform = new AffineTransform();
161             transform.rotate(Math.toRadians(90));
162             transform.translate(0, -(x + w));
163             paintBorder(ctx, g, y, 0, h, w, transform);
164         } else if (orientation == SwingConstants.HORIZONTAL && ltr) {
165             paintBorder(ctx, g, x, y, w, h, null);
166         } else {
167             //horizontal and right-to-left orientation
168             paintBorder(ctx, g, x, y, w, h, null);
169         }
170     }
171 
paintForeground(SynthContext ctx, Graphics g, int x, int y, int w, int h, int orientation)172     private void paintForeground(SynthContext ctx, Graphics g, int x, int y, int w, int h, int orientation) {
173         Component c = ctx.getComponent();
174         boolean ltr = c.getComponentOrientation().isLeftToRight();
175         if (orientation == SwingConstants.VERTICAL && ltr) {
176             AffineTransform transform = new AffineTransform();
177             transform.scale(-1, 1);
178             transform.rotate(Math.toRadians(90));
179             paintForeground(ctx, g, y, x, h, w, transform);
180         } else if (orientation == SwingConstants.VERTICAL) {
181             AffineTransform transform = new AffineTransform();
182             transform.rotate(Math.toRadians(90));
183             transform.translate(0, -(x + w));
184             paintForeground(ctx, g, y, 0, h, w, transform);
185         } else if (orientation == SwingConstants.HORIZONTAL && ltr) {
186             paintForeground(ctx, g, x, y, w, h, null);
187         } else {
188             //horizontal and right-to-left orientation
189             paintForeground(ctx, g, x, y, w, h, null);
190         }
191     }
192 
193     /**
194      * Paints the background of an arrow button. Arrow buttons are created by
195      * some components, such as <code>JScrollBar</code>.
196      *
197      * @param context SynthContext identifying the <code>JComponent</code> and
198      *        <code>Region</code> to paint to
199      * @param g <code>Graphics</code> to paint to
200      * @param x X coordinate of the area to paint to
201      * @param y Y coordinate of the area to paint to
202      * @param w Width of the area to paint to
203      * @param h Height of the area to paint to
204      */
paintArrowButtonBackground(SynthContext context, Graphics g, int x, int y, int w, int h)205     public void paintArrowButtonBackground(SynthContext context,
206                                            Graphics g, int x, int y,
207                                            int w, int h) {
208         if (context.getComponent().getComponentOrientation().isLeftToRight()){
209             paintBackground(context, g, x, y, w, h, null);
210         } else {
211             AffineTransform transform = new AffineTransform();
212             transform.translate(x,y);
213             transform.scale(-1, 1);
214             transform.translate(-w,0);
215             paintBackground(context, g, 0, 0, w, h, transform);
216         }
217     }
218 
219     /**
220      * Paints the border of an arrow button. Arrow buttons are created by
221      * some components, such as <code>JScrollBar</code>.
222      *
223      * @param context SynthContext identifying the <code>JComponent</code> and
224      *        <code>Region</code> to paint to
225      * @param g <code>Graphics</code> to paint to
226      * @param x X coordinate of the area to paint to
227      * @param y Y coordinate of the area to paint to
228      * @param w Width of the area to paint to
229      * @param h Height of the area to paint to
230      */
paintArrowButtonBorder(SynthContext context, Graphics g, int x, int y, int w, int h)231     public void paintArrowButtonBorder(SynthContext context,
232                                        Graphics g, int x, int y,
233                                        int w, int h) {
234         paintBorder(context, g, x, y, w, h, null);
235     }
236 
237     /**
238      * Paints the foreground of an arrow button. This method is responsible
239      * for drawing a graphical representation of a direction, typically
240      * an arrow. Arrow buttons are created by
241      * some components, such as <code>JScrollBar</code>
242      *
243      * @param context SynthContext identifying the <code>JComponent</code> and
244      *        <code>Region</code> to paint to
245      * @param g <code>Graphics</code> to paint to
246      * @param x X coordinate of the area to paint to
247      * @param y Y coordinate of the area to paint to
248      * @param w Width of the area to paint to
249      * @param h Height of the area to paint to
250      * @param direction One of SwingConstants.NORTH, SwingConstants.SOUTH
251      *                  SwingConstants.EAST or SwingConstants.WEST
252      */
paintArrowButtonForeground(SynthContext context, Graphics g, int x, int y, int w, int h, int direction)253     public void paintArrowButtonForeground(SynthContext context,
254                                            Graphics g, int x, int y,
255                                            int w, int h,
256                                            int direction) {
257         //assume that the painter is arranged with the arrow pointing... LEFT?
258         String compName = context.getComponent().getName();
259         boolean ltr = context.getComponent().
260                 getComponentOrientation().isLeftToRight();
261         // The hard coding for spinners here needs to be replaced by a more
262         // general method for disabling rotation
263         if ("Spinner.nextButton".equals(compName) ||
264                 "Spinner.previousButton".equals(compName)) {
265             if (ltr){
266                 paintForeground(context, g, x, y, w, h, null);
267             } else {
268                 AffineTransform transform = new AffineTransform();
269                 transform.translate(w, 0);
270                 transform.scale(-1, 1);
271                 paintForeground(context, g, x, y, w, h, transform);
272             }
273         } else if (direction == SwingConstants.WEST) {
274             paintForeground(context, g, x, y, w, h, null);
275         } else if (direction == SwingConstants.NORTH) {
276             if (ltr){
277                 AffineTransform transform = new AffineTransform();
278                 transform.scale(-1, 1);
279                 transform.rotate(Math.toRadians(90));
280                 paintForeground(context, g, y, 0, h, w, transform);
281             } else {
282                 AffineTransform transform = new AffineTransform();
283                 transform.rotate(Math.toRadians(90));
284                 transform.translate(0, -(x + w));
285                 paintForeground(context, g, y, 0, h, w, transform);
286             }
287         } else if (direction == SwingConstants.EAST) {
288             AffineTransform transform = new AffineTransform();
289             transform.translate(w, 0);
290             transform.scale(-1, 1);
291             paintForeground(context, g, x, y, w, h, transform);
292         } else if (direction == SwingConstants.SOUTH) {
293             if (ltr){
294                 AffineTransform transform = new AffineTransform();
295                 transform.rotate(Math.toRadians(-90));
296                 transform.translate(-h, 0);
297                 paintForeground(context, g, y, x, h, w, transform);
298             } else {
299                 AffineTransform transform = new AffineTransform();
300                 transform.scale(-1, 1);
301                 transform.rotate(Math.toRadians(-90));
302                 transform.translate(-(h+y), -(w+x));
303                 paintForeground(context, g, y, x, h, w, transform);
304             }
305         }
306     }
307 
308     /**
309      * Paints the background of a button.
310      *
311      * @param context SynthContext identifying the <code>JComponent</code> and
312      *        <code>Region</code> to paint to
313      * @param g <code>Graphics</code> to paint to
314      * @param x X coordinate of the area to paint to
315      * @param y Y coordinate of the area to paint to
316      * @param w Width of the area to paint to
317      * @param h Height of the area to paint to
318      */
paintButtonBackground(SynthContext context, Graphics g, int x, int y, int w, int h)319     public void paintButtonBackground(SynthContext context,
320                                       Graphics g, int x, int y,
321                                       int w, int h) {
322         paintBackground(context, g, x, y, w, h, null);
323     }
324 
325     /**
326      * Paints the border of a button.
327      *
328      * @param context SynthContext identifying the <code>JComponent</code> and
329      *        <code>Region</code> to paint to
330      * @param g <code>Graphics</code> to paint to
331      * @param x X coordinate of the area to paint to
332      * @param y Y coordinate of the area to paint to
333      * @param w Width of the area to paint to
334      * @param h Height of the area to paint to
335      */
paintButtonBorder(SynthContext context, Graphics g, int x, int y, int w, int h)336     public void paintButtonBorder(SynthContext context,
337                                   Graphics g, int x, int y,
338                                   int w, int h) {
339         paintBorder(context, g, x, y, w, h, null);
340     }
341 
342     /**
343      * Paints the background of a check box menu item.
344      *
345      * @param context SynthContext identifying the <code>JComponent</code> and
346      *        <code>Region</code> to paint to
347      * @param g <code>Graphics</code> to paint to
348      * @param x X coordinate of the area to paint to
349      * @param y Y coordinate of the area to paint to
350      * @param w Width of the area to paint to
351      * @param h Height of the area to paint to
352      */
paintCheckBoxMenuItemBackground(SynthContext context, Graphics g, int x, int y, int w, int h)353     public void paintCheckBoxMenuItemBackground(SynthContext context,
354                                                 Graphics g, int x, int y,
355                                                 int w, int h) {
356         paintBackground(context, g, x, y, w, h, null);
357     }
358 
359     /**
360      * Paints the border of a check box menu item.
361      *
362      * @param context SynthContext identifying the <code>JComponent</code> and
363      *        <code>Region</code> to paint to
364      * @param g <code>Graphics</code> to paint to
365      * @param x X coordinate of the area to paint to
366      * @param y Y coordinate of the area to paint to
367      * @param w Width of the area to paint to
368      * @param h Height of the area to paint to
369      */
paintCheckBoxMenuItemBorder(SynthContext context, Graphics g, int x, int y, int w, int h)370     public void paintCheckBoxMenuItemBorder(SynthContext context,
371                                             Graphics g, int x, int y,
372                                             int w, int h) {
373         paintBorder(context, g, x, y, w, h, null);
374     }
375 
376     /**
377      * Paints the background of a check box.
378      *
379      * @param context SynthContext identifying the <code>JComponent</code> and
380      *        <code>Region</code> to paint to
381      * @param g <code>Graphics</code> to paint to
382      * @param x X coordinate of the area to paint to
383      * @param y Y coordinate of the area to paint to
384      * @param w Width of the area to paint to
385      * @param h Height of the area to paint to
386      */
paintCheckBoxBackground(SynthContext context, Graphics g, int x, int y, int w, int h)387     public void paintCheckBoxBackground(SynthContext context,
388                                         Graphics g, int x, int y,
389                                         int w, int h) {
390         paintBackground(context, g, x, y, w, h, null);
391     }
392 
393     /**
394      * Paints the border of a check box.
395      *
396      * @param context SynthContext identifying the <code>JComponent</code> and
397      *        <code>Region</code> to paint to
398      * @param g <code>Graphics</code> to paint to
399      * @param x X coordinate of the area to paint to
400      * @param y Y coordinate of the area to paint to
401      * @param w Width of the area to paint to
402      * @param h Height of the area to paint to
403      */
paintCheckBoxBorder(SynthContext context, Graphics g, int x, int y, int w, int h)404     public void paintCheckBoxBorder(SynthContext context,
405                                     Graphics g, int x, int y,
406                                     int w, int h) {
407         paintBorder(context, g, x, y, w, h, null);
408     }
409 
410     /**
411      * Paints the background of a color chooser.
412      *
413      * @param context SynthContext identifying the <code>JComponent</code> and
414      *        <code>Region</code> to paint to
415      * @param g <code>Graphics</code> to paint to
416      * @param x X coordinate of the area to paint to
417      * @param y Y coordinate of the area to paint to
418      * @param w Width of the area to paint to
419      * @param h Height of the area to paint to
420      */
paintColorChooserBackground(SynthContext context, Graphics g, int x, int y, int w, int h)421     public void paintColorChooserBackground(SynthContext context,
422                                             Graphics g, int x, int y,
423                                             int w, int h) {
424         paintBackground(context, g, x, y, w, h, null);
425     }
426 
427     /**
428      * Paints the border of a color chooser.
429      *
430      * @param context SynthContext identifying the <code>JComponent</code> and
431      *        <code>Region</code> to paint to
432      * @param g <code>Graphics</code> to paint to
433      * @param x X coordinate of the area to paint to
434      * @param y Y coordinate of the area to paint to
435      * @param w Width of the area to paint to
436      * @param h Height of the area to paint to
437      */
paintColorChooserBorder(SynthContext context, Graphics g, int x, int y, int w, int h)438     public void paintColorChooserBorder(SynthContext context,
439                                         Graphics g, int x, int y,
440                                         int w, int h) {
441         paintBorder(context, g, x, y, w, h, null);
442     }
443 
444     /**
445      * Paints the background of a combo box.
446      *
447      * @param context SynthContext identifying the <code>JComponent</code> and
448      *        <code>Region</code> to paint to
449      * @param g <code>Graphics</code> to paint to
450      * @param x X coordinate of the area to paint to
451      * @param y Y coordinate of the area to paint to
452      * @param w Width of the area to paint to
453      * @param h Height of the area to paint to
454      */
paintComboBoxBackground(SynthContext context, Graphics g, int x, int y, int w, int h)455     public void paintComboBoxBackground(SynthContext context,
456                                         Graphics g, int x, int y,
457                                         int w, int h) {
458         if (context.getComponent().getComponentOrientation().isLeftToRight()){
459             paintBackground(context, g, x, y, w, h, null);
460         } else {
461             AffineTransform transform = new AffineTransform();
462             transform.translate(x,y);
463             transform.scale(-1, 1);
464             transform.translate(-w,0);
465             paintBackground(context, g, 0, 0, w, h, transform);
466         }
467     }
468 
469     /**
470      * Paints the border of a combo box.
471      *
472      * @param context SynthContext identifying the <code>JComponent</code> and
473      *        <code>Region</code> to paint to
474      * @param g <code>Graphics</code> to paint to
475      * @param x X coordinate of the area to paint to
476      * @param y Y coordinate of the area to paint to
477      * @param w Width of the area to paint to
478      * @param h Height of the area to paint to
479      */
paintComboBoxBorder(SynthContext context, Graphics g, int x, int y, int w, int h)480     public void paintComboBoxBorder(SynthContext context,
481                                         Graphics g, int x, int y,
482                                         int w, int h) {
483         paintBorder(context, g, x, y, w, h, null);
484     }
485 
486     /**
487      * Paints the background of a desktop icon.
488      *
489      * @param context SynthContext identifying the <code>JComponent</code> and
490      *        <code>Region</code> to paint to
491      * @param g <code>Graphics</code> to paint to
492      * @param x X coordinate of the area to paint to
493      * @param y Y coordinate of the area to paint to
494      * @param w Width of the area to paint to
495      * @param h Height of the area to paint to
496      */
paintDesktopIconBackground(SynthContext context, Graphics g, int x, int y, int w, int h)497     public void paintDesktopIconBackground(SynthContext context,
498                                         Graphics g, int x, int y,
499                                         int w, int h) {
500         paintBackground(context, g, x, y, w, h, null);
501     }
502 
503     /**
504      * Paints the border of a desktop icon.
505      *
506      * @param context SynthContext identifying the <code>JComponent</code> and
507      *        <code>Region</code> to paint to
508      * @param g <code>Graphics</code> to paint to
509      * @param x X coordinate of the area to paint to
510      * @param y Y coordinate of the area to paint to
511      * @param w Width of the area to paint to
512      * @param h Height of the area to paint to
513      */
paintDesktopIconBorder(SynthContext context, Graphics g, int x, int y, int w, int h)514     public void paintDesktopIconBorder(SynthContext context,
515                                            Graphics g, int x, int y,
516                                            int w, int h) {
517         paintBorder(context, g, x, y, w, h, null);
518     }
519 
520     /**
521      * Paints the background of a desktop pane.
522      *
523      * @param context SynthContext identifying the <code>JComponent</code> and
524      *        <code>Region</code> to paint to
525      * @param g <code>Graphics</code> to paint to
526      * @param x X coordinate of the area to paint to
527      * @param y Y coordinate of the area to paint to
528      * @param w Width of the area to paint to
529      * @param h Height of the area to paint to
530      */
paintDesktopPaneBackground(SynthContext context, Graphics g, int x, int y, int w, int h)531     public void paintDesktopPaneBackground(SynthContext context,
532                                            Graphics g, int x, int y,
533                                            int w, int h) {
534         paintBackground(context, g, x, y, w, h, null);
535     }
536 
537     /**
538      * Paints the background of a desktop pane.
539      *
540      * @param context SynthContext identifying the <code>JComponent</code> and
541      *        <code>Region</code> to paint to
542      * @param g <code>Graphics</code> to paint to
543      * @param x X coordinate of the area to paint to
544      * @param y Y coordinate of the area to paint to
545      * @param w Width of the area to paint to
546      * @param h Height of the area to paint to
547      */
paintDesktopPaneBorder(SynthContext context, Graphics g, int x, int y, int w, int h)548     public void paintDesktopPaneBorder(SynthContext context,
549                                        Graphics g, int x, int y,
550                                        int w, int h) {
551         paintBorder(context, g, x, y, w, h, null);
552     }
553 
554     /**
555      * Paints the background of an editor pane.
556      *
557      * @param context SynthContext identifying the <code>JComponent</code> and
558      *        <code>Region</code> to paint to
559      * @param g <code>Graphics</code> to paint to
560      * @param x X coordinate of the area to paint to
561      * @param y Y coordinate of the area to paint to
562      * @param w Width of the area to paint to
563      * @param h Height of the area to paint to
564      */
paintEditorPaneBackground(SynthContext context, Graphics g, int x, int y, int w, int h)565     public void paintEditorPaneBackground(SynthContext context,
566                                           Graphics g, int x, int y,
567                                           int w, int h) {
568         paintBackground(context, g, x, y, w, h, null);
569     }
570 
571     /**
572      * Paints the border of an editor pane.
573      *
574      * @param context SynthContext identifying the <code>JComponent</code> and
575      *        <code>Region</code> to paint to
576      * @param g <code>Graphics</code> to paint to
577      * @param x X coordinate of the area to paint to
578      * @param y Y coordinate of the area to paint to
579      * @param w Width of the area to paint to
580      * @param h Height of the area to paint to
581      */
paintEditorPaneBorder(SynthContext context, Graphics g, int x, int y, int w, int h)582     public void paintEditorPaneBorder(SynthContext context,
583                                       Graphics g, int x, int y,
584                                       int w, int h) {
585         paintBorder(context, g, x, y, w, h, null);
586     }
587 
588     /**
589      * Paints the background of a file chooser.
590      *
591      * @param context SynthContext identifying the <code>JComponent</code> and
592      *        <code>Region</code> to paint to
593      * @param g <code>Graphics</code> to paint to
594      * @param x X coordinate of the area to paint to
595      * @param y Y coordinate of the area to paint to
596      * @param w Width of the area to paint to
597      * @param h Height of the area to paint to
598      */
paintFileChooserBackground(SynthContext context, Graphics g, int x, int y, int w, int h)599     public void paintFileChooserBackground(SynthContext context,
600                                           Graphics g, int x, int y,
601                                           int w, int h) {
602         paintBackground(context, g, x, y, w, h, null);
603     }
604 
605     /**
606      * Paints the border of a file chooser.
607      *
608      * @param context SynthContext identifying the <code>JComponent</code> and
609      *        <code>Region</code> to paint to
610      * @param g <code>Graphics</code> to paint to
611      * @param x X coordinate of the area to paint to
612      * @param y Y coordinate of the area to paint to
613      * @param w Width of the area to paint to
614      * @param h Height of the area to paint to
615      */
paintFileChooserBorder(SynthContext context, Graphics g, int x, int y, int w, int h)616     public void paintFileChooserBorder(SynthContext context,
617                                       Graphics g, int x, int y,
618                                       int w, int h) {
619         paintBorder(context, g, x, y, w, h, null);
620     }
621 
622     /**
623      * Paints the background of a formatted text field.
624      *
625      * @param context SynthContext identifying the <code>JComponent</code> and
626      *        <code>Region</code> to paint to
627      * @param g <code>Graphics</code> to paint to
628      * @param x X coordinate of the area to paint to
629      * @param y Y coordinate of the area to paint to
630      * @param w Width of the area to paint to
631      * @param h Height of the area to paint to
632      */
paintFormattedTextFieldBackground(SynthContext context, Graphics g, int x, int y, int w, int h)633     public void paintFormattedTextFieldBackground(SynthContext context,
634                                           Graphics g, int x, int y,
635                                           int w, int h) {
636         if (context.getComponent().getComponentOrientation().isLeftToRight()){
637             paintBackground(context, g, x, y, w, h, null);
638         } else {
639             AffineTransform transform = new AffineTransform();
640             transform.translate(x,y);
641             transform.scale(-1, 1);
642             transform.translate(-w,0);
643             paintBackground(context, g, 0, 0, w, h, transform);
644         }
645     }
646 
647     /**
648      * Paints the border of a formatted text field.
649      *
650      * @param context SynthContext identifying the <code>JComponent</code> and
651      *        <code>Region</code> to paint to
652      * @param g <code>Graphics</code> to paint to
653      * @param x X coordinate of the area to paint to
654      * @param y Y coordinate of the area to paint to
655      * @param w Width of the area to paint to
656      * @param h Height of the area to paint to
657      */
paintFormattedTextFieldBorder(SynthContext context, Graphics g, int x, int y, int w, int h)658     public void paintFormattedTextFieldBorder(SynthContext context,
659                                       Graphics g, int x, int y,
660                                       int w, int h) {
661         if (context.getComponent().getComponentOrientation().isLeftToRight()){
662             paintBorder(context, g, x, y, w, h, null);
663         } else {
664             AffineTransform transform = new AffineTransform();
665             transform.translate(x,y);
666             transform.scale(-1, 1);
667             transform.translate(-w,0);
668             paintBorder(context, g, 0, 0, w, h, transform);
669         }
670     }
671 
672     /**
673      * Paints the background of an internal frame title pane.
674      *
675      * @param context SynthContext identifying the <code>JComponent</code> and
676      *        <code>Region</code> to paint to
677      * @param g <code>Graphics</code> to paint to
678      * @param x X coordinate of the area to paint to
679      * @param y Y coordinate of the area to paint to
680      * @param w Width of the area to paint to
681      * @param h Height of the area to paint to
682      */
paintInternalFrameTitlePaneBackground(SynthContext context, Graphics g, int x, int y, int w, int h)683     public void paintInternalFrameTitlePaneBackground(SynthContext context,
684                                           Graphics g, int x, int y,
685                                           int w, int h) {
686         paintBackground(context, g, x, y, w, h, null);
687     }
688 
689     /**
690      * Paints the border of an internal frame title pane.
691      *
692      * @param context SynthContext identifying the <code>JComponent</code> and
693      *        <code>Region</code> to paint to
694      * @param g <code>Graphics</code> to paint to
695      * @param x X coordinate of the area to paint to
696      * @param y Y coordinate of the area to paint to
697      * @param w Width of the area to paint to
698      * @param h Height of the area to paint to
699      */
paintInternalFrameTitlePaneBorder(SynthContext context, Graphics g, int x, int y, int w, int h)700     public void paintInternalFrameTitlePaneBorder(SynthContext context,
701                                       Graphics g, int x, int y,
702                                       int w, int h) {
703         paintBorder(context, g, x, y, w, h, null);
704     }
705 
706     /**
707      * Paints the background of an internal frame.
708      *
709      * @param context SynthContext identifying the <code>JComponent</code> and
710      *        <code>Region</code> to paint to
711      * @param g <code>Graphics</code> to paint to
712      * @param x X coordinate of the area to paint to
713      * @param y Y coordinate of the area to paint to
714      * @param w Width of the area to paint to
715      * @param h Height of the area to paint to
716      */
paintInternalFrameBackground(SynthContext context, Graphics g, int x, int y, int w, int h)717     public void paintInternalFrameBackground(SynthContext context,
718                                           Graphics g, int x, int y,
719                                           int w, int h) {
720         paintBackground(context, g, x, y, w, h, null);
721     }
722 
723     /**
724      * Paints the border of an internal frame.
725      *
726      * @param context SynthContext identifying the <code>JComponent</code> and
727      *        <code>Region</code> to paint to
728      * @param g <code>Graphics</code> to paint to
729      * @param x X coordinate of the area to paint to
730      * @param y Y coordinate of the area to paint to
731      * @param w Width of the area to paint to
732      * @param h Height of the area to paint to
733      */
paintInternalFrameBorder(SynthContext context, Graphics g, int x, int y, int w, int h)734     public void paintInternalFrameBorder(SynthContext context,
735                                       Graphics g, int x, int y,
736                                       int w, int h) {
737         paintBorder(context, g, x, y, w, h, null);
738     }
739 
740     /**
741      * Paints the background of a label.
742      *
743      * @param context SynthContext identifying the <code>JComponent</code> and
744      *        <code>Region</code> to paint to
745      * @param g <code>Graphics</code> to paint to
746      * @param x X coordinate of the area to paint to
747      * @param y Y coordinate of the area to paint to
748      * @param w Width of the area to paint to
749      * @param h Height of the area to paint to
750      */
paintLabelBackground(SynthContext context, Graphics g, int x, int y, int w, int h)751     public void paintLabelBackground(SynthContext context,
752                                      Graphics g, int x, int y,
753                                      int w, int h) {
754         paintBackground(context, g, x, y, w, h, null);
755     }
756 
757     /**
758      * Paints the border of a label.
759      *
760      * @param context SynthContext identifying the <code>JComponent</code> and
761      *        <code>Region</code> to paint to
762      * @param g <code>Graphics</code> to paint to
763      * @param x X coordinate of the area to paint to
764      * @param y Y coordinate of the area to paint to
765      * @param w Width of the area to paint to
766      * @param h Height of the area to paint to
767      */
paintLabelBorder(SynthContext context, Graphics g, int x, int y, int w, int h)768     public void paintLabelBorder(SynthContext context,
769                                  Graphics g, int x, int y,
770                                  int w, int h) {
771         paintBorder(context, g, x, y, w, h, null);
772     }
773 
774     /**
775      * Paints the background of a list.
776      *
777      * @param context SynthContext identifying the <code>JComponent</code> and
778      *        <code>Region</code> to paint to
779      * @param g <code>Graphics</code> to paint to
780      * @param x X coordinate of the area to paint to
781      * @param y Y coordinate of the area to paint to
782      * @param w Width of the area to paint to
783      * @param h Height of the area to paint to
784      */
paintListBackground(SynthContext context, Graphics g, int x, int y, int w, int h)785     public void paintListBackground(SynthContext context,
786                                      Graphics g, int x, int y,
787                                      int w, int h) {
788         paintBackground(context, g, x, y, w, h, null);
789     }
790 
791     /**
792      * Paints the border of a list.
793      *
794      * @param context SynthContext identifying the <code>JComponent</code> and
795      *        <code>Region</code> to paint to
796      * @param g <code>Graphics</code> to paint to
797      * @param x X coordinate of the area to paint to
798      * @param y Y coordinate of the area to paint to
799      * @param w Width of the area to paint to
800      * @param h Height of the area to paint to
801      */
paintListBorder(SynthContext context, Graphics g, int x, int y, int w, int h)802     public void paintListBorder(SynthContext context,
803                                  Graphics g, int x, int y,
804                                  int w, int h) {
805         paintBorder(context, g, x, y, w, h, null);
806     }
807 
808     /**
809      * Paints the background of a menu bar.
810      *
811      * @param context SynthContext identifying the <code>JComponent</code> and
812      *        <code>Region</code> to paint to
813      * @param g <code>Graphics</code> to paint to
814      * @param x X coordinate of the area to paint to
815      * @param y Y coordinate of the area to paint to
816      * @param w Width of the area to paint to
817      * @param h Height of the area to paint to
818      */
paintMenuBarBackground(SynthContext context, Graphics g, int x, int y, int w, int h)819     public void paintMenuBarBackground(SynthContext context,
820                                      Graphics g, int x, int y,
821                                      int w, int h) {
822         paintBackground(context, g, x, y, w, h, null);
823     }
824 
825     /**
826      * Paints the border of a menu bar.
827      *
828      * @param context SynthContext identifying the <code>JComponent</code> and
829      *        <code>Region</code> to paint to
830      * @param g <code>Graphics</code> to paint to
831      * @param x X coordinate of the area to paint to
832      * @param y Y coordinate of the area to paint to
833      * @param w Width of the area to paint to
834      * @param h Height of the area to paint to
835      */
paintMenuBarBorder(SynthContext context, Graphics g, int x, int y, int w, int h)836     public void paintMenuBarBorder(SynthContext context,
837                                  Graphics g, int x, int y,
838                                  int w, int h) {
839         paintBorder(context, g, x, y, w, h, null);
840     }
841 
842     /**
843      * Paints the background of a menu item.
844      *
845      * @param context SynthContext identifying the <code>JComponent</code> and
846      *        <code>Region</code> to paint to
847      * @param g <code>Graphics</code> to paint to
848      * @param x X coordinate of the area to paint to
849      * @param y Y coordinate of the area to paint to
850      * @param w Width of the area to paint to
851      * @param h Height of the area to paint to
852      */
paintMenuItemBackground(SynthContext context, Graphics g, int x, int y, int w, int h)853     public void paintMenuItemBackground(SynthContext context,
854                                      Graphics g, int x, int y,
855                                      int w, int h) {
856         paintBackground(context, g, x, y, w, h, null);
857     }
858 
859     /**
860      * Paints the border of a menu item.
861      *
862      * @param context SynthContext identifying the <code>JComponent</code> and
863      *        <code>Region</code> to paint to
864      * @param g <code>Graphics</code> to paint to
865      * @param x X coordinate of the area to paint to
866      * @param y Y coordinate of the area to paint to
867      * @param w Width of the area to paint to
868      * @param h Height of the area to paint to
869      */
paintMenuItemBorder(SynthContext context, Graphics g, int x, int y, int w, int h)870     public void paintMenuItemBorder(SynthContext context,
871                                  Graphics g, int x, int y,
872                                  int w, int h) {
873         paintBorder(context, g, x, y, w, h, null);
874     }
875 
876     /**
877      * Paints the background of a menu.
878      *
879      * @param context SynthContext identifying the <code>JComponent</code> and
880      *        <code>Region</code> to paint to
881      * @param g <code>Graphics</code> to paint to
882      * @param x X coordinate of the area to paint to
883      * @param y Y coordinate of the area to paint to
884      * @param w Width of the area to paint to
885      * @param h Height of the area to paint to
886      */
paintMenuBackground(SynthContext context, Graphics g, int x, int y, int w, int h)887     public void paintMenuBackground(SynthContext context,
888                                      Graphics g, int x, int y,
889                                      int w, int h) {
890         paintBackground(context, g, x, y, w, h, null);
891     }
892 
893     /**
894      * Paints the border of a menu.
895      *
896      * @param context SynthContext identifying the <code>JComponent</code> and
897      *        <code>Region</code> to paint to
898      * @param g <code>Graphics</code> to paint to
899      * @param x X coordinate of the area to paint to
900      * @param y Y coordinate of the area to paint to
901      * @param w Width of the area to paint to
902      * @param h Height of the area to paint to
903      */
paintMenuBorder(SynthContext context, Graphics g, int x, int y, int w, int h)904     public void paintMenuBorder(SynthContext context,
905                                  Graphics g, int x, int y,
906                                  int w, int h) {
907         paintBorder(context, g, x, y, w, h, null);
908     }
909 
910     /**
911      * Paints the background of an option pane.
912      *
913      * @param context SynthContext identifying the <code>JComponent</code> and
914      *        <code>Region</code> to paint to
915      * @param g <code>Graphics</code> to paint to
916      * @param x X coordinate of the area to paint to
917      * @param y Y coordinate of the area to paint to
918      * @param w Width of the area to paint to
919      * @param h Height of the area to paint to
920      */
paintOptionPaneBackground(SynthContext context, Graphics g, int x, int y, int w, int h)921     public void paintOptionPaneBackground(SynthContext context,
922                                      Graphics g, int x, int y,
923                                      int w, int h) {
924         paintBackground(context, g, x, y, w, h, null);
925     }
926 
927     /**
928      * Paints the border of an option pane.
929      *
930      * @param context SynthContext identifying the <code>JComponent</code> and
931      *        <code>Region</code> to paint to
932      * @param g <code>Graphics</code> to paint to
933      * @param x X coordinate of the area to paint to
934      * @param y Y coordinate of the area to paint to
935      * @param w Width of the area to paint to
936      * @param h Height of the area to paint to
937      */
paintOptionPaneBorder(SynthContext context, Graphics g, int x, int y, int w, int h)938     public void paintOptionPaneBorder(SynthContext context,
939                                  Graphics g, int x, int y,
940                                  int w, int h) {
941         paintBorder(context, g, x, y, w, h, null);
942     }
943 
944     /**
945      * Paints the background of a panel.
946      *
947      * @param context SynthContext identifying the <code>JComponent</code> and
948      *        <code>Region</code> to paint to
949      * @param g <code>Graphics</code> to paint to
950      * @param x X coordinate of the area to paint to
951      * @param y Y coordinate of the area to paint to
952      * @param w Width of the area to paint to
953      * @param h Height of the area to paint to
954      */
paintPanelBackground(SynthContext context, Graphics g, int x, int y, int w, int h)955     public void paintPanelBackground(SynthContext context,
956                                      Graphics g, int x, int y,
957                                      int w, int h) {
958         paintBackground(context, g, x, y, w, h, null);
959     }
960 
961     /**
962      * Paints the border of a panel.
963      *
964      * @param context SynthContext identifying the <code>JComponent</code> and
965      *        <code>Region</code> to paint to
966      * @param g <code>Graphics</code> to paint to
967      * @param x X coordinate of the area to paint to
968      * @param y Y coordinate of the area to paint to
969      * @param w Width of the area to paint to
970      * @param h Height of the area to paint to
971      */
paintPanelBorder(SynthContext context, Graphics g, int x, int y, int w, int h)972     public void paintPanelBorder(SynthContext context,
973                                  Graphics g, int x, int y,
974                                  int w, int h) {
975         paintBorder(context, g, x, y, w, h, null);
976     }
977 
978     /**
979      * Paints the background of a password field.
980      *
981      * @param context SynthContext identifying the <code>JComponent</code> and
982      *        <code>Region</code> to paint to
983      * @param g <code>Graphics</code> to paint to
984      * @param x X coordinate of the area to paint to
985      * @param y Y coordinate of the area to paint to
986      * @param w Width of the area to paint to
987      * @param h Height of the area to paint to
988      */
paintPasswordFieldBackground(SynthContext context, Graphics g, int x, int y, int w, int h)989     public void paintPasswordFieldBackground(SynthContext context,
990                                      Graphics g, int x, int y,
991                                      int w, int h) {
992         paintBackground(context, g, x, y, w, h, null);
993     }
994 
995     /**
996      * Paints the border of a password field.
997      *
998      * @param context SynthContext identifying the <code>JComponent</code> and
999      *        <code>Region</code> to paint to
1000      * @param g <code>Graphics</code> to paint to
1001      * @param x X coordinate of the area to paint to
1002      * @param y Y coordinate of the area to paint to
1003      * @param w Width of the area to paint to
1004      * @param h Height of the area to paint to
1005      */
paintPasswordFieldBorder(SynthContext context, Graphics g, int x, int y, int w, int h)1006     public void paintPasswordFieldBorder(SynthContext context,
1007                                  Graphics g, int x, int y,
1008                                  int w, int h) {
1009         paintBorder(context, g, x, y, w, h, null);
1010     }
1011 
1012     /**
1013      * Paints the background of a popup menu.
1014      *
1015      * @param context SynthContext identifying the <code>JComponent</code> and
1016      *        <code>Region</code> to paint to
1017      * @param g <code>Graphics</code> to paint to
1018      * @param x X coordinate of the area to paint to
1019      * @param y Y coordinate of the area to paint to
1020      * @param w Width of the area to paint to
1021      * @param h Height of the area to paint to
1022      */
paintPopupMenuBackground(SynthContext context, Graphics g, int x, int y, int w, int h)1023     public void paintPopupMenuBackground(SynthContext context,
1024                                      Graphics g, int x, int y,
1025                                      int w, int h) {
1026         paintBackground(context, g, x, y, w, h, null);
1027     }
1028 
1029     /**
1030      * Paints the border of a popup menu.
1031      *
1032      * @param context SynthContext identifying the <code>JComponent</code> and
1033      *        <code>Region</code> to paint to
1034      * @param g <code>Graphics</code> to paint to
1035      * @param x X coordinate of the area to paint to
1036      * @param y Y coordinate of the area to paint to
1037      * @param w Width of the area to paint to
1038      * @param h Height of the area to paint to
1039      */
paintPopupMenuBorder(SynthContext context, Graphics g, int x, int y, int w, int h)1040     public void paintPopupMenuBorder(SynthContext context,
1041                                  Graphics g, int x, int y,
1042                                  int w, int h) {
1043         paintBorder(context, g, x, y, w, h, null);
1044     }
1045 
1046     /**
1047      * Paints the background of a progress bar.
1048      *
1049      * @param context SynthContext identifying the <code>JComponent</code> and
1050      *        <code>Region</code> to paint to
1051      * @param g <code>Graphics</code> to paint to
1052      * @param x X coordinate of the area to paint to
1053      * @param y Y coordinate of the area to paint to
1054      * @param w Width of the area to paint to
1055      * @param h Height of the area to paint to
1056      */
paintProgressBarBackground(SynthContext context, Graphics g, int x, int y, int w, int h)1057     public void paintProgressBarBackground(SynthContext context,
1058                                      Graphics g, int x, int y,
1059                                      int w, int h) {
1060         paintBackground(context, g, x, y, w, h, null);
1061     }
1062 
1063     /**
1064      * Paints the background of a progress bar. This implementation invokes the
1065      * method of the same name without the orientation.
1066      *
1067      * @param context SynthContext identifying the <code>JComponent</code> and
1068      *        <code>Region</code> to paint to
1069      * @param g <code>Graphics</code> to paint to
1070      * @param x X coordinate of the area to paint to
1071      * @param y Y coordinate of the area to paint to
1072      * @param w Width of the area to paint to
1073      * @param h Height of the area to paint to
1074      * @param orientation one of <code>JProgressBar.HORIZONTAL</code> or
1075      *                    <code>JProgressBar.VERTICAL</code>
1076      * @since 1.6
1077      */
paintProgressBarBackground(SynthContext context, Graphics g, int x, int y, int w, int h, int orientation)1078     public void paintProgressBarBackground(SynthContext context,
1079                                      Graphics g, int x, int y,
1080                                      int w, int h, int orientation) {
1081         paintBackground(context, g, x, y, w, h, orientation);
1082     }
1083 
1084     /**
1085      * Paints the border of a progress bar.
1086      *
1087      * @param context SynthContext identifying the <code>JComponent</code> and
1088      *        <code>Region</code> to paint to
1089      * @param g <code>Graphics</code> to paint to
1090      * @param x X coordinate of the area to paint to
1091      * @param y Y coordinate of the area to paint to
1092      * @param w Width of the area to paint to
1093      * @param h Height of the area to paint to
1094      */
paintProgressBarBorder(SynthContext context, Graphics g, int x, int y, int w, int h)1095     public void paintProgressBarBorder(SynthContext context,
1096                                  Graphics g, int x, int y,
1097                                  int w, int h) {
1098         paintBorder(context, g, x, y, w, h, null);
1099     }
1100 
1101     /**
1102      * Paints the border of a progress bar. This implementation invokes the
1103      * method of the same name without the orientation.
1104      *
1105      * @param context SynthContext identifying the <code>JComponent</code> and
1106      *        <code>Region</code> to paint to
1107      * @param g <code>Graphics</code> to paint to
1108      * @param x X coordinate of the area to paint to
1109      * @param y Y coordinate of the area to paint to
1110      * @param w Width of the area to paint to
1111      * @param h Height of the area to paint to
1112      * @param orientation one of <code>JProgressBar.HORIZONTAL</code> or
1113      *                    <code>JProgressBar.VERTICAL</code>
1114      * @since 1.6
1115      */
paintProgressBarBorder(SynthContext context, Graphics g, int x, int y, int w, int h, int orientation)1116     public void paintProgressBarBorder(SynthContext context,
1117                                  Graphics g, int x, int y,
1118                                  int w, int h, int orientation) {
1119         paintBorder(context, g, x, y, w, h, orientation);
1120     }
1121 
1122     /**
1123      * Paints the foreground of a progress bar. is responsible for
1124      * providing an indication of the progress of the progress bar.
1125      *
1126      * @param context SynthContext identifying the <code>JComponent</code> and
1127      *        <code>Region</code> to paint to
1128      * @param g <code>Graphics</code> to paint to
1129      * @param x X coordinate of the area to paint to
1130      * @param y Y coordinate of the area to paint to
1131      * @param w Width of the area to paint to
1132      * @param h Height of the area to paint to
1133      * @param orientation one of <code>JProgressBar.HORIZONTAL</code> or
1134      *                    <code>JProgressBar.VERTICAL</code>
1135      */
paintProgressBarForeground(SynthContext context, Graphics g, int x, int y, int w, int h, int orientation)1136     public void paintProgressBarForeground(SynthContext context,
1137                                  Graphics g, int x, int y,
1138                                  int w, int h, int orientation) {
1139         paintForeground(context, g, x, y, w, h, orientation);
1140     }
1141 
1142     /**
1143      * Paints the background of a radio button menu item.
1144      *
1145      * @param context SynthContext identifying the <code>JComponent</code> and
1146      *        <code>Region</code> to paint to
1147      * @param g <code>Graphics</code> to paint to
1148      * @param x X coordinate of the area to paint to
1149      * @param y Y coordinate of the area to paint to
1150      * @param w Width of the area to paint to
1151      * @param h Height of the area to paint to
1152      */
paintRadioButtonMenuItemBackground(SynthContext context, Graphics g, int x, int y, int w, int h)1153     public void paintRadioButtonMenuItemBackground(SynthContext context,
1154                                      Graphics g, int x, int y,
1155                                      int w, int h) {
1156         paintBackground(context, g, x, y, w, h, null);
1157     }
1158 
1159     /**
1160      * Paints the border of a radio button menu item.
1161      *
1162      * @param context SynthContext identifying the <code>JComponent</code> and
1163      *        <code>Region</code> to paint to
1164      * @param g <code>Graphics</code> to paint to
1165      * @param x X coordinate of the area to paint to
1166      * @param y Y coordinate of the area to paint to
1167      * @param w Width of the area to paint to
1168      * @param h Height of the area to paint to
1169      */
paintRadioButtonMenuItemBorder(SynthContext context, Graphics g, int x, int y, int w, int h)1170     public void paintRadioButtonMenuItemBorder(SynthContext context,
1171                                  Graphics g, int x, int y,
1172                                  int w, int h) {
1173         paintBorder(context, g, x, y, w, h, null);
1174     }
1175 
1176     /**
1177      * Paints the background of a radio button.
1178      *
1179      * @param context SynthContext identifying the <code>JComponent</code> and
1180      *        <code>Region</code> to paint to
1181      * @param g <code>Graphics</code> to paint to
1182      * @param x X coordinate of the area to paint to
1183      * @param y Y coordinate of the area to paint to
1184      * @param w Width of the area to paint to
1185      * @param h Height of the area to paint to
1186      */
paintRadioButtonBackground(SynthContext context, Graphics g, int x, int y, int w, int h)1187     public void paintRadioButtonBackground(SynthContext context,
1188                                      Graphics g, int x, int y,
1189                                      int w, int h) {
1190         paintBackground(context, g, x, y, w, h, null);
1191     }
1192 
1193     /**
1194      * Paints the border of a radio button.
1195      *
1196      * @param context SynthContext identifying the <code>JComponent</code> and
1197      *        <code>Region</code> to paint to
1198      * @param g <code>Graphics</code> to paint to
1199      * @param x X coordinate of the area to paint to
1200      * @param y Y coordinate of the area to paint to
1201      * @param w Width of the area to paint to
1202      * @param h Height of the area to paint to
1203      */
paintRadioButtonBorder(SynthContext context, Graphics g, int x, int y, int w, int h)1204     public void paintRadioButtonBorder(SynthContext context,
1205                                  Graphics g, int x, int y,
1206                                  int w, int h) {
1207         paintBorder(context, g, x, y, w, h, null);
1208     }
1209 
1210     /**
1211      * Paints the background of a root pane.
1212      *
1213      * @param context SynthContext identifying the <code>JComponent</code> and
1214      *        <code>Region</code> to paint to
1215      * @param g <code>Graphics</code> to paint to
1216      * @param x X coordinate of the area to paint to
1217      * @param y Y coordinate of the area to paint to
1218      * @param w Width of the area to paint to
1219      * @param h Height of the area to paint to
1220      */
paintRootPaneBackground(SynthContext context, Graphics g, int x, int y, int w, int h)1221     public void paintRootPaneBackground(SynthContext context,
1222                                      Graphics g, int x, int y,
1223                                      int w, int h) {
1224         paintBackground(context, g, x, y, w, h, null);
1225     }
1226 
1227     /**
1228      * Paints the border of a root pane.
1229      *
1230      * @param context SynthContext identifying the <code>JComponent</code> and
1231      *        <code>Region</code> to paint to
1232      * @param g <code>Graphics</code> to paint to
1233      * @param x X coordinate of the area to paint to
1234      * @param y Y coordinate of the area to paint to
1235      * @param w Width of the area to paint to
1236      * @param h Height of the area to paint to
1237      */
paintRootPaneBorder(SynthContext context, Graphics g, int x, int y, int w, int h)1238     public void paintRootPaneBorder(SynthContext context,
1239                                  Graphics g, int x, int y,
1240                                  int w, int h) {
1241         paintBorder(context, g, x, y, w, h, null);
1242     }
1243 
1244     /**
1245      * Paints the background of a scrollbar.
1246      *
1247      * @param context SynthContext identifying the <code>JComponent</code> and
1248      *        <code>Region</code> to paint to
1249      * @param g <code>Graphics</code> to paint to
1250      * @param x X coordinate of the area to paint to
1251      * @param y Y coordinate of the area to paint to
1252      * @param w Width of the area to paint to
1253      * @param h Height of the area to paint to
1254      */
paintScrollBarBackground(SynthContext context, Graphics g, int x, int y, int w, int h)1255     public void paintScrollBarBackground(SynthContext context,
1256                                      Graphics g, int x, int y,
1257                                      int w, int h) {
1258         paintBackground(context, g, x, y, w, h, null);
1259     }
1260 
1261     /**
1262      * Paints the background of a scrollbar. This implementation invokes the
1263      * method of the same name without the orientation.
1264      *
1265      * @param context SynthContext identifying the <code>JComponent</code> and
1266      *        <code>Region</code> to paint to
1267      * @param g <code>Graphics</code> to paint to
1268      * @param x X coordinate of the area to paint to
1269      * @param y Y coordinate of the area to paint to
1270      * @param w Width of the area to paint to
1271      * @param h Height of the area to paint to
1272      * @param orientation Orientation of the JScrollBar, one of
1273      *                    <code>JScrollBar.HORIZONTAL</code> or
1274      *                    <code>JScrollBar.VERTICAL</code>
1275      * @since 1.6
1276      */
paintScrollBarBackground(SynthContext context, Graphics g, int x, int y, int w, int h, int orientation)1277     public void paintScrollBarBackground(SynthContext context,
1278                                      Graphics g, int x, int y,
1279                                      int w, int h, int orientation) {
1280         paintBackground(context, g, x, y, w, h, orientation);
1281     }
1282 
1283     /**
1284      * Paints the border of a scrollbar.
1285      *
1286      * @param context SynthContext identifying the <code>JComponent</code> and
1287      *        <code>Region</code> to paint to
1288      * @param g <code>Graphics</code> to paint to
1289      * @param x X coordinate of the area to paint to
1290      * @param y Y coordinate of the area to paint to
1291      * @param w Width of the area to paint to
1292      * @param h Height of the area to paint to
1293      */
paintScrollBarBorder(SynthContext context, Graphics g, int x, int y, int w, int h)1294     public void paintScrollBarBorder(SynthContext context,
1295                                  Graphics g, int x, int y,
1296                                  int w, int h) {
1297         paintBorder(context, g, x, y, w, h, null);
1298     }
1299 
1300     /**
1301      * Paints the border of a scrollbar. This implementation invokes the
1302      * method of the same name without the orientation.
1303      *
1304      * @param context SynthContext identifying the <code>JComponent</code> and
1305      *        <code>Region</code> to paint to
1306      * @param g <code>Graphics</code> to paint to
1307      * @param x X coordinate of the area to paint to
1308      * @param y Y coordinate of the area to paint to
1309      * @param w Width of the area to paint to
1310      * @param h Height of the area to paint to
1311      * @param orientation Orientation of the JScrollBar, one of
1312      *                    <code>JScrollBar.HORIZONTAL</code> or
1313      *                    <code>JScrollBar.VERTICAL</code>
1314      * @since 1.6
1315      */
paintScrollBarBorder(SynthContext context, Graphics g, int x, int y, int w, int h, int orientation)1316     public void paintScrollBarBorder(SynthContext context,
1317                                  Graphics g, int x, int y,
1318                                  int w, int h, int orientation) {
1319         paintBorder(context, g, x, y, w, h, orientation);
1320     }
1321 
1322     /**
1323      * Paints the background of the thumb of a scrollbar. The thumb provides
1324      * a graphical indication as to how much of the Component is visible in a
1325      * <code>JScrollPane</code>.
1326      *
1327      * @param context SynthContext identifying the <code>JComponent</code> and
1328      *        <code>Region</code> to paint to
1329      * @param g <code>Graphics</code> to paint to
1330      * @param x X coordinate of the area to paint to
1331      * @param y Y coordinate of the area to paint to
1332      * @param w Width of the area to paint to
1333      * @param h Height of the area to paint to
1334      * @param orientation Orientation of the JScrollBar, one of
1335      *                    <code>JScrollBar.HORIZONTAL</code> or
1336      *                    <code>JScrollBar.VERTICAL</code>
1337      */
paintScrollBarThumbBackground(SynthContext context, Graphics g, int x, int y, int w, int h, int orientation)1338     public void paintScrollBarThumbBackground(SynthContext context,
1339                                      Graphics g, int x, int y,
1340                                      int w, int h, int orientation) {
1341         paintBackground(context, g, x, y, w, h, orientation);
1342     }
1343 
1344     /**
1345      * Paints the border of the thumb of a scrollbar. The thumb provides
1346      * a graphical indication as to how much of the Component is visible in a
1347      * <code>JScrollPane</code>.
1348      *
1349      * @param context SynthContext identifying the <code>JComponent</code> and
1350      *        <code>Region</code> to paint to
1351      * @param g <code>Graphics</code> to paint to
1352      * @param x X coordinate of the area to paint to
1353      * @param y Y coordinate of the area to paint to
1354      * @param w Width of the area to paint to
1355      * @param h Height of the area to paint to
1356      * @param orientation Orientation of the JScrollBar, one of
1357      *                    <code>JScrollBar.HORIZONTAL</code> or
1358      *                    <code>JScrollBar.VERTICAL</code>
1359      */
paintScrollBarThumbBorder(SynthContext context, Graphics g, int x, int y, int w, int h, int orientation)1360     public void paintScrollBarThumbBorder(SynthContext context,
1361                                  Graphics g, int x, int y,
1362                                  int w, int h, int orientation) {
1363         paintBorder(context, g, x, y, w, h, orientation);
1364     }
1365 
1366     /**
1367      * Paints the background of the track of a scrollbar. The track contains
1368      * the thumb.
1369      *
1370      * @param context SynthContext identifying the <code>JComponent</code> and
1371      *        <code>Region</code> to paint to
1372      * @param g <code>Graphics</code> to paint to
1373      * @param x X coordinate of the area to paint to
1374      * @param y Y coordinate of the area to paint to
1375      * @param w Width of the area to paint to
1376      * @param h Height of the area to paint to
1377      */
paintScrollBarTrackBackground(SynthContext context, Graphics g, int x, int y, int w, int h)1378     public void paintScrollBarTrackBackground(SynthContext context,
1379                                      Graphics g, int x, int y,
1380                                      int w, int h) {
1381         paintBackground(context, g, x, y, w, h, null);
1382     }
1383 
1384     /**
1385      * Paints the background of the track of a scrollbar. The track contains
1386      * the thumb. This implementation invokes the method of the same name without
1387      * the orientation.
1388      *
1389      * @param context SynthContext identifying the <code>JComponent</code> and
1390      *        <code>Region</code> to paint to
1391      * @param g <code>Graphics</code> to paint to
1392      * @param x X coordinate of the area to paint to
1393      * @param y Y coordinate of the area to paint to
1394      * @param w Width of the area to paint to
1395      * @param h Height of the area to paint to
1396      * @param orientation Orientation of the JScrollBar, one of
1397      *                    <code>JScrollBar.HORIZONTAL</code> or
1398      *                    <code>JScrollBar.VERTICAL</code>
1399      * @since 1.6
1400      */
paintScrollBarTrackBackground(SynthContext context, Graphics g, int x, int y, int w, int h, int orientation)1401     public void paintScrollBarTrackBackground(SynthContext context,
1402                                      Graphics g, int x, int y,
1403                                      int w, int h, int orientation) {
1404         paintBackground(context, g, x, y, w, h, orientation);
1405     }
1406 
1407     /**
1408      * Paints the border of the track of a scrollbar. The track contains
1409      * the thumb.
1410      *
1411      * @param context SynthContext identifying the <code>JComponent</code> and
1412      *        <code>Region</code> to paint to
1413      * @param g <code>Graphics</code> to paint to
1414      * @param x X coordinate of the area to paint to
1415      * @param y Y coordinate of the area to paint to
1416      * @param w Width of the area to paint to
1417      * @param h Height of the area to paint to
1418      */
paintScrollBarTrackBorder(SynthContext context, Graphics g, int x, int y, int w, int h)1419     public void paintScrollBarTrackBorder(SynthContext context,
1420                                  Graphics g, int x, int y,
1421                                  int w, int h) {
1422         paintBorder(context, g, x, y, w, h, null);
1423     }
1424 
1425     /**
1426      * Paints the border of the track of a scrollbar. The track contains
1427      * the thumb. This implementation invokes the method of the same name without
1428      * the orientation.
1429      *
1430      * @param context SynthContext identifying the <code>JComponent</code> and
1431      *        <code>Region</code> to paint to
1432      * @param g <code>Graphics</code> to paint to
1433      * @param x X coordinate of the area to paint to
1434      * @param y Y coordinate of the area to paint to
1435      * @param w Width of the area to paint to
1436      * @param h Height of the area to paint to
1437      * @param orientation Orientation of the JScrollBar, one of
1438      *                    <code>JScrollBar.HORIZONTAL</code> or
1439      *                    <code>JScrollBar.VERTICAL</code>
1440      * @since 1.6
1441      */
paintScrollBarTrackBorder(SynthContext context, Graphics g, int x, int y, int w, int h, int orientation)1442     public void paintScrollBarTrackBorder(SynthContext context,
1443                                  Graphics g, int x, int y,
1444                                  int w, int h, int orientation) {
1445         paintBorder(context, g, x, y, w, h, orientation);
1446     }
1447 
1448     /**
1449      * Paints the background of a scroll pane.
1450      *
1451      * @param context SynthContext identifying the <code>JComponent</code> and
1452      *        <code>Region</code> to paint to
1453      * @param g <code>Graphics</code> to paint to
1454      * @param x X coordinate of the area to paint to
1455      * @param y Y coordinate of the area to paint to
1456      * @param w Width of the area to paint to
1457      * @param h Height of the area to paint to
1458      */
paintScrollPaneBackground(SynthContext context, Graphics g, int x, int y, int w, int h)1459     public void paintScrollPaneBackground(SynthContext context,
1460                                      Graphics g, int x, int y,
1461                                      int w, int h) {
1462         paintBackground(context, g, x, y, w, h, null);
1463     }
1464 
1465     /**
1466      * Paints the border of a scroll pane.
1467      *
1468      * @param context SynthContext identifying the <code>JComponent</code> and
1469      *        <code>Region</code> to paint to
1470      * @param g <code>Graphics</code> to paint to
1471      * @param x X coordinate of the area to paint to
1472      * @param y Y coordinate of the area to paint to
1473      * @param w Width of the area to paint to
1474      * @param h Height of the area to paint to
1475      */
paintScrollPaneBorder(SynthContext context, Graphics g, int x, int y, int w, int h)1476     public void paintScrollPaneBorder(SynthContext context,
1477                                  Graphics g, int x, int y,
1478                                  int w, int h) {
1479         paintBorder(context, g, x, y, w, h, null);
1480     }
1481 
1482     /**
1483      * Paints the background of a separator.
1484      *
1485      * @param context SynthContext identifying the <code>JComponent</code> and
1486      *        <code>Region</code> to paint to
1487      * @param g <code>Graphics</code> to paint to
1488      * @param x X coordinate of the area to paint to
1489      * @param y Y coordinate of the area to paint to
1490      * @param w Width of the area to paint to
1491      * @param h Height of the area to paint to
1492      */
paintSeparatorBackground(SynthContext context, Graphics g, int x, int y, int w, int h)1493     public void paintSeparatorBackground(SynthContext context,
1494                                      Graphics g, int x, int y,
1495                                      int w, int h) {
1496         paintBackground(context, g, x, y, w, h, null);
1497     }
1498 
1499     /**
1500      * Paints the background of a separator. This implementation invokes the
1501      * method of the same name without the orientation.
1502      *
1503      * @param context SynthContext identifying the <code>JComponent</code> and
1504      *        <code>Region</code> to paint to
1505      * @param g <code>Graphics</code> to paint to
1506      * @param x X coordinate of the area to paint to
1507      * @param y Y coordinate of the area to paint to
1508      * @param w Width of the area to paint to
1509      * @param h Height of the area to paint to
1510      * @param orientation One of <code>JSeparator.HORIZONTAL</code> or
1511      *                           <code>JSeparator.VERTICAL</code>
1512      * @since 1.6
1513      */
paintSeparatorBackground(SynthContext context, Graphics g, int x, int y, int w, int h, int orientation)1514     public void paintSeparatorBackground(SynthContext context,
1515                                      Graphics g, int x, int y,
1516                                      int w, int h, int orientation) {
1517         paintBackground(context, g, x, y, w, h, orientation);
1518     }
1519 
1520     /**
1521      * Paints the border of a separator.
1522      *
1523      * @param context SynthContext identifying the <code>JComponent</code> and
1524      *        <code>Region</code> to paint to
1525      * @param g <code>Graphics</code> to paint to
1526      * @param x X coordinate of the area to paint to
1527      * @param y Y coordinate of the area to paint to
1528      * @param w Width of the area to paint to
1529      * @param h Height of the area to paint to
1530      */
paintSeparatorBorder(SynthContext context, Graphics g, int x, int y, int w, int h)1531     public void paintSeparatorBorder(SynthContext context,
1532                                  Graphics g, int x, int y,
1533                                  int w, int h) {
1534         paintBorder(context, g, x, y, w, h, null);
1535     }
1536 
1537     /**
1538      * Paints the border of a separator. This implementation invokes the
1539      * method of the same name without the orientation.
1540      *
1541      * @param context SynthContext identifying the <code>JComponent</code> and
1542      *        <code>Region</code> to paint to
1543      * @param g <code>Graphics</code> to paint to
1544      * @param x X coordinate of the area to paint to
1545      * @param y Y coordinate of the area to paint to
1546      * @param w Width of the area to paint to
1547      * @param h Height of the area to paint to
1548      * @param orientation One of <code>JSeparator.HORIZONTAL</code> or
1549      *                           <code>JSeparator.VERTICAL</code>
1550      * @since 1.6
1551      */
paintSeparatorBorder(SynthContext context, Graphics g, int x, int y, int w, int h, int orientation)1552     public void paintSeparatorBorder(SynthContext context,
1553                                  Graphics g, int x, int y,
1554                                  int w, int h, int orientation) {
1555         paintBorder(context, g, x, y, w, h, orientation);
1556     }
1557 
1558     /**
1559      * Paints the foreground of a separator.
1560      *
1561      * @param context SynthContext identifying the <code>JComponent</code> and
1562      *        <code>Region</code> to paint to
1563      * @param g <code>Graphics</code> to paint to
1564      * @param x X coordinate of the area to paint to
1565      * @param y Y coordinate of the area to paint to
1566      * @param w Width of the area to paint to
1567      * @param h Height of the area to paint to
1568      * @param orientation One of <code>JSeparator.HORIZONTAL</code> or
1569      *                           <code>JSeparator.VERTICAL</code>
1570      */
paintSeparatorForeground(SynthContext context, Graphics g, int x, int y, int w, int h, int orientation)1571     public void paintSeparatorForeground(SynthContext context,
1572                                  Graphics g, int x, int y,
1573                                  int w, int h, int orientation) {
1574         paintForeground(context, g, x, y, w, h, orientation);
1575     }
1576 
1577     /**
1578      * Paints the background of a slider.
1579      *
1580      * @param context SynthContext identifying the <code>JComponent</code> and
1581      *        <code>Region</code> to paint to
1582      * @param g <code>Graphics</code> to paint to
1583      * @param x X coordinate of the area to paint to
1584      * @param y Y coordinate of the area to paint to
1585      * @param w Width of the area to paint to
1586      * @param h Height of the area to paint to
1587      */
paintSliderBackground(SynthContext context, Graphics g, int x, int y, int w, int h)1588     public void paintSliderBackground(SynthContext context,
1589                                      Graphics g, int x, int y,
1590                                      int w, int h) {
1591         paintBackground(context, g, x, y, w, h, null);
1592     }
1593 
1594     /**
1595      * Paints the background of a slider. This implementation invokes the
1596      * method of the same name without the orientation.
1597      *
1598      * @param context SynthContext identifying the <code>JComponent</code> and
1599      *        <code>Region</code> to paint to
1600      * @param g <code>Graphics</code> to paint to
1601      * @param x X coordinate of the area to paint to
1602      * @param y Y coordinate of the area to paint to
1603      * @param w Width of the area to paint to
1604      * @param h Height of the area to paint to
1605      * @param orientation One of <code>JSlider.HORIZONTAL</code> or
1606      *                           <code>JSlider.VERTICAL</code>
1607      * @since 1.6
1608      */
paintSliderBackground(SynthContext context, Graphics g, int x, int y, int w, int h, int orientation)1609     public void paintSliderBackground(SynthContext context,
1610                                      Graphics g, int x, int y,
1611                                      int w, int h, int orientation) {
1612         paintBackground(context, g, x, y, w, h, orientation);
1613     }
1614 
1615     /**
1616      * Paints the border of a slider.
1617      *
1618      * @param context SynthContext identifying the <code>JComponent</code> and
1619      *        <code>Region</code> to paint to
1620      * @param g <code>Graphics</code> to paint to
1621      * @param x X coordinate of the area to paint to
1622      * @param y Y coordinate of the area to paint to
1623      * @param w Width of the area to paint to
1624      * @param h Height of the area to paint to
1625      */
paintSliderBorder(SynthContext context, Graphics g, int x, int y, int w, int h)1626     public void paintSliderBorder(SynthContext context,
1627                                  Graphics g, int x, int y,
1628                                  int w, int h) {
1629         paintBorder(context, g, x, y, w, h, null);
1630     }
1631 
1632     /**
1633      * Paints the border of a slider. This implementation invokes the
1634      * method of the same name without the orientation.
1635      *
1636      * @param context SynthContext identifying the <code>JComponent</code> and
1637      *        <code>Region</code> to paint to
1638      * @param g <code>Graphics</code> to paint to
1639      * @param x X coordinate of the area to paint to
1640      * @param y Y coordinate of the area to paint to
1641      * @param w Width of the area to paint to
1642      * @param h Height of the area to paint to
1643      * @param orientation One of <code>JSlider.HORIZONTAL</code> or
1644      *                           <code>JSlider.VERTICAL</code>
1645      * @since 1.6
1646      */
paintSliderBorder(SynthContext context, Graphics g, int x, int y, int w, int h, int orientation)1647     public void paintSliderBorder(SynthContext context,
1648                                  Graphics g, int x, int y,
1649                                  int w, int h, int orientation) {
1650         paintBorder(context, g, x, y, w, h, orientation);
1651     }
1652 
1653     /**
1654      * Paints the background of the thumb of a slider.
1655      *
1656      * @param context SynthContext identifying the <code>JComponent</code> and
1657      *        <code>Region</code> to paint to
1658      * @param g <code>Graphics</code> to paint to
1659      * @param x X coordinate of the area to paint to
1660      * @param y Y coordinate of the area to paint to
1661      * @param w Width of the area to paint to
1662      * @param h Height of the area to paint to
1663      * @param orientation One of <code>JSlider.HORIZONTAL</code> or
1664      *                           <code>JSlider.VERTICAL</code>
1665      */
paintSliderThumbBackground(SynthContext context, Graphics g, int x, int y, int w, int h, int orientation)1666     public void paintSliderThumbBackground(SynthContext context,
1667                                      Graphics g, int x, int y,
1668                                      int w, int h, int orientation) {
1669         if (context.getComponent().getClientProperty(
1670                 "Slider.paintThumbArrowShape") == Boolean.TRUE){
1671             if (orientation == JSlider.HORIZONTAL){
1672                 orientation = JSlider.VERTICAL;
1673             } else {
1674                 orientation = JSlider.HORIZONTAL;
1675             }
1676             paintBackground(context, g, x, y, w, h, orientation);
1677         } else {
1678             paintBackground(context, g, x, y, w, h, orientation);
1679         }
1680     }
1681 
1682     /**
1683      * Paints the border of the thumb of a slider.
1684      *
1685      * @param context SynthContext identifying the <code>JComponent</code> and
1686      *        <code>Region</code> to paint to
1687      * @param g <code>Graphics</code> to paint to
1688      * @param x X coordinate of the area to paint to
1689      * @param y Y coordinate of the area to paint to
1690      * @param w Width of the area to paint to
1691      * @param h Height of the area to paint to
1692      * @param orientation One of <code>JSlider.HORIZONTAL</code> or
1693      *                           <code>JSlider.VERTICAL</code>
1694      */
paintSliderThumbBorder(SynthContext context, Graphics g, int x, int y, int w, int h, int orientation)1695     public void paintSliderThumbBorder(SynthContext context,
1696                                  Graphics g, int x, int y,
1697                                  int w, int h, int orientation) {
1698         paintBorder(context, g, x, y, w, h, orientation);
1699     }
1700 
1701     /**
1702      * Paints the background of the track of a slider.
1703      *
1704      * @param context SynthContext identifying the <code>JComponent</code> and
1705      *        <code>Region</code> to paint to
1706      * @param g <code>Graphics</code> to paint to
1707      * @param x X coordinate of the area to paint to
1708      * @param y Y coordinate of the area to paint to
1709      * @param w Width of the area to paint to
1710      * @param h Height of the area to paint to
1711      */
paintSliderTrackBackground(SynthContext context, Graphics g, int x, int y, int w, int h)1712     public void paintSliderTrackBackground(SynthContext context,
1713                                      Graphics g, int x, int y,
1714                                      int w, int h) {
1715         paintBackground(context, g, x, y, w, h, null);
1716     }
1717 
1718     /**
1719      * Paints the background of the track of a slider. This implementation invokes
1720      * the method of the same name without the orientation.
1721      *
1722      * @param context SynthContext identifying the <code>JComponent</code> and
1723      *        <code>Region</code> to paint to
1724      * @param g <code>Graphics</code> to paint to
1725      * @param x X coordinate of the area to paint to
1726      * @param y Y coordinate of the area to paint to
1727      * @param w Width of the area to paint to
1728      * @param h Height of the area to paint to
1729      * @param orientation One of <code>JSlider.HORIZONTAL</code> or
1730      *                           <code>JSlider.VERTICAL</code>
1731      * @since 1.6
1732      */
paintSliderTrackBackground(SynthContext context, Graphics g, int x, int y, int w, int h, int orientation)1733     public void paintSliderTrackBackground(SynthContext context,
1734                                      Graphics g, int x, int y,
1735                                      int w, int h, int orientation) {
1736         paintBackground(context, g, x, y, w, h, orientation);
1737     }
1738 
1739     /**
1740      * Paints the border of the track of a slider.
1741      *
1742      * @param context SynthContext identifying the <code>JComponent</code> and
1743      *        <code>Region</code> to paint to
1744      * @param g <code>Graphics</code> to paint to
1745      * @param x X coordinate of the area to paint to
1746      * @param y Y coordinate of the area to paint to
1747      * @param w Width of the area to paint to
1748      * @param h Height of the area to paint to
1749      */
paintSliderTrackBorder(SynthContext context, Graphics g, int x, int y, int w, int h)1750     public void paintSliderTrackBorder(SynthContext context,
1751                                  Graphics g, int x, int y,
1752                                  int w, int h) {
1753         paintBorder(context, g, x, y, w, h, null);
1754     }
1755 
1756     /**
1757      * Paints the border of the track of a slider. This implementation invokes the
1758      * method of the same name without the orientation.
1759      *
1760      * @param context SynthContext identifying the <code>JComponent</code> and
1761      *        <code>Region</code> to paint to
1762      * @param g <code>Graphics</code> to paint to
1763      * @param x X coordinate of the area to paint to
1764      * @param y Y coordinate of the area to paint to
1765      * @param w Width of the area to paint to
1766      * @param h Height of the area to paint to
1767      * @param orientation One of <code>JSlider.HORIZONTAL</code> or
1768      *                           <code>JSlider.VERTICAL</code>
1769      * @since 1.6
1770      */
paintSliderTrackBorder(SynthContext context, Graphics g, int x, int y, int w, int h, int orientation)1771     public void paintSliderTrackBorder(SynthContext context,
1772                                  Graphics g, int x, int y,
1773                                  int w, int h, int orientation) {
1774         paintBorder(context, g, x, y, w, h, orientation);
1775     }
1776 
1777     /**
1778      * Paints the background of a spinner.
1779      *
1780      * @param context SynthContext identifying the <code>JComponent</code> and
1781      *        <code>Region</code> to paint to
1782      * @param g <code>Graphics</code> to paint to
1783      * @param x X coordinate of the area to paint to
1784      * @param y Y coordinate of the area to paint to
1785      * @param w Width of the area to paint to
1786      * @param h Height of the area to paint to
1787      */
paintSpinnerBackground(SynthContext context, Graphics g, int x, int y, int w, int h)1788     public void paintSpinnerBackground(SynthContext context,
1789                                      Graphics g, int x, int y,
1790                                      int w, int h) {
1791         paintBackground(context, g, x, y, w, h, null);
1792     }
1793 
1794     /**
1795      * Paints the border of a spinner.
1796      *
1797      * @param context SynthContext identifying the <code>JComponent</code> and
1798      *        <code>Region</code> to paint to
1799      * @param g <code>Graphics</code> to paint to
1800      * @param x X coordinate of the area to paint to
1801      * @param y Y coordinate of the area to paint to
1802      * @param w Width of the area to paint to
1803      * @param h Height of the area to paint to
1804      */
paintSpinnerBorder(SynthContext context, Graphics g, int x, int y, int w, int h)1805     public void paintSpinnerBorder(SynthContext context,
1806                                  Graphics g, int x, int y,
1807                                  int w, int h) {
1808         paintBorder(context, g, x, y, w, h, null);
1809     }
1810 
1811     /**
1812      * Paints the background of the divider of a split pane.
1813      *
1814      * @param context SynthContext identifying the <code>JComponent</code> and
1815      *        <code>Region</code> to paint to
1816      * @param g <code>Graphics</code> to paint to
1817      * @param x X coordinate of the area to paint to
1818      * @param y Y coordinate of the area to paint to
1819      * @param w Width of the area to paint to
1820      * @param h Height of the area to paint to
1821      */
paintSplitPaneDividerBackground(SynthContext context, Graphics g, int x, int y, int w, int h)1822     public void paintSplitPaneDividerBackground(SynthContext context,
1823                                      Graphics g, int x, int y,
1824                                      int w, int h) {
1825         paintBackground(context, g, x, y, w, h, null);
1826     }
1827 
1828     /**
1829      * Paints the background of the divider of a split pane. This implementation
1830      * invokes the method of the same name without the orientation.
1831      *
1832      * @param context SynthContext identifying the <code>JComponent</code> and
1833      *        <code>Region</code> to paint to
1834      * @param g <code>Graphics</code> to paint to
1835      * @param x X coordinate of the area to paint to
1836      * @param y Y coordinate of the area to paint to
1837      * @param w Width of the area to paint to
1838      * @param h Height of the area to paint to
1839      * @param orientation One of <code>JSplitPane.HORIZONTAL_SPLIT</code> or
1840      *                           <code>JSplitPane.VERTICAL_SPLIT</code>
1841      * @since 1.6
1842      */
paintSplitPaneDividerBackground(SynthContext context, Graphics g, int x, int y, int w, int h, int orientation)1843     public void paintSplitPaneDividerBackground(SynthContext context,
1844                                      Graphics g, int x, int y,
1845                                      int w, int h, int orientation) {
1846        if (orientation == JSplitPane.HORIZONTAL_SPLIT) {
1847             AffineTransform transform = new AffineTransform();
1848             transform.scale(-1, 1);
1849             transform.rotate(Math.toRadians(90));
1850             paintBackground(context, g, y, x, h, w, transform);
1851        } else {
1852             paintBackground(context, g, x, y, w, h, null);
1853         }
1854     }
1855 
1856     /**
1857      * Paints the foreground of the divider of a split pane.
1858      *
1859      * @param context SynthContext identifying the <code>JComponent</code> and
1860      *        <code>Region</code> to paint to
1861      * @param g <code>Graphics</code> to paint to
1862      * @param x X coordinate of the area to paint to
1863      * @param y Y coordinate of the area to paint to
1864      * @param w Width of the area to paint to
1865      * @param h Height of the area to paint to
1866      * @param orientation One of <code>JSplitPane.HORIZONTAL_SPLIT</code> or
1867      *                           <code>JSplitPane.VERTICAL_SPLIT</code>
1868      */
paintSplitPaneDividerForeground(SynthContext context, Graphics g, int x, int y, int w, int h, int orientation)1869     public void paintSplitPaneDividerForeground(SynthContext context,
1870                                      Graphics g, int x, int y,
1871                                      int w, int h, int orientation) {
1872         paintForeground(context, g, x, y, w, h, null);
1873     }
1874 
1875     /**
1876      * Paints the divider, when the user is dragging the divider, of a
1877      * split pane.
1878      *
1879      * @param context SynthContext identifying the <code>JComponent</code> and
1880      *        <code>Region</code> to paint to
1881      * @param g <code>Graphics</code> to paint to
1882      * @param x X coordinate of the area to paint to
1883      * @param y Y coordinate of the area to paint to
1884      * @param w Width of the area to paint to
1885      * @param h Height of the area to paint to
1886      * @param orientation One of <code>JSplitPane.HORIZONTAL_SPLIT</code> or
1887      *                           <code>JSplitPane.VERTICAL_SPLIT</code>
1888      */
paintSplitPaneDragDivider(SynthContext context, Graphics g, int x, int y, int w, int h, int orientation)1889     public void paintSplitPaneDragDivider(SynthContext context,
1890                                      Graphics g, int x, int y,
1891                                      int w, int h, int orientation) {
1892         paintBackground(context, g, x, y, w, h, null);
1893     }
1894 
1895     /**
1896      * Paints the background of a split pane.
1897      *
1898      * @param context SynthContext identifying the <code>JComponent</code> and
1899      *        <code>Region</code> to paint to
1900      * @param g <code>Graphics</code> to paint to
1901      * @param x X coordinate of the area to paint to
1902      * @param y Y coordinate of the area to paint to
1903      * @param w Width of the area to paint to
1904      * @param h Height of the area to paint to
1905      */
paintSplitPaneBackground(SynthContext context, Graphics g, int x, int y, int w, int h)1906     public void paintSplitPaneBackground(SynthContext context,
1907                                      Graphics g, int x, int y,
1908                                      int w, int h) {
1909         paintBackground(context, g, x, y, w, h, null);
1910     }
1911 
1912     /**
1913      * Paints the border of a split pane.
1914      *
1915      * @param context SynthContext identifying the <code>JComponent</code> and
1916      *        <code>Region</code> to paint to
1917      * @param g <code>Graphics</code> to paint to
1918      * @param x X coordinate of the area to paint to
1919      * @param y Y coordinate of the area to paint to
1920      * @param w Width of the area to paint to
1921      * @param h Height of the area to paint to
1922      */
paintSplitPaneBorder(SynthContext context, Graphics g, int x, int y, int w, int h)1923     public void paintSplitPaneBorder(SynthContext context,
1924                                  Graphics g, int x, int y,
1925                                  int w, int h) {
1926         paintBorder(context, g, x, y, w, h, null);
1927     }
1928 
1929     /**
1930      * Paints the background of a tabbed pane.
1931      *
1932      * @param context SynthContext identifying the <code>JComponent</code> and
1933      *        <code>Region</code> to paint to
1934      * @param g <code>Graphics</code> to paint to
1935      * @param x X coordinate of the area to paint to
1936      * @param y Y coordinate of the area to paint to
1937      * @param w Width of the area to paint to
1938      * @param h Height of the area to paint to
1939      */
paintTabbedPaneBackground(SynthContext context, Graphics g, int x, int y, int w, int h)1940     public void paintTabbedPaneBackground(SynthContext context,
1941                                      Graphics g, int x, int y,
1942                                      int w, int h) {
1943         paintBackground(context, g, x, y, w, h, null);
1944     }
1945 
1946     /**
1947      * Paints the border of a tabbed pane.
1948      *
1949      * @param context SynthContext identifying the <code>JComponent</code> and
1950      *        <code>Region</code> to paint to
1951      * @param g <code>Graphics</code> to paint to
1952      * @param x X coordinate of the area to paint to
1953      * @param y Y coordinate of the area to paint to
1954      * @param w Width of the area to paint to
1955      * @param h Height of the area to paint to
1956      */
paintTabbedPaneBorder(SynthContext context, Graphics g, int x, int y, int w, int h)1957     public void paintTabbedPaneBorder(SynthContext context,
1958                                  Graphics g, int x, int y,
1959                                  int w, int h) {
1960         paintBorder(context, g, x, y, w, h, null);
1961     }
1962 
1963     /**
1964      * Paints the background of the area behind the tabs of a tabbed pane.
1965      *
1966      * @param context SynthContext identifying the <code>JComponent</code> and
1967      *        <code>Region</code> to paint to
1968      * @param g <code>Graphics</code> to paint to
1969      * @param x X coordinate of the area to paint to
1970      * @param y Y coordinate of the area to paint to
1971      * @param w Width of the area to paint to
1972      * @param h Height of the area to paint to
1973      */
paintTabbedPaneTabAreaBackground(SynthContext context, Graphics g, int x, int y, int w, int h)1974     public void paintTabbedPaneTabAreaBackground(SynthContext context,
1975                                      Graphics g, int x, int y,
1976                                      int w, int h) {
1977         paintBackground(context, g, x, y, w, h, null);
1978     }
1979 
1980     /**
1981      * Paints the background of the area behind the tabs of a tabbed pane.
1982      * This implementation invokes the method of the same name without the
1983      * orientation.
1984      *
1985      * @param context SynthContext identifying the <code>JComponent</code> and
1986      *        <code>Region</code> to paint to
1987      * @param g <code>Graphics</code> to paint to
1988      * @param x X coordinate of the area to paint to
1989      * @param y Y coordinate of the area to paint to
1990      * @param w Width of the area to paint to
1991      * @param h Height of the area to paint to
1992      * @param orientation One of <code>JTabbedPane.TOP</code>,
1993      *                    <code>JTabbedPane.LEFT</code>,
1994      *                    <code>JTabbedPane.BOTTOM</code>, or
1995      *                    <code>JTabbedPane.RIGHT</code>
1996      * @since 1.6
1997      */
paintTabbedPaneTabAreaBackground(SynthContext context, Graphics g, int x, int y, int w, int h, int orientation)1998     public void paintTabbedPaneTabAreaBackground(SynthContext context,
1999                                      Graphics g, int x, int y,
2000                                      int w, int h, int orientation) {
2001         if (orientation == JTabbedPane.LEFT) {
2002             AffineTransform transform = new AffineTransform();
2003             transform.scale(-1, 1);
2004             transform.rotate(Math.toRadians(90));
2005             paintBackground(context, g, y, x, h, w, transform);
2006         } else if (orientation == JTabbedPane.RIGHT) {
2007             AffineTransform transform = new AffineTransform();
2008             transform.rotate(Math.toRadians(90));
2009             transform.translate(0, -(x + w));
2010             paintBackground(context, g, y, 0, h, w, transform);
2011         } else if (orientation == JTabbedPane.BOTTOM) {
2012             AffineTransform transform = new AffineTransform();
2013             transform.translate(x,y);
2014             transform.scale(1, -1);
2015             transform.translate(0,-h);
2016             paintBackground(context, g, 0, 0, w, h, transform);
2017         } else {
2018             paintBackground(context, g, x, y, w, h, null);
2019         }
2020     }
2021 
2022     /**
2023      * Paints the border of the area behind the tabs of a tabbed pane.
2024      *
2025      * @param context SynthContext identifying the <code>JComponent</code> and
2026      *        <code>Region</code> to paint to
2027      * @param g <code>Graphics</code> to paint to
2028      * @param x X coordinate of the area to paint to
2029      * @param y Y coordinate of the area to paint to
2030      * @param w Width of the area to paint to
2031      * @param h Height of the area to paint to
2032      */
paintTabbedPaneTabAreaBorder(SynthContext context, Graphics g, int x, int y, int w, int h)2033     public void paintTabbedPaneTabAreaBorder(SynthContext context,
2034                                  Graphics g, int x, int y,
2035                                  int w, int h) {
2036         paintBorder(context, g, x, y, w, h, null);
2037     }
2038 
2039     /**
2040      * Paints the border of the area behind the tabs of a tabbed pane. This
2041      * implementation invokes the method of the same name without the orientation.
2042      *
2043      * @param context SynthContext identifying the <code>JComponent</code> and
2044      *        <code>Region</code> to paint to
2045      * @param g <code>Graphics</code> to paint to
2046      * @param x X coordinate of the area to paint to
2047      * @param y Y coordinate of the area to paint to
2048      * @param w Width of the area to paint to
2049      * @param h Height of the area to paint to
2050      * @param orientation One of <code>JTabbedPane.TOP</code>,
2051      *                    <code>JTabbedPane.LEFT</code>,
2052      *                    <code>JTabbedPane.BOTTOM</code>, or
2053      *                    <code>JTabbedPane.RIGHT</code>
2054      * @since 1.6
2055      */
paintTabbedPaneTabAreaBorder(SynthContext context, Graphics g, int x, int y, int w, int h, int orientation)2056     public void paintTabbedPaneTabAreaBorder(SynthContext context,
2057                                  Graphics g, int x, int y,
2058                                  int w, int h, int orientation) {
2059         paintBorder(context, g, x, y, w, h, null);
2060     }
2061 
2062     /**
2063      * Paints the background of a tab of a tabbed pane.
2064      *
2065      * @param context SynthContext identifying the <code>JComponent</code> and
2066      *        <code>Region</code> to paint to
2067      * @param g <code>Graphics</code> to paint to
2068      * @param x X coordinate of the area to paint to
2069      * @param y Y coordinate of the area to paint to
2070      * @param w Width of the area to paint to
2071      * @param h Height of the area to paint to
2072      * @param tabIndex Index of tab being painted.
2073      */
paintTabbedPaneTabBackground(SynthContext context, Graphics g, int x, int y, int w, int h, int tabIndex)2074     public void paintTabbedPaneTabBackground(SynthContext context, Graphics g,
2075                                          int x, int y, int w, int h,
2076                                          int tabIndex) {
2077         paintBackground(context, g, x, y, w, h, null);
2078     }
2079 
2080     /**
2081      * Paints the background of a tab of a tabbed pane. This implementation
2082      * invokes the method of the same name without the orientation.
2083      *
2084      * @param context SynthContext identifying the <code>JComponent</code> and
2085      *        <code>Region</code> to paint to
2086      * @param g <code>Graphics</code> to paint to
2087      * @param x X coordinate of the area to paint to
2088      * @param y Y coordinate of the area to paint to
2089      * @param w Width of the area to paint to
2090      * @param h Height of the area to paint to
2091      * @param tabIndex Index of tab being painted.
2092      * @param orientation One of <code>JTabbedPane.TOP</code>,
2093      *                    <code>JTabbedPane.LEFT</code>,
2094      *                    <code>JTabbedPane.BOTTOM</code>, or
2095      *                    <code>JTabbedPane.RIGHT</code>
2096      * @since 1.6
2097      */
paintTabbedPaneTabBackground(SynthContext context, Graphics g, int x, int y, int w, int h, int tabIndex, int orientation)2098     public void paintTabbedPaneTabBackground(SynthContext context, Graphics g,
2099                                          int x, int y, int w, int h,
2100                                          int tabIndex, int orientation) {
2101         if (orientation == JTabbedPane.LEFT) {
2102             AffineTransform transform = new AffineTransform();
2103             transform.scale(-1, 1);
2104             transform.rotate(Math.toRadians(90));
2105             paintBackground(context, g, y, x, h, w, transform);
2106         } else if (orientation == JTabbedPane.RIGHT) {
2107             AffineTransform transform = new AffineTransform();
2108             transform.rotate(Math.toRadians(90));
2109             transform.translate(0, -(x + w));
2110             paintBackground(context, g, y, 0, h, w, transform);
2111         } else if (orientation == JTabbedPane.BOTTOM) {
2112             AffineTransform transform = new AffineTransform();
2113             transform.translate(x,y);
2114             transform.scale(1, -1);
2115             transform.translate(0,-h);
2116             paintBackground(context, g, 0, 0, w, h, transform);
2117         } else {
2118             paintBackground(context, g, x, y, w, h, null);
2119         }
2120     }
2121 
2122     /**
2123      * Paints the border of a tab of a tabbed pane.
2124      *
2125      * @param context SynthContext identifying the <code>JComponent</code> and
2126      *        <code>Region</code> to paint to
2127      * @param g <code>Graphics</code> to paint to
2128      * @param x X coordinate of the area to paint to
2129      * @param y Y coordinate of the area to paint to
2130      * @param w Width of the area to paint to
2131      * @param h Height of the area to paint to
2132      * @param tabIndex Index of tab being painted.
2133      */
paintTabbedPaneTabBorder(SynthContext context, Graphics g, int x, int y, int w, int h, int tabIndex)2134     public void paintTabbedPaneTabBorder(SynthContext context, Graphics g,
2135                                          int x, int y, int w, int h,
2136                                          int tabIndex) {
2137         paintBorder(context, g, x, y, w, h, null);
2138     }
2139 
2140     /**
2141      * Paints the border of a tab of a tabbed pane. This implementation invokes
2142      * the method of the same name without the orientation.
2143      *
2144      * @param context SynthContext identifying the <code>JComponent</code> and
2145      *        <code>Region</code> to paint to
2146      * @param g <code>Graphics</code> to paint to
2147      * @param x X coordinate of the area to paint to
2148      * @param y Y coordinate of the area to paint to
2149      * @param w Width of the area to paint to
2150      * @param h Height of the area to paint to
2151      * @param tabIndex Index of tab being painted.
2152      * @param orientation One of <code>JTabbedPane.TOP</code>,
2153      *                    <code>JTabbedPane.LEFT</code>,
2154      *                    <code>JTabbedPane.BOTTOM</code>, or
2155      *                    <code>JTabbedPane.RIGHT</code>
2156      * @since 1.6
2157      */
paintTabbedPaneTabBorder(SynthContext context, Graphics g, int x, int y, int w, int h, int tabIndex, int orientation)2158     public void paintTabbedPaneTabBorder(SynthContext context, Graphics g,
2159                                          int x, int y, int w, int h,
2160                                          int tabIndex, int orientation) {
2161         paintBorder(context, g, x, y, w, h, null);
2162     }
2163 
2164     /**
2165      * Paints the background of the area that contains the content of the
2166      * selected tab of a tabbed pane.
2167      *
2168      * @param context SynthContext identifying the <code>JComponent</code> and
2169      *        <code>Region</code> to paint to
2170      * @param g <code>Graphics</code> to paint to
2171      * @param x X coordinate of the area to paint to
2172      * @param y Y coordinate of the area to paint to
2173      * @param w Width of the area to paint to
2174      * @param h Height of the area to paint to
2175      */
paintTabbedPaneContentBackground(SynthContext context, Graphics g, int x, int y, int w, int h)2176     public void paintTabbedPaneContentBackground(SynthContext context,
2177                                          Graphics g, int x, int y, int w,
2178                                          int h) {
2179         paintBackground(context, g, x, y, w, h, null);
2180     }
2181 
2182     /**
2183      * Paints the border of the area that contains the content of the
2184      * selected tab of a tabbed pane.
2185      *
2186      * @param context SynthContext identifying the <code>JComponent</code> and
2187      *        <code>Region</code> to paint to
2188      * @param g <code>Graphics</code> to paint to
2189      * @param x X coordinate of the area to paint to
2190      * @param y Y coordinate of the area to paint to
2191      * @param w Width of the area to paint to
2192      * @param h Height of the area to paint to
2193      */
paintTabbedPaneContentBorder(SynthContext context, Graphics g, int x, int y, int w, int h)2194     public void paintTabbedPaneContentBorder(SynthContext context, Graphics g,
2195                                          int x, int y, int w, int h) {
2196         paintBorder(context, g, x, y, w, h, null);
2197     }
2198 
2199     /**
2200      * Paints the background of the header of a table.
2201      *
2202      * @param context SynthContext identifying the <code>JComponent</code> and
2203      *        <code>Region</code> to paint to
2204      * @param g <code>Graphics</code> to paint to
2205      * @param x X coordinate of the area to paint to
2206      * @param y Y coordinate of the area to paint to
2207      * @param w Width of the area to paint to
2208      * @param h Height of the area to paint to
2209      */
paintTableHeaderBackground(SynthContext context, Graphics g, int x, int y, int w, int h)2210     public void paintTableHeaderBackground(SynthContext context,
2211                                      Graphics g, int x, int y,
2212                                      int w, int h) {
2213         paintBackground(context, g, x, y, w, h, null);
2214     }
2215 
2216     /**
2217      * Paints the border of the header of a table.
2218      *
2219      * @param context SynthContext identifying the <code>JComponent</code> and
2220      *        <code>Region</code> to paint to
2221      * @param g <code>Graphics</code> to paint to
2222      * @param x X coordinate of the area to paint to
2223      * @param y Y coordinate of the area to paint to
2224      * @param w Width of the area to paint to
2225      * @param h Height of the area to paint to
2226      */
paintTableHeaderBorder(SynthContext context, Graphics g, int x, int y, int w, int h)2227     public void paintTableHeaderBorder(SynthContext context,
2228                                  Graphics g, int x, int y,
2229                                  int w, int h) {
2230         paintBorder(context, g, x, y, w, h, null);
2231     }
2232 
2233     /**
2234      * Paints the background of a table.
2235      *
2236      * @param context SynthContext identifying the <code>JComponent</code> and
2237      *        <code>Region</code> to paint to
2238      * @param g <code>Graphics</code> to paint to
2239      * @param x X coordinate of the area to paint to
2240      * @param y Y coordinate of the area to paint to
2241      * @param w Width of the area to paint to
2242      * @param h Height of the area to paint to
2243      */
paintTableBackground(SynthContext context, Graphics g, int x, int y, int w, int h)2244     public void paintTableBackground(SynthContext context,
2245                                      Graphics g, int x, int y,
2246                                      int w, int h) {
2247         paintBackground(context, g, x, y, w, h, null);
2248     }
2249 
2250     /**
2251      * Paints the border of a table.
2252      *
2253      * @param context SynthContext identifying the <code>JComponent</code> and
2254      *        <code>Region</code> to paint to
2255      * @param g <code>Graphics</code> to paint to
2256      * @param x X coordinate of the area to paint to
2257      * @param y Y coordinate of the area to paint to
2258      * @param w Width of the area to paint to
2259      * @param h Height of the area to paint to
2260      */
paintTableBorder(SynthContext context, Graphics g, int x, int y, int w, int h)2261     public void paintTableBorder(SynthContext context,
2262                                  Graphics g, int x, int y,
2263                                  int w, int h) {
2264         paintBorder(context, g, x, y, w, h, null);
2265     }
2266 
2267     /**
2268      * Paints the background of a text area.
2269      *
2270      * @param context SynthContext identifying the <code>JComponent</code> and
2271      *        <code>Region</code> to paint to
2272      * @param g <code>Graphics</code> to paint to
2273      * @param x X coordinate of the area to paint to
2274      * @param y Y coordinate of the area to paint to
2275      * @param w Width of the area to paint to
2276      * @param h Height of the area to paint to
2277      */
paintTextAreaBackground(SynthContext context, Graphics g, int x, int y, int w, int h)2278     public void paintTextAreaBackground(SynthContext context,
2279                                      Graphics g, int x, int y,
2280                                      int w, int h) {
2281         paintBackground(context, g, x, y, w, h, null);
2282     }
2283 
2284     /**
2285      * Paints the border of a text area.
2286      *
2287      * @param context SynthContext identifying the <code>JComponent</code> and
2288      *        <code>Region</code> to paint to
2289      * @param g <code>Graphics</code> to paint to
2290      * @param x X coordinate of the area to paint to
2291      * @param y Y coordinate of the area to paint to
2292      * @param w Width of the area to paint to
2293      * @param h Height of the area to paint to
2294      */
paintTextAreaBorder(SynthContext context, Graphics g, int x, int y, int w, int h)2295     public void paintTextAreaBorder(SynthContext context,
2296                                  Graphics g, int x, int y,
2297                                  int w, int h) {
2298         paintBorder(context, g, x, y, w, h, null);
2299     }
2300 
2301     /**
2302      * Paints the background of a text pane.
2303      *
2304      * @param context SynthContext identifying the <code>JComponent</code> and
2305      *        <code>Region</code> to paint to
2306      * @param g <code>Graphics</code> to paint to
2307      * @param x X coordinate of the area to paint to
2308      * @param y Y coordinate of the area to paint to
2309      * @param w Width of the area to paint to
2310      * @param h Height of the area to paint to
2311      */
paintTextPaneBackground(SynthContext context, Graphics g, int x, int y, int w, int h)2312     public void paintTextPaneBackground(SynthContext context,
2313                                      Graphics g, int x, int y,
2314                                      int w, int h) {
2315         paintBackground(context, g, x, y, w, h, null);
2316     }
2317 
2318     /**
2319      * Paints the border of a text pane.
2320      *
2321      * @param context SynthContext identifying the <code>JComponent</code> and
2322      *        <code>Region</code> to paint to
2323      * @param g <code>Graphics</code> to paint to
2324      * @param x X coordinate of the area to paint to
2325      * @param y Y coordinate of the area to paint to
2326      * @param w Width of the area to paint to
2327      * @param h Height of the area to paint to
2328      */
paintTextPaneBorder(SynthContext context, Graphics g, int x, int y, int w, int h)2329     public void paintTextPaneBorder(SynthContext context,
2330                                  Graphics g, int x, int y,
2331                                  int w, int h) {
2332         paintBorder(context, g, x, y, w, h, null);
2333     }
2334 
2335     /**
2336      * Paints the background of a text field.
2337      *
2338      * @param context SynthContext identifying the <code>JComponent</code> and
2339      *        <code>Region</code> to paint to
2340      * @param g <code>Graphics</code> to paint to
2341      * @param x X coordinate of the area to paint to
2342      * @param y Y coordinate of the area to paint to
2343      * @param w Width of the area to paint to
2344      * @param h Height of the area to paint to
2345      */
paintTextFieldBackground(SynthContext context, Graphics g, int x, int y, int w, int h)2346     public void paintTextFieldBackground(SynthContext context,
2347                                           Graphics g, int x, int y,
2348                                           int w, int h) {
2349         if (context.getComponent().getComponentOrientation().isLeftToRight()){
2350             paintBackground(context, g, x, y, w, h, null);
2351         } else {
2352             AffineTransform transform = new AffineTransform();
2353             transform.translate(x,y);
2354             transform.scale(-1, 1);
2355             transform.translate(-w,0);
2356             paintBackground(context, g, 0, 0, w, h, transform);
2357         }
2358     }
2359 
2360     /**
2361      * Paints the border of a text field.
2362      *
2363      * @param context SynthContext identifying the <code>JComponent</code> and
2364      *        <code>Region</code> to paint to
2365      * @param g <code>Graphics</code> to paint to
2366      * @param x X coordinate of the area to paint to
2367      * @param y Y coordinate of the area to paint to
2368      * @param w Width of the area to paint to
2369      * @param h Height of the area to paint to
2370      */
paintTextFieldBorder(SynthContext context, Graphics g, int x, int y, int w, int h)2371     public void paintTextFieldBorder(SynthContext context,
2372                                       Graphics g, int x, int y,
2373                                       int w, int h) {
2374         if (context.getComponent().getComponentOrientation().isLeftToRight()){
2375             paintBorder(context, g, x, y, w, h, null);
2376         } else {
2377             AffineTransform transform = new AffineTransform();
2378             transform.translate(x,y);
2379             transform.scale(-1, 1);
2380             transform.translate(-w,0);
2381             paintBorder(context, g, 0, 0, w, h, transform);
2382         }
2383     }
2384 
2385     /**
2386      * Paints the background of a toggle button.
2387      *
2388      * @param context SynthContext identifying the <code>JComponent</code> and
2389      *        <code>Region</code> to paint to
2390      * @param g <code>Graphics</code> to paint to
2391      * @param x X coordinate of the area to paint to
2392      * @param y Y coordinate of the area to paint to
2393      * @param w Width of the area to paint to
2394      * @param h Height of the area to paint to
2395      */
paintToggleButtonBackground(SynthContext context, Graphics g, int x, int y, int w, int h)2396     public void paintToggleButtonBackground(SynthContext context,
2397                                      Graphics g, int x, int y,
2398                                      int w, int h) {
2399         paintBackground(context, g, x, y, w, h, null);
2400     }
2401 
2402     /**
2403      * Paints the border of a toggle button.
2404      *
2405      * @param context SynthContext identifying the <code>JComponent</code> and
2406      *        <code>Region</code> to paint to
2407      * @param g <code>Graphics</code> to paint to
2408      * @param x X coordinate of the area to paint to
2409      * @param y Y coordinate of the area to paint to
2410      * @param w Width of the area to paint to
2411      * @param h Height of the area to paint to
2412      */
paintToggleButtonBorder(SynthContext context, Graphics g, int x, int y, int w, int h)2413     public void paintToggleButtonBorder(SynthContext context,
2414                                  Graphics g, int x, int y,
2415                                  int w, int h) {
2416         paintBorder(context, g, x, y, w, h, null);
2417     }
2418 
2419     /**
2420      * Paints the background of a tool bar.
2421      *
2422      * @param context SynthContext identifying the <code>JComponent</code> and
2423      *        <code>Region</code> to paint to
2424      * @param g <code>Graphics</code> to paint to
2425      * @param x X coordinate of the area to paint to
2426      * @param y Y coordinate of the area to paint to
2427      * @param w Width of the area to paint to
2428      * @param h Height of the area to paint to
2429      */
paintToolBarBackground(SynthContext context, Graphics g, int x, int y, int w, int h)2430     public void paintToolBarBackground(SynthContext context,
2431                                      Graphics g, int x, int y,
2432                                      int w, int h) {
2433         paintBackground(context, g, x, y, w, h, null);
2434     }
2435 
2436     /**
2437      * Paints the background of a tool bar. This implementation invokes the
2438      * method of the same name without the orientation.
2439      *
2440      * @param context SynthContext identifying the <code>JComponent</code> and
2441      *        <code>Region</code> to paint to
2442      * @param g <code>Graphics</code> to paint to
2443      * @param x X coordinate of the area to paint to
2444      * @param y Y coordinate of the area to paint to
2445      * @param w Width of the area to paint to
2446      * @param h Height of the area to paint to
2447      * @param orientation One of <code>JToolBar.HORIZONTAL</code> or
2448      *                           <code>JToolBar.VERTICAL</code>
2449      * @since 1.6
2450      */
paintToolBarBackground(SynthContext context, Graphics g, int x, int y, int w, int h, int orientation)2451     public void paintToolBarBackground(SynthContext context,
2452                                      Graphics g, int x, int y,
2453                                      int w, int h, int orientation) {
2454         paintBackground(context, g, x, y, w, h, orientation);
2455     }
2456 
2457     /**
2458      * Paints the border of a tool bar.
2459      *
2460      * @param context SynthContext identifying the <code>JComponent</code> and
2461      *        <code>Region</code> to paint to
2462      * @param g <code>Graphics</code> to paint to
2463      * @param x X coordinate of the area to paint to
2464      * @param y Y coordinate of the area to paint to
2465      * @param w Width of the area to paint to
2466      * @param h Height of the area to paint to
2467      */
paintToolBarBorder(SynthContext context, Graphics g, int x, int y, int w, int h)2468     public void paintToolBarBorder(SynthContext context,
2469                                  Graphics g, int x, int y,
2470                                  int w, int h) {
2471         paintBorder(context, g, x, y, w, h, null);
2472     }
2473 
2474     /**
2475      * Paints the border of a tool bar. This implementation invokes the
2476      * method of the same name without the orientation.
2477      *
2478      * @param context SynthContext identifying the <code>JComponent</code> and
2479      *        <code>Region</code> to paint to
2480      * @param g <code>Graphics</code> to paint to
2481      * @param x X coordinate of the area to paint to
2482      * @param y Y coordinate of the area to paint to
2483      * @param w Width of the area to paint to
2484      * @param h Height of the area to paint to
2485      * @param orientation One of <code>JToolBar.HORIZONTAL</code> or
2486      *                           <code>JToolBar.VERTICAL</code>
2487      * @since 1.6
2488      */
paintToolBarBorder(SynthContext context, Graphics g, int x, int y, int w, int h, int orientation)2489     public void paintToolBarBorder(SynthContext context,
2490                                  Graphics g, int x, int y,
2491                                  int w, int h, int orientation) {
2492         paintBorder(context, g, x, y, w, h, orientation);
2493     }
2494 
2495     /**
2496      * Paints the background of the tool bar's content area.
2497      *
2498      * @param context SynthContext identifying the <code>JComponent</code> and
2499      *        <code>Region</code> to paint to
2500      * @param g <code>Graphics</code> to paint to
2501      * @param x X coordinate of the area to paint to
2502      * @param y Y coordinate of the area to paint to
2503      * @param w Width of the area to paint to
2504      * @param h Height of the area to paint to
2505      */
paintToolBarContentBackground(SynthContext context, Graphics g, int x, int y, int w, int h)2506     public void paintToolBarContentBackground(SynthContext context,
2507                                      Graphics g, int x, int y,
2508                                      int w, int h) {
2509         paintBackground(context, g, x, y, w, h, null);
2510     }
2511 
2512     /**
2513      * Paints the background of the tool bar's content area. This implementation
2514      * invokes the method of the same name without the orientation.
2515      *
2516      * @param context SynthContext identifying the <code>JComponent</code> and
2517      *        <code>Region</code> to paint to
2518      * @param g <code>Graphics</code> to paint to
2519      * @param x X coordinate of the area to paint to
2520      * @param y Y coordinate of the area to paint to
2521      * @param w Width of the area to paint to
2522      * @param h Height of the area to paint to
2523      * @param orientation One of <code>JToolBar.HORIZONTAL</code> or
2524      *                           <code>JToolBar.VERTICAL</code>
2525      * @since 1.6
2526      */
paintToolBarContentBackground(SynthContext context, Graphics g, int x, int y, int w, int h, int orientation)2527     public void paintToolBarContentBackground(SynthContext context,
2528                                      Graphics g, int x, int y,
2529                                      int w, int h, int orientation) {
2530         paintBackground(context, g, x, y, w, h, orientation);
2531     }
2532 
2533     /**
2534      * Paints the border of the content area of a tool bar.
2535      *
2536      * @param context SynthContext identifying the <code>JComponent</code> and
2537      *        <code>Region</code> to paint to
2538      * @param g <code>Graphics</code> to paint to
2539      * @param x X coordinate of the area to paint to
2540      * @param y Y coordinate of the area to paint to
2541      * @param w Width of the area to paint to
2542      * @param h Height of the area to paint to
2543      */
paintToolBarContentBorder(SynthContext context, Graphics g, int x, int y, int w, int h)2544     public void paintToolBarContentBorder(SynthContext context,
2545                                  Graphics g, int x, int y,
2546                                  int w, int h) {
2547         paintBorder(context, g, x, y, w, h, null);
2548     }
2549 
2550     /**
2551      * Paints the border of the content area of a tool bar. This implementation
2552      * invokes the method of the same name without the orientation.
2553      *
2554      * @param context SynthContext identifying the <code>JComponent</code> and
2555      *        <code>Region</code> to paint to
2556      * @param g <code>Graphics</code> to paint to
2557      * @param x X coordinate of the area to paint to
2558      * @param y Y coordinate of the area to paint to
2559      * @param w Width of the area to paint to
2560      * @param h Height of the area to paint to
2561      * @param orientation One of <code>JToolBar.HORIZONTAL</code> or
2562      *                           <code>JToolBar.VERTICAL</code>
2563      * @since 1.6
2564      */
paintToolBarContentBorder(SynthContext context, Graphics g, int x, int y, int w, int h, int orientation)2565     public void paintToolBarContentBorder(SynthContext context,
2566                                  Graphics g, int x, int y,
2567                                  int w, int h, int orientation) {
2568         paintBorder(context, g, x, y, w, h, orientation);
2569     }
2570 
2571     /**
2572      * Paints the background of the window containing the tool bar when it
2573      * has been detached from its primary frame.
2574      *
2575      * @param context SynthContext identifying the <code>JComponent</code> and
2576      *        <code>Region</code> to paint to
2577      * @param g <code>Graphics</code> to paint to
2578      * @param x X coordinate of the area to paint to
2579      * @param y Y coordinate of the area to paint to
2580      * @param w Width of the area to paint to
2581      * @param h Height of the area to paint to
2582      */
paintToolBarDragWindowBackground(SynthContext context, Graphics g, int x, int y, int w, int h)2583     public void paintToolBarDragWindowBackground(SynthContext context,
2584                                      Graphics g, int x, int y,
2585                                      int w, int h) {
2586         paintBackground(context, g, x, y, w, h, null);
2587     }
2588 
2589     /**
2590      * Paints the background of the window containing the tool bar when it
2591      * has been detached from its primary frame. This implementation invokes the
2592      * method of the same name without the orientation.
2593      *
2594      * @param context SynthContext identifying the <code>JComponent</code> and
2595      *        <code>Region</code> to paint to
2596      * @param g <code>Graphics</code> to paint to
2597      * @param x X coordinate of the area to paint to
2598      * @param y Y coordinate of the area to paint to
2599      * @param w Width of the area to paint to
2600      * @param h Height of the area to paint to
2601      * @param orientation One of <code>JToolBar.HORIZONTAL</code> or
2602      *                           <code>JToolBar.VERTICAL</code>
2603      * @since 1.6
2604      */
paintToolBarDragWindowBackground(SynthContext context, Graphics g, int x, int y, int w, int h, int orientation)2605     public void paintToolBarDragWindowBackground(SynthContext context,
2606                                      Graphics g, int x, int y,
2607                                      int w, int h, int orientation) {
2608         paintBackground(context, g, x, y, w, h, orientation);
2609     }
2610 
2611     /**
2612      * Paints the border of the window containing the tool bar when it
2613      * has been detached from it's primary frame.
2614      *
2615      * @param context SynthContext identifying the <code>JComponent</code> and
2616      *        <code>Region</code> to paint to
2617      * @param g <code>Graphics</code> to paint to
2618      * @param x X coordinate of the area to paint to
2619      * @param y Y coordinate of the area to paint to
2620      * @param w Width of the area to paint to
2621      * @param h Height of the area to paint to
2622      */
paintToolBarDragWindowBorder(SynthContext context, Graphics g, int x, int y, int w, int h)2623     public void paintToolBarDragWindowBorder(SynthContext context,
2624                                  Graphics g, int x, int y,
2625                                  int w, int h) {
2626         paintBorder(context, g, x, y, w, h, null);
2627     }
2628 
2629     /**
2630      * Paints the border of the window containing the tool bar when it
2631      * has been detached from it's primary frame. This implementation invokes the
2632      * method of the same name without the orientation.
2633      *
2634      * @param context SynthContext identifying the <code>JComponent</code> and
2635      *        <code>Region</code> to paint to
2636      * @param g <code>Graphics</code> to paint to
2637      * @param x X coordinate of the area to paint to
2638      * @param y Y coordinate of the area to paint to
2639      * @param w Width of the area to paint to
2640      * @param h Height of the area to paint to
2641      * @param orientation One of <code>JToolBar.HORIZONTAL</code> or
2642      *                           <code>JToolBar.VERTICAL</code>
2643      * @since 1.6
2644      */
paintToolBarDragWindowBorder(SynthContext context, Graphics g, int x, int y, int w, int h, int orientation)2645     public void paintToolBarDragWindowBorder(SynthContext context,
2646                                  Graphics g, int x, int y,
2647                                  int w, int h, int orientation) {
2648         paintBorder(context, g, x, y, w, h, orientation);
2649     }
2650 
2651     /**
2652      * Paints the background of a tool tip.
2653      *
2654      * @param context SynthContext identifying the <code>JComponent</code> and
2655      *        <code>Region</code> to paint to
2656      * @param g <code>Graphics</code> to paint to
2657      * @param x X coordinate of the area to paint to
2658      * @param y Y coordinate of the area to paint to
2659      * @param w Width of the area to paint to
2660      * @param h Height of the area to paint to
2661      */
paintToolTipBackground(SynthContext context, Graphics g, int x, int y, int w, int h)2662     public void paintToolTipBackground(SynthContext context,
2663                                      Graphics g, int x, int y,
2664                                      int w, int h) {
2665         paintBackground(context, g, x, y, w, h, null);
2666     }
2667 
2668     /**
2669      * Paints the border of a tool tip.
2670      *
2671      * @param context SynthContext identifying the <code>JComponent</code> and
2672      *        <code>Region</code> to paint to
2673      * @param g <code>Graphics</code> to paint to
2674      * @param x X coordinate of the area to paint to
2675      * @param y Y coordinate of the area to paint to
2676      * @param w Width of the area to paint to
2677      * @param h Height of the area to paint to
2678      */
paintToolTipBorder(SynthContext context, Graphics g, int x, int y, int w, int h)2679     public void paintToolTipBorder(SynthContext context,
2680                                  Graphics g, int x, int y,
2681                                  int w, int h) {
2682         paintBorder(context, g, x, y, w, h, null);
2683     }
2684 
2685     /**
2686      * Paints the background of a tree.
2687      *
2688      * @param context SynthContext identifying the <code>JComponent</code> and
2689      *        <code>Region</code> to paint to
2690      * @param g <code>Graphics</code> to paint to
2691      * @param x X coordinate of the area to paint to
2692      * @param y Y coordinate of the area to paint to
2693      * @param w Width of the area to paint to
2694      * @param h Height of the area to paint to
2695      */
paintTreeBackground(SynthContext context, Graphics g, int x, int y, int w, int h)2696     public void paintTreeBackground(SynthContext context,
2697                                      Graphics g, int x, int y,
2698                                      int w, int h) {
2699         paintBackground(context, g, x, y, w, h, null);
2700     }
2701 
2702     /**
2703      * Paints the border of a tree.
2704      *
2705      * @param context SynthContext identifying the <code>JComponent</code> and
2706      *        <code>Region</code> to paint to
2707      * @param g <code>Graphics</code> to paint to
2708      * @param x X coordinate of the area to paint to
2709      * @param y Y coordinate of the area to paint to
2710      * @param w Width of the area to paint to
2711      * @param h Height of the area to paint to
2712      */
paintTreeBorder(SynthContext context, Graphics g, int x, int y, int w, int h)2713     public void paintTreeBorder(SynthContext context,
2714                                  Graphics g, int x, int y,
2715                                  int w, int h) {
2716         paintBorder(context, g, x, y, w, h, null);
2717     }
2718 
2719     /**
2720      * Paints the background of the row containing a cell in a tree.
2721      *
2722      * @param context SynthContext identifying the <code>JComponent</code> and
2723      *        <code>Region</code> to paint to
2724      * @param g <code>Graphics</code> to paint to
2725      * @param x X coordinate of the area to paint to
2726      * @param y Y coordinate of the area to paint to
2727      * @param w Width of the area to paint to
2728      * @param h Height of the area to paint to
2729      */
paintTreeCellBackground(SynthContext context, Graphics g, int x, int y, int w, int h)2730     public void paintTreeCellBackground(SynthContext context,
2731                                      Graphics g, int x, int y,
2732                                      int w, int h) {
2733         paintBackground(context, g, x, y, w, h, null);
2734     }
2735 
2736     /**
2737      * Paints the border of the row containing a cell in a tree.
2738      *
2739      * @param context SynthContext identifying the <code>JComponent</code> and
2740      *        <code>Region</code> to paint to
2741      * @param g <code>Graphics</code> to paint to
2742      * @param x X coordinate of the area to paint to
2743      * @param y Y coordinate of the area to paint to
2744      * @param w Width of the area to paint to
2745      * @param h Height of the area to paint to
2746      */
paintTreeCellBorder(SynthContext context, Graphics g, int x, int y, int w, int h)2747     public void paintTreeCellBorder(SynthContext context,
2748                                  Graphics g, int x, int y,
2749                                  int w, int h) {
2750         paintBorder(context, g, x, y, w, h, null);
2751     }
2752 
2753     /**
2754      * Paints the focus indicator for a cell in a tree when it has focus.
2755      *
2756      * @param context SynthContext identifying the <code>JComponent</code> and
2757      *        <code>Region</code> to paint to
2758      * @param g <code>Graphics</code> to paint to
2759      * @param x X coordinate of the area to paint to
2760      * @param y Y coordinate of the area to paint to
2761      * @param w Width of the area to paint to
2762      * @param h Height of the area to paint to
2763      */
paintTreeCellFocus(SynthContext context, Graphics g, int x, int y, int w, int h)2764     public void paintTreeCellFocus(SynthContext context,
2765                                    Graphics g, int x, int y,
2766                                    int w, int h) {
2767         //TODO
2768     }
2769 
2770     /**
2771      * Paints the background of the viewport.
2772      *
2773      * @param context SynthContext identifying the <code>JComponent</code> and
2774      *        <code>Region</code> to paint to
2775      * @param g <code>Graphics</code> to paint to
2776      * @param x X coordinate of the area to paint to
2777      * @param y Y coordinate of the area to paint to
2778      * @param w Width of the area to paint to
2779      * @param h Height of the area to paint to
2780      */
paintViewportBackground(SynthContext context, Graphics g, int x, int y, int w, int h)2781     public void paintViewportBackground(SynthContext context,
2782                                      Graphics g, int x, int y,
2783                                      int w, int h) {
2784         paintBackground(context, g, x, y, w, h, null);
2785     }
2786 
2787     /**
2788      * Paints the border of a viewport.
2789      *
2790      * @param context SynthContext identifying the <code>JComponent</code> and
2791      *        <code>Region</code> to paint to
2792      * @param g <code>Graphics</code> to paint to
2793      * @param x X coordinate of the area to paint to
2794      * @param y Y coordinate of the area to paint to
2795      * @param w Width of the area to paint to
2796      * @param h Height of the area to paint to
2797      */
paintViewportBorder(SynthContext context, Graphics g, int x, int y, int w, int h)2798     public void paintViewportBorder(SynthContext context,
2799                                  Graphics g, int x, int y,
2800                                  int w, int h) {
2801         paintBorder(context, g, x, y, w, h, null);
2802     }
2803 }
2804