~ubuntu-branches/ubuntu/trusty/drmips/trusty-backports

« back to all changes in this revision

Viewing changes to src/pc/DrMIPS/src/com/jtattoo/plaf/bernstein/BernsteinDefaultTheme.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.bernstein;
 
25
 
 
26
import com.jtattoo.plaf.AbstractTheme;
 
27
import com.jtattoo.plaf.ColorHelper;
 
28
import java.awt.Color;
 
29
import javax.swing.plaf.ColorUIResource;
 
30
 
 
31
/**
 
32
 * @author Michael Hagen
 
33
 */
 
34
public class BernsteinDefaultTheme extends AbstractTheme {
 
35
 
 
36
    public BernsteinDefaultTheme() {
 
37
        super();
 
38
        // Setup theme with defaults
 
39
        setUpColor();
 
40
        // Overwrite defaults with user props
 
41
        loadProperties();
 
42
        // Setup the color arrays
 
43
        setUpColorArrs();
 
44
    }
 
45
 
 
46
    public String getPropertyFileName() {
 
47
        return "BernsteinTheme.properties";
 
48
    }
 
49
 
 
50
    public void setUpColor() {
 
51
        super.setUpColor();
 
52
        // Defaults for BernsteinLookAndFeel
 
53
        menuOpaque = false;
 
54
        menuAlpha = 0.85f;
 
55
 
 
56
        backgroundColor = new ColorUIResource(253, 249, 204);
 
57
        backgroundColorLight = white;
 
58
        backgroundColorDark = new ColorUIResource(253, 241, 176);
 
59
        alterBackgroundColor = new ColorUIResource(253, 241, 176);
 
60
        
 
61
        selectionBackgroundColor = new ColorUIResource(250, 216, 32);
 
62
        disabledForegroundColor = new ColorUIResource(164, 164, 164);
 
63
        frameColor = new ColorUIResource(233, 199, 5);
 
64
        focusCellColor = new ColorUIResource(139, 92, 0);
 
65
        rolloverColor = new ColorUIResource(251, 220, 64);
 
66
        
 
67
        buttonBackgroundColor = new ColorUIResource(253, 249, 204);
 
68
 
 
69
        controlBackgroundColor = new ColorUIResource(253, 249, 204);
 
70
        controlHighlightColor = white;
 
71
        controlShadowColor = new ColorUIResource(247, 231, 34);
 
72
        controlDarkShadowColor = frameColor;
 
73
        controlColorLight = new ColorUIResource(252, 218, 0);
 
74
        controlColorDark = new ColorUIResource(183, 142, 0);
 
75
 
 
76
        windowTitleBackgroundColor = selectionBackgroundColor;
 
77
        windowTitleColorLight = new ColorUIResource(253, 249, 204);
 
78
        windowTitleColorDark = new ColorUIResource(251, 241, 153);
 
79
        windowBorderColor = new ColorUIResource(254, 240, 0);
 
80
 
 
81
        windowInactiveTitleBackgroundColor = backgroundColor;
 
82
        windowInactiveTitleColorLight = white;
 
83
        windowInactiveTitleColorDark = new ColorUIResource(236, 236, 236);
 
84
        windowInactiveBorderColor = new ColorUIResource(254, 240, 0);
 
85
 
 
86
        menuBackgroundColor = backgroundColor;
 
87
        menuSelectionBackgroundColor = selectionBackgroundColor;
 
88
 
 
89
        toolbarBackgroundColor = backgroundColor;
 
90
        
 
91
        tabAreaBackgroundColor = backgroundColor;
 
92
        desktopColor = new ColorUIResource(253, 249, 204);
 
93
        
 
94
        tooltipForegroundColor = black;
 
95
        tooltipBackgroundColor = new ColorUIResource(254, 240, 80);
 
96
    }
 
97
 
 
98
    public void setUpColorArrs() {
 
99
        super.setUpColorArrs();
 
100
        // Generate the color arrays
 
101
        DEFAULT_COLORS = new Color[]{
 
102
                    new Color(247, 225, 0),
 
103
                    new Color(251, 232, 0),
 
104
                    new Color(243, 216, 0),
 
105
                    new Color(237, 204, 0),
 
106
                    new Color(239, 209, 0),
 
107
                    new Color(242, 215, 0),
 
108
                    new Color(243, 216, 0),
 
109
                    new Color(245, 221, 0),
 
110
                    new Color(246, 222, 0),
 
111
                    new Color(247, 225, 0),
 
112
                    new Color(248, 227, 0),
 
113
                    new Color(249, 230, 0),
 
114
                    new Color(251, 232, 0),
 
115
                    new Color(252, 235, 0),
 
116
                    new Color(253, 237, 0),
 
117
                    new Color(253, 237, 0),
 
118
                    new Color(254, 240, 0),};
 
119
        HIDEFAULT_COLORS = new Color[DEFAULT_COLORS.length];
 
120
        for (int i = 0; i < DEFAULT_COLORS.length; i++) {
 
121
            HIDEFAULT_COLORS[i] = ColorHelper.brighter(DEFAULT_COLORS[i], 50.0);
 
122
        }
 
123
 
 
124
        ACTIVE_COLORS = DEFAULT_COLORS;
 
125
        INACTIVE_COLORS = HIDEFAULT_COLORS;
 
126
        SELECTED_COLORS = DEFAULT_COLORS;
 
127
        PRESSED_COLORS = new Color[DEFAULT_COLORS.length];
 
128
        for (int i = 0; i < DEFAULT_COLORS.length; i++) {
 
129
            PRESSED_COLORS[i] = backgroundColor;
 
130
        }
 
131
 
 
132
        ROLLOVER_COLORS = new Color[DEFAULT_COLORS.length];
 
133
        for (int i = 0; i < DEFAULT_COLORS.length; i++) {
 
134
            ROLLOVER_COLORS[i] = ColorHelper.brighter(DEFAULT_COLORS[i], 70.0);
 
135
        }
 
136
 
 
137
        DISABLED_COLORS = new Color[HIDEFAULT_COLORS.length];
 
138
        for (int i = 0; i < HIDEFAULT_COLORS.length; i++) {
 
139
            DISABLED_COLORS[i] = ColorHelper.brighter(HIDEFAULT_COLORS[i], 40.0);
 
140
        }
 
141
 
 
142
        WINDOW_TITLE_COLORS = ColorHelper.createColorArr(windowTitleColorLight, windowTitleColorDark, 20);
 
143
        WINDOW_INACTIVE_TITLE_COLORS = ColorHelper.createColorArr(windowInactiveTitleColorLight, windowInactiveTitleColorDark, 20);
 
144
        MENUBAR_COLORS = ColorHelper.createColorArr(menuColorLight, menuColorDark, 20);
 
145
        TOOLBAR_COLORS = MENUBAR_COLORS;
 
146
 
 
147
        BUTTON_COLORS = HIDEFAULT_COLORS;
 
148
        TAB_COLORS = BUTTON_COLORS;
 
149
        COL_HEADER_COLORS = HIDEFAULT_COLORS;
 
150
        THUMB_COLORS = HIDEFAULT_COLORS;
 
151
        TRACK_COLORS = ColorHelper.createColorArr(new Color(255, 245, 200), Color.white, 20);
 
152
        SLIDER_COLORS = DEFAULT_COLORS;
 
153
        PROGRESSBAR_COLORS = DEFAULT_COLORS;
 
154
    }
 
155
}