~ubuntu-branches/ubuntu/vivid/drmips/vivid-backports

« back to all changes in this revision

Viewing changes to src/pc/DrMIPS/src/com/jtattoo/plaf/texture/TextureInternalFrameTitlePane.java

  • Committer: Package Import Robot
  • Author(s): Bruno Nova
  • Date: 2014-09-27 12:24:17 UTC
  • Revision ID: package-import@ubuntu.com-20140927122417-2gadkwt9k0u7j4zu
Tags: upstream-1.2.3
Import upstream version 1.2.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
* Copyright (c) 2002 and later by MH Software-Entwicklung. All Rights Reserved.
 
3
*  
 
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.
 
7
*  
 
8
* see: gpl-2.0.txt
 
9
 
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
 
13
* Foundation.
 
14
 
15
* see: lgpl-2.0.txt
 
16
* see: classpath-exception.txt
 
17
 
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.
 
20
*  
 
21
* see: APACHE-LICENSE-2.0.txt
 
22
*/
 
23
 
 
24
package com.jtattoo.plaf.texture;
 
25
 
 
26
import com.jtattoo.plaf.*;
 
27
import java.awt.*;
 
28
import java.awt.geom.Area;
 
29
import java.awt.geom.Rectangle2D;
 
30
import javax.swing.JInternalFrame;
 
31
 
 
32
/**
 
33
 * @author Michael Hagen
 
34
 */
 
35
public class TextureInternalFrameTitlePane extends BaseInternalFrameTitlePane {
 
36
 
 
37
    public TextureInternalFrameTitlePane(JInternalFrame f) {
 
38
        super(f);
 
39
    }
 
40
 
 
41
    protected int getHorSpacing() {
 
42
        return AbstractLookAndFeel.getTheme().isMacStyleWindowDecorationOn() ? 1 : 0;
 
43
    }
 
44
 
 
45
    protected int getVerSpacing() {
 
46
        return AbstractLookAndFeel.getTheme().isMacStyleWindowDecorationOn() ? 3 : 0;
 
47
    }
 
48
 
 
49
    protected boolean centerButtons() {
 
50
        return false;
 
51
    }
 
52
    
 
53
    public void paintPalette(Graphics g) {
 
54
        TextureUtils.fillComponent(g, this, TextureUtils.WINDOW_TEXTURE_TYPE);
 
55
    }
 
56
 
 
57
    public void paintBackground(Graphics g) {
 
58
        TextureUtils.fillComponent(g, this, TextureUtils.WINDOW_TEXTURE_TYPE);
 
59
    }
 
60
 
 
61
    public void paintBorder(Graphics g) {
 
62
    }
 
63
 
 
64
    public void paintText(Graphics g, int x, int y, String title) {
 
65
        if (isMacStyleWindowDecoration()) {
 
66
            x += paintIcon(g, x, y) + 5;
 
67
        }
 
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();
 
73
            g2D.setColor(bc);
 
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);
 
77
        }
 
78
        g.setColor(fc);
 
79
        JTattooUtilities.drawString(frame, g, title, x, y);
 
80
 
 
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);
 
86
 
 
87
        g2D.setClip(savedClip);
 
88
    }
 
89
 
 
90
}