public class SyntaxStyle
extends java.lang.Object
Constructor and Description |
---|
SyntaxStyle(java.awt.Color color,
boolean italic,
boolean bold)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
java.awt.Color |
getColor()
Returns the text color.
|
java.awt.FontMetrics |
getFontMetrics(java.awt.Font font,
java.awt.Graphics g)
Returns the font metrics for the styled font.
|
boolean |
isBold()
Returns
true if boldface is enabled. |
boolean |
isItalic()
Returns
true if italics is enabled. |
boolean |
isPlain()
Returns
true if no font styles are enabled. |
void |
setGraphicsFlags(java.awt.Graphics gfx,
java.awt.Font font)
Sets the text color and font of the specified graphics context to that
specified in this style.
|
java.lang.String |
toString() |
public SyntaxStyle(java.awt.Color color, boolean italic, boolean bold)
color
- the text coloritalic
- whether the text should be italicsbold
- whether the text should be boldpublic java.awt.Color getColor()
public boolean isPlain()
true
if no font styles are enabled.public boolean isItalic()
true
if italics is enabled.public boolean isBold()
true
if boldface is enabled.public java.awt.FontMetrics getFontMetrics(java.awt.Font font, java.awt.Graphics g)
font
- the styled fontg
- the graphics to usepublic void setGraphicsFlags(java.awt.Graphics gfx, java.awt.Font font)
gfx
- the graphics context that should be modifiedfont
- the font to add the styles topublic java.lang.String toString()
toString
in class java.lang.Object