|
Gridarta Editor
|
A simple text style class. More...
Collaboration diagram for net.sf.gridarta.textedit.textarea.SyntaxStyle:Public Member Functions | |
| Color | getColor () |
| Returns the text color. More... | |
| FontMetrics | getFontMetrics (final Font font, final Graphics g) |
| Returns the font metrics for the styled font. More... | |
| boolean | isBold () |
| Returns. More... | |
| boolean | isItalic () |
| Returns. More... | |
| boolean | isPlain () |
| Returns. More... | |
| void | setGraphicsFlags (final Graphics gfx, final Font font) |
| Sets the text color and font of the specified graphics context to that specified in this style. More... | |
| SyntaxStyle (final Color color, final boolean italic, final boolean bold) | |
| Creates a new instance. More... | |
| String | toString () |
Private Member Functions | |
| Font | getStyledFont (final Font font) |
| Returns the specified font, but with the style's bold and italic flags applied. More... | |
| void | updateStyledFont (final Font font) |
| Update lastFont and lastStyledFont for the given font. More... | |
Private Attributes | |
| final boolean | bold |
| Whether the text should be bold. More... | |
| final Color | color |
| The text color. More... | |
| FontMetrics | fontMetrics |
| The font metrics for lastStyledFont. More... | |
| final boolean | italic |
| Whether the text should be italics. More... | |
| Font | lastFont |
| The base font used to calculate lastStyledFont. More... | |
| Font | lastStyledFont |
| The font lastFont with applied italics and bold settings. More... | |
A simple text style class.
It can specify the color, italic flag, and bold flag of a run of text.
Definition at line 25 of file SyntaxStyle.java.
| net.sf.gridarta.textedit.textarea.SyntaxStyle.SyntaxStyle | ( | final Color | color, |
| final boolean | italic, | ||
| final boolean | bold | ||
| ) |
Creates a new instance.
| color | the text color |
| italic | whether the text should be italics |
| bold | whether the text should be bold |
Definition at line 67 of file SyntaxStyle.java.
References net.sf.gridarta.textedit.textarea.SyntaxStyle.bold, net.sf.gridarta.textedit.textarea.SyntaxStyle.color, and net.sf.gridarta.textedit.textarea.SyntaxStyle.italic.
| Color net.sf.gridarta.textedit.textarea.SyntaxStyle.getColor | ( | ) |
Returns the text color.
Definition at line 77 of file SyntaxStyle.java.
References net.sf.gridarta.textedit.textarea.SyntaxStyle.color.
| FontMetrics net.sf.gridarta.textedit.textarea.SyntaxStyle.getFontMetrics | ( | final Font | font, |
| final Graphics | g | ||
| ) |
Returns the font metrics for the styled font.
| font | the styled font |
| g | the graphics to use |
Definition at line 126 of file SyntaxStyle.java.
References net.sf.gridarta.textedit.textarea.SyntaxStyle.fontMetrics, and net.sf.gridarta.textedit.textarea.SyntaxStyle.updateStyledFont().
Referenced by net.sf.gridarta.textedit.textarea.TextAreaPainter.offsetToX2(), and net.sf.gridarta.textedit.textarea.TextAreaPainter.xToOffset().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Returns the specified font, but with the style's bold and italic flags applied.
| font | the specified font |
Definition at line 111 of file SyntaxStyle.java.
References net.sf.gridarta.textedit.textarea.SyntaxStyle.lastStyledFont, and net.sf.gridarta.textedit.textarea.SyntaxStyle.updateStyledFont().
Referenced by net.sf.gridarta.textedit.textarea.SyntaxStyle.setGraphicsFlags().
Here is the call graph for this function:
Here is the caller graph for this function:| boolean net.sf.gridarta.textedit.textarea.SyntaxStyle.isBold | ( | ) |
Returns.
if boldface is enabled.
Definition at line 101 of file SyntaxStyle.java.
References net.sf.gridarta.textedit.textarea.SyntaxStyle.bold.
| boolean net.sf.gridarta.textedit.textarea.SyntaxStyle.isItalic | ( | ) |
Returns.
if italics is enabled.
Definition at line 93 of file SyntaxStyle.java.
References net.sf.gridarta.textedit.textarea.SyntaxStyle.italic.
| boolean net.sf.gridarta.textedit.textarea.SyntaxStyle.isPlain | ( | ) |
Returns.
if no font styles are enabled.
Definition at line 85 of file SyntaxStyle.java.
References net.sf.gridarta.textedit.textarea.SyntaxStyle.italic.
| void net.sf.gridarta.textedit.textarea.SyntaxStyle.setGraphicsFlags | ( | final Graphics | gfx, |
| final Font | font | ||
| ) |
Sets the text color and font of the specified graphics context to that specified in this style.
| gfx | the graphics context that should be modified |
| font | the font to add the styles to |
Definition at line 145 of file SyntaxStyle.java.
References net.sf.gridarta.textedit.textarea.SyntaxStyle.getStyledFont().
Referenced by net.sf.gridarta.textedit.textarea.TextAreaPainter.paintLine(), and net.sf.gridarta.textedit.textarea.SyntaxUtilities.paintSyntaxLine().
Here is the call graph for this function:
Here is the caller graph for this function:| String net.sf.gridarta.textedit.textarea.SyntaxStyle.toString | ( | ) |
Definition at line 166 of file SyntaxStyle.java.
|
private |
Update lastFont and lastStyledFont for the given font.
Resets fontMetrics to
if the font has changed.
| font | the font to use |
Definition at line 155 of file SyntaxStyle.java.
Referenced by net.sf.gridarta.textedit.textarea.SyntaxStyle.getFontMetrics(), and net.sf.gridarta.textedit.textarea.SyntaxStyle.getStyledFont().
Here is the caller graph for this function:
|
private |
Whether the text should be bold.
Definition at line 40 of file SyntaxStyle.java.
Referenced by net.sf.gridarta.textedit.textarea.SyntaxStyle.isBold(), and net.sf.gridarta.textedit.textarea.SyntaxStyle.SyntaxStyle().
|
private |
The text color.
Definition at line 30 of file SyntaxStyle.java.
Referenced by net.sf.gridarta.textedit.textarea.SyntaxStyle.getColor(), and net.sf.gridarta.textedit.textarea.SyntaxStyle.SyntaxStyle().
|
private |
The font metrics for lastStyledFont.
May be
if not yet known.
Definition at line 59 of file SyntaxStyle.java.
Referenced by net.sf.gridarta.textedit.textarea.SyntaxStyle.getFontMetrics().
|
private |
Whether the text should be italics.
Definition at line 35 of file SyntaxStyle.java.
Referenced by net.sf.gridarta.textedit.textarea.SyntaxStyle.isItalic(), net.sf.gridarta.textedit.textarea.SyntaxStyle.isPlain(), and net.sf.gridarta.textedit.textarea.SyntaxStyle.SyntaxStyle().
|
private |
The base font used to calculate lastStyledFont.
May be
if unset.
Definition at line 46 of file SyntaxStyle.java.
|
private |
The font lastFont with applied italics and bold settings.
May be
if unset.
Definition at line 52 of file SyntaxStyle.java.
Referenced by net.sf.gridarta.textedit.textarea.SyntaxStyle.getStyledFont().