|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsyntaxhighlight.Theme
public class Theme
Theme for the SyntaxHighlighterPane and
JTextComponentRowHeader.
To make a new theme, either extending this class or initiate this class and
set parameters using setters. For the default value, find the comment of the
constructor.
| Field Summary | |
|---|---|
protected java.awt.Color |
background
The background color of the script text area. |
protected java.awt.Font |
font
The font of the script text. |
protected java.awt.Color |
gutterBorderColor
The color of the border that joint the gutter and the script text area. |
protected int |
gutterBorderWidth
The width of the border that joint the gutter and the script text area. |
protected java.awt.Color |
gutterText
The color of the gutter text. |
protected java.awt.Font |
gutterTextFont
The font of the gutter text. |
protected int |
gutterTextPaddingLeft
The minimum padding from 'the leftmost of the line number text' to 'the left margin'. |
protected int |
gutterTextPaddingRight
The minimum padding from 'the rightmost of the line number text' to 'the right margin' (not to the gutter border). |
protected java.awt.Color |
highlightedBackground
The background color of the highlighted line of script text. |
protected Style |
plain
The default style. |
protected java.util.Map<java.lang.String,Style> |
styles
The styles of this theme. |
| Constructor Summary | |
|---|---|
Theme()
Constructor. |
|
| Method Summary | |
|---|---|
Style |
addStyle(java.lang.String styleKey,
Style style)
Add style. |
void |
clearStyles()
Clear all styles. |
Theme |
clone()
|
java.awt.Color |
getBackground()
The background color of the script text area. |
java.awt.Font |
getFont()
The font of the script text. |
java.awt.Color |
getGutterBorderColor()
The color of the border that joint the gutter and the script text area. |
int |
getGutterBorderWidth()
The width of the border that joint the gutter and the script text area. |
java.awt.Color |
getGutterText()
The color of the gutter text. |
java.awt.Font |
getGutterTextFont()
The font of the gutter text. |
int |
getGutterTextPaddingLeft()
The minimum padding from 'the leftmost of the line number text' to 'the left margin'. |
int |
getGutterTextPaddingRight()
The minimum padding from 'the rightmost of the line number text' to 'the right margin' (not to the gutter border). |
java.awt.Color |
getHighlightedBackground()
The background color of the highlighted line of script text. |
Style |
getPlain()
Get the default style. |
Style |
getStyle(java.lang.String key)
Get the style by keyword. |
java.util.Map<java.lang.String,Style> |
getStyles()
Get all styles. |
javax.swing.text.SimpleAttributeSet |
getStylesAttributeSet(java.lang.String styleKeys)
Get the AttributeSet of styleKeys. |
Style |
removeStyle(java.lang.String styleKey)
Remove style by keyword. |
void |
setBackground(java.awt.Color background)
The background color of the script text area. |
void |
setFont(java.awt.Font font)
The font of the script text. |
void |
setGutterBorderColor(java.awt.Color gutterBorderColor)
The color of the border that joint the gutter and the script text area. |
void |
setGutterBorderWidth(int gutterBorderWidth)
The width of the border that joint the gutter and the script text area. |
void |
setGutterText(java.awt.Color gutterText)
The color of the gutter text. |
void |
setGutterTextFont(java.awt.Font gutterTextFont)
The font of the gutter text. |
void |
setGutterTextPaddingLeft(int gutterTextPaddingLeft)
The minimum padding from 'the leftmost of the line number text' to 'the left margin'. |
void |
setGutterTextPaddingRight(int gutterTextPaddingRight)
The minimum padding from 'the rightmost of the line number text' to 'the right margin' (not to the gutter border). |
void |
setHighlightedBackground(java.awt.Color highlightedBackground)
The background color of the highlighted line of script text. |
void |
setPlain(Style plain)
Set the default style. |
void |
setTheme(JTextComponentRowHeader rowHeader)
Apply the theme to the row header panel. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected java.awt.Font font
protected java.awt.Color background
protected java.awt.Color highlightedBackground
protected java.awt.Color gutterText
protected java.awt.Color gutterBorderColor
protected int gutterBorderWidth
protected java.awt.Font gutterTextFont
protected int gutterTextPaddingLeft
protected int gutterTextPaddingRight
protected Style plain
getStyle(String)
not exist, this will be returned.
protected java.util.Map<java.lang.String,Style> styles
| Constructor Detail |
|---|
public Theme()
Default value:
| Method Detail |
|---|
public void setTheme(JTextComponentRowHeader rowHeader)
rowHeader - the row header to apply the theme onpublic void setPlain(Style plain)
plain - the stylepublic Style getPlain()
public javax.swing.text.SimpleAttributeSet getStylesAttributeSet(java.lang.String styleKeys)
AttributeSet of styleKeys. For more than one
styles, separate the styles by space, e.g. 'plain comments'.
styleKeys - the style keys with keys separated by space
AttributeSet
public Style addStyle(java.lang.String styleKey,
Style style)
styleKey - the keyword of the stylestyle - the style
Map.put(Object, Object)public Style removeStyle(java.lang.String styleKey)
styleKey - the keyword of the style
Map.remove(Object)public Style getStyle(java.lang.String key)
key - the keyword
syntaxhighlighter.theme.Style related to the
key; if the style related to the key not exist, the
style of 'plain' will return.public java.util.Map<java.lang.String,Style> getStyles()
public void clearStyles()
public java.awt.Font getFont()
public void setFont(java.awt.Font font)
font - the fontpublic java.awt.Color getBackground()
public void setBackground(java.awt.Color background)
background - the colorpublic java.awt.Color getHighlightedBackground()
public void setHighlightedBackground(java.awt.Color highlightedBackground)
highlightedBackground - the colorpublic java.awt.Color getGutterText()
public void setGutterText(java.awt.Color gutterText)
gutterText - the colorpublic java.awt.Color getGutterBorderColor()
public void setGutterBorderColor(java.awt.Color gutterBorderColor)
gutterBorderColor - the colorpublic int getGutterBorderWidth()
public void setGutterBorderWidth(int gutterBorderWidth)
gutterBorderWidth - in pixelpublic java.awt.Font getGutterTextFont()
public void setGutterTextFont(java.awt.Font gutterTextFont)
gutterTextFont - the fontpublic int getGutterTextPaddingLeft()
public void setGutterTextPaddingLeft(int gutterTextPaddingLeft)
gutterTextPaddingLeft - in pixelpublic int getGutterTextPaddingRight()
public void setGutterTextPaddingRight(int gutterTextPaddingRight)
gutterTextPaddingRight - in pixelpublic Theme clone()
clone in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||