Package mars.venus.editor.jeditsyntax
Class SyntaxStyle
java.lang.Object
mars.venus.editor.jeditsyntax.SyntaxStyle
A simple text style class. It can specify the color, italic flag,
and bold flag of a run of text.
- Version:
- $Id: SyntaxStyle.java,v 1.6 1999/12/13 03:40:30 sp Exp $
- Author:
- Slava Pestov
-
Constructor Summary
ConstructorsConstructorDescriptionSyntaxStyle
(Color foreground, boolean italic, boolean bold) Creates a new SyntaxStyle. -
Method Summary
Modifier and TypeMethodDescriptiongetFontMetrics
(Font font) Returns the font metrics for the styled font.Returns the color specified in this style.getStyledFont
(Font font) Returns the specified font, but with the style's bold and italic flags applied.boolean
isBold()
Returns true if boldface is enabled for this style.boolean
isItalic()
Returns true if italics is enabled for this style.boolean
isPlain()
Returns true if no font styles are enabled.void
setGraphicsFlags
(Graphics gfx, Font font) Sets the foreground color and font of the specified graphics context to that specified in this style.toString()
Returns a string representation of this object.
-
Constructor Details
-
SyntaxStyle
Creates a new SyntaxStyle.- Parameters:
foreground
- The text coloritalic
- True if the text should be italicsbold
- True if the text should be bold
-
-
Method Details
-
getForeground
Returns the color specified in this style. -
isPlain
public boolean isPlain()Returns true if no font styles are enabled. -
isItalic
public boolean isItalic()Returns true if italics is enabled for this style. -
isBold
public boolean isBold()Returns true if boldface is enabled for this style. -
getStyledFont
Returns the specified font, but with the style's bold and italic flags applied. -
getFontMetrics
Returns the font metrics for the styled font. -
setGraphicsFlags
Sets the foreground color and font of the specified graphics context to that specified in this style.- Parameters:
gfx
- The graphics contextfont
- The font to add the styles to
-
toString
Returns a string representation of this object.
-