PageRenderTime 49ms CodeModel.GetById 22ms RepoModel.GetById 0ms 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
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
  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. */
  22. package org.gjt.sp.jedit.syntax;
  23. import java.awt.Font;
  24. import java.awt.Color;
  25. /**
  26. * A simple text style class. It can specify the color, italic flag,
  27. * and bold flag of a run of text.
  28. * @author Slava Pestov
  29. * @version $Id: SyntaxStyle.java 4547 2003-03-14 02:51:25Z spestov $
  30. */
  31. public class SyntaxStyle
  32. {
  33. //{{{ SyntaxStyle constructor
  34. /**
  35. * Creates a new SyntaxStyle.
  36. * @param fgColor The text color
  37. * @param bgColor The background color
  38. * @param font The text font
  39. */
  40. public SyntaxStyle(Color fgColor, Color bgColor, Font font)
  41. {
  42. this.fgColor = fgColor;
  43. this.bgColor = bgColor;
  44. this.font = font;
  45. } //}}}
  46. //{{{ getForegroundColor() method
  47. /**
  48. * Returns the text color.
  49. */
  50. public Color getForegroundColor()
  51. {
  52. return fgColor;
  53. } //}}}
  54. //{{{ getBackgroundColor() method
  55. /**
  56. * Returns the background color.
  57. */
  58. public Color getBackgroundColor()
  59. {
  60. return bgColor;
  61. } //}}}
  62. //{{{ getFont() method
  63. /**
  64. * Returns the style font.
  65. */
  66. public Font getFont()
  67. {
  68. return font;
  69. } //}}}
  70. //{{{ getCharWidth() method
  71. /**
  72. * Returns the character width of the monospaced font.
  73. * @since jEdit 4.2pre1
  74. */
  75. public int getCharWidth()
  76. {
  77. return charWidth;
  78. } //}}}
  79. //{{{ setCharWidth() method
  80. /**
  81. * Sets the character width of the monospaced font.
  82. * @param charWidth The character width
  83. * @since jEdit 4.2pre1
  84. */
  85. public void setCharWidth(int charWidth)
  86. {
  87. this.charWidth = charWidth;
  88. } //}}}
  89. //{{{ Private members
  90. private Color fgColor;
  91. private Color bgColor;
  92. private Font font;
  93. private int charWidth;
  94. //}}}
  95. }