PageRenderTime 52ms CodeModel.GetById 30ms app.highlight 3ms RepoModel.GetById 17ms app.codeStats 0ms

/jEdit/tags/jedit-4-2-pre4/org/gjt/sp/jedit/syntax/SyntaxStyle.java

#
Java | 103 lines | 36 code | 8 blank | 59 comment | 0 complexity | 6c56ad76b48f95e4e8b137bb349c3495 MD5 | raw file
  1/*
  2 * SyntaxStyle.java - A simple text style class
  3 * :tabSize=8:indentSize=8:noTabs=false:
  4 * :folding=explicit:collapseFolds=1:
  5 *
  6 * Copyright (C) 1999, 2003 Slava Pestov
  7 *
  8 * This program is free software; you can redistribute it and/or
  9 * modify it under the terms of the GNU General Public License
 10 * as published by the Free Software Foundation; either version 2
 11 * of the License, or any later version.
 12 *
 13 * This program is distributed in the hope that it will be useful,
 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 16 * GNU General Public License for more details.
 17 *
 18 * You should have received a copy of the GNU General Public License
 19 * along with this program; if not, write to the Free Software
 20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 21 */
 22package org.gjt.sp.jedit.syntax;
 23
 24import java.awt.Font;
 25import java.awt.Color;
 26
 27/**
 28 * A simple text style class. It can specify the color, italic flag,
 29 * and bold flag of a run of text.
 30 * @author Slava Pestov
 31 * @version $Id: SyntaxStyle.java 4547 2003-03-14 02:51:25Z spestov $
 32 */
 33public class SyntaxStyle
 34{
 35	//{{{ SyntaxStyle constructor
 36	/**
 37	 * Creates a new SyntaxStyle.
 38	 * @param fgColor The text color
 39	 * @param bgColor The background color
 40	 * @param font The text font
 41	 */
 42	public SyntaxStyle(Color fgColor, Color bgColor, Font font)
 43	{
 44		this.fgColor = fgColor;
 45		this.bgColor = bgColor;
 46		this.font = font;
 47	} //}}}
 48
 49	//{{{ getForegroundColor() method
 50	/**
 51	 * Returns the text color.
 52	 */
 53	public Color getForegroundColor()
 54	{
 55		return fgColor;
 56	} //}}}
 57
 58	//{{{ getBackgroundColor() method
 59	/**
 60	 * Returns the background color.
 61	 */
 62	public Color getBackgroundColor()
 63	{
 64		return bgColor;
 65	} //}}}
 66
 67	//{{{ getFont() method
 68	/**
 69	 * Returns the style font.
 70	 */
 71	public Font getFont()
 72	{
 73		return font;
 74	} //}}}
 75
 76	//{{{ getCharWidth() method
 77	/**
 78	 * Returns the character width of the monospaced font.
 79	 * @since jEdit 4.2pre1
 80	 */
 81	public int getCharWidth()
 82	{
 83		return charWidth;
 84	} //}}}
 85
 86	//{{{ setCharWidth() method
 87	/**
 88	 * Sets the character width of the monospaced font.
 89	 * @param charWidth The character width
 90	 * @since jEdit 4.2pre1
 91	 */
 92	public void setCharWidth(int charWidth)
 93	{
 94		this.charWidth = charWidth;
 95	} //}}}
 96
 97	//{{{ Private members
 98	private Color fgColor;
 99	private Color bgColor;
100	private Font font;
101	private int charWidth;
102	//}}}
103}