public class SyntaxStyle
extends java.lang.Object
Constructor and Description |
---|
SyntaxStyle(java.awt.Color color,
boolean italic,
boolean bold)
Creates a new SyntaxStyle.
|
SyntaxStyle(SyntaxStyle style)
Copy a SyntaxStyle.
|
Modifier and Type | Method and Description |
---|---|
java.awt.Color |
getColor()
Returns the color specified in this style.
|
java.awt.FontMetrics |
getFontMetrics(java.awt.Font font)
Returns the font metrics for the styled font.
|
java.awt.Font |
getGraphicsFlags(java.awt.Font font)
Sets the foreground color and font of the specified graphics context to that specified in this style.
|
java.awt.Font |
getStyledFont(java.awt.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(java.awt.Graphics gfx,
java.awt.Font font)
Sets the foreground color and font of the specified graphics context to that specified in this style.
|
java.lang.String |
toString()
Returns a string representation of this object.
|
public SyntaxStyle(SyntaxStyle style)
style
- the stylepublic SyntaxStyle(java.awt.Color color, boolean italic, boolean bold)
color
- The text coloritalic
- True if the text should be italicsbold
- True if the text should be boldpublic java.awt.Color getColor()
public boolean isPlain()
public boolean isItalic()
public boolean isBold()
public java.awt.Font getStyledFont(java.awt.Font font)
font
- the fontpublic java.awt.FontMetrics getFontMetrics(java.awt.Font font)
font
- the fontpublic java.awt.Font getGraphicsFlags(java.awt.Font font)
font
- The font to add the styles topublic void setGraphicsFlags(java.awt.Graphics gfx, java.awt.Font font)
gfx
- The graphics contextfont
- The font to add the styles topublic java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2016, 2017, 2018, 2019, 2023 Herve Girod. All Rights Reserved. Documentation and source under the MIT licence