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.texture;
26
import com.jtattoo.plaf.*;
28
import java.awt.geom.Area;
29
import java.awt.geom.Rectangle2D;
30
import javax.swing.JInternalFrame;
33
* @author Michael Hagen
35
public class TextureInternalFrameTitlePane extends BaseInternalFrameTitlePane {
37
public TextureInternalFrameTitlePane(JInternalFrame f) {
41
protected int getHorSpacing() {
42
return AbstractLookAndFeel.getTheme().isMacStyleWindowDecorationOn() ? 1 : 0;
45
protected int getVerSpacing() {
46
return AbstractLookAndFeel.getTheme().isMacStyleWindowDecorationOn() ? 3 : 0;
49
protected boolean centerButtons() {
53
public void paintPalette(Graphics g) {
54
TextureUtils.fillComponent(g, this, TextureUtils.WINDOW_TEXTURE_TYPE);
57
public void paintBackground(Graphics g) {
58
TextureUtils.fillComponent(g, this, TextureUtils.WINDOW_TEXTURE_TYPE);
61
public void paintBorder(Graphics g) {
64
public void paintText(Graphics g, int x, int y, String title) {
65
if (isMacStyleWindowDecoration()) {
66
x += paintIcon(g, x, y) + 5;
68
Graphics2D g2D = (Graphics2D)g;
69
Shape savedClip = g2D.getClip();
70
Color fc = AbstractLookAndFeel.getWindowTitleForegroundColor();
71
if (fc.equals(Color.white)) {
72
Color bc = AbstractLookAndFeel.getWindowTitleColorDark();
74
JTattooUtilities.drawString(frame, g, title, x-1, y-1);
75
g2D.setColor(ColorHelper.darker(bc, 30));
76
JTattooUtilities.drawString(frame, g, title, x+1, y+1);
79
JTattooUtilities.drawString(frame, g, title, x, y);
81
Area clipArea = new Area(new Rectangle2D.Double(x, (getHeight() / 2), getWidth(), getHeight()));
82
clipArea.intersect(new Area(savedClip));
83
g2D.setClip(clipArea);
84
g.setColor(ColorHelper.darker(fc, 20));
85
JTattooUtilities.drawString(frame, g, title, x, y);
87
g2D.setClip(savedClip);