2
* Copyright (c) 2002 and later by MH Software-Entwicklung. All Rights Reserved.
4
* JTattoo is multiple licensed. If your are an open source developer you can use
5
* it under the terms and conditions of the GNU General Public License version 2.0
6
* or later as published by the Free Software Foundation.
10
* If you pay for a license you will become a registered user who could use the
11
* software under the terms and conditions of the GNU Lesser General Public License
12
* version 2.0 or later with classpath exception as published by the Free Software
16
* see: classpath-exception.txt
18
* Registered users could also use JTattoo under the terms and conditions of the
19
* Apache License, Version 2.0 as published by the Apache Software Foundation.
21
* see: APACHE-LICENSE-2.0.txt
24
package com.jtattoo.plaf.fast;
26
import com.jtattoo.plaf.*;
28
import javax.swing.JButton;
29
import javax.swing.JComponent;
30
import javax.swing.plaf.ComponentUI;
33
* @author Michael Hagen
35
public class FastScrollBarUI extends BaseScrollBarUI {
37
public static ComponentUI createUI(JComponent c) {
38
return new FastScrollBarUI();
41
protected JButton createDecreaseButton(int orientation) {
42
if (AbstractLookAndFeel.getTheme().isMacStyleScrollBarOn()) {
43
return super.createDecreaseButton(orientation);
45
return new FastScrollButton(orientation, scrollBarWidth);
49
protected JButton createIncreaseButton(int orientation) {
50
if (AbstractLookAndFeel.getTheme().isMacStyleScrollBarOn()) {
51
return super.createDecreaseButton(orientation);
53
return new FastScrollButton(orientation, scrollBarWidth);
57
protected void paintTrack(Graphics g, JComponent c, Rectangle trackBounds) {
58
g.setColor(AbstractLookAndFeel.getControlColorLight());
59
g.fillRect(trackBounds.x, trackBounds.y, trackBounds.width, trackBounds.height);
62
protected void paintThumb(Graphics g, JComponent c, Rectangle thumbBounds) {
67
g.translate(thumbBounds.x, thumbBounds.y);
69
Color backColor = AbstractLookAndFeel.getTheme().getControlBackgroundColor();
70
if (!JTattooUtilities.isActive(c)) {
71
backColor = ColorHelper.brighter(backColor, 50);
73
Color frameColorHi = ColorHelper.brighter(backColor, 40);
74
Color frameColorLo = ColorHelper.darker(backColor, 30);
75
g.setColor(backColor);
76
g.fillRect(1, 1, thumbBounds.width - 1, thumbBounds.height - 1);
77
g.setColor(frameColorLo);
78
g.drawRect(0, 0, thumbBounds.width - 1, thumbBounds.height - 1);
79
g.setColor(frameColorHi);
80
g.drawLine(1, 1, thumbBounds.width - 2, 1);
81
g.drawLine(1, 1, 1, thumbBounds.height - 2);
82
g.translate(-thumbBounds.x, -thumbBounds.y);
b'\\ No newline at end of file'