1
package com.incors.plaf.kunststoff;
4
* This code was developed by INCORS GmbH (www.incors.com).
5
* It is published under the terms of the GNU Lesser General Public License.
7
* This class was originally contributed by Jens Niemeyer, jens@jensn.de
12
import javax.swing.plaf.*;
13
import javax.swing.plaf.basic.*;
15
public class KunststoffTableHeaderUI extends BasicTableHeaderUI {
17
public static ComponentUI createUI(JComponent c) {
18
return new KunststoffTableHeaderUI();
21
public void paint(Graphics g, JComponent c) {
25
return; // we only draw the gradients if the component is opaque
29
Color colorReflection = KunststoffLookAndFeel.getComponentGradientColorReflection();
30
if (colorReflection != null) {
31
Color colorReflectionFaded = KunststoffUtilities.getTranslucentColor(colorReflection, 0);
32
Rectangle rect = new Rectangle(0, 0, c.getWidth(), c.getHeight()/2);
33
KunststoffUtilities.drawGradient(g, colorReflection, colorReflectionFaded, rect, true);
37
Color colorShadow = KunststoffLookAndFeel.getComponentGradientColorShadow();
38
if (colorShadow != null) {
39
Color colorShadowFaded = KunststoffUtilities.getTranslucentColor(colorShadow, 0);
40
Rectangle rect = new Rectangle(0, c.getHeight()/2, c.getWidth(), c.getHeight()/2);
41
KunststoffUtilities.drawGradient(g, colorShadowFaded, colorShadow, rect, true);