PageRenderTime 124ms CodeModel.GetById 121ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/jEdit/tags/jedit-4-0-pre3/org/gjt/sp/jedit/gui/JEditMetalTheme.java

#
Java | 72 lines | 43 code | 10 blank | 19 comment | 0 complexity | cfb647be4c1d810e89b4f789440e8c1b MD5 | raw file
 1/*
 2 * JEditMetalTheme.java - Minor Metal L&F tweaks for jEdit
 3 * Copyright (C) 2001 Slava Pestov
 4 *
 5 * This program is free software; you can redistribute it and/or
 6 * modify it under the terms of the GNU General Public License
 7 * as published by the Free Software Foundation; either version 2
 8 * of the License, or any later version.
 9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18 */
19
20package org.gjt.sp.jedit.gui;
21
22import javax.swing.plaf.metal.*;
23import javax.swing.plaf.*;
24import javax.swing.*;
25import org.gjt.sp.jedit.jEdit;
26
27public class JEditMetalTheme extends DefaultMetalTheme
28{
29	public String getName()
30	{
31		return "jEdit";
32	}
33
34	public ColorUIResource getSystemTextColor()
35	{
36		return getBlack();
37	}
38
39	public FontUIResource getControlTextFont()
40	{
41		return primaryFont;
42	}
43
44	public FontUIResource getSystemTextFont()
45	{
46		return secondaryFont;
47	}
48
49	public FontUIResource getUserTextFont()
50	{
51		return secondaryFont;
52	}
53
54	public FontUIResource getMenuTextFont()
55	{
56		return primaryFont;
57	}
58
59	public void propertiesChanged()
60	{
61		primaryFont = new FontUIResource(
62			jEdit.getFontProperty("metal.primary.font",
63			super.getControlTextFont()));
64		secondaryFont = new FontUIResource(
65			jEdit.getFontProperty("metal.secondary.font",
66			super.getSystemTextFont()));
67	}
68
69	// private members
70	private FontUIResource primaryFont;
71	private FontUIResource secondaryFont;
72}