Package jsyntaxpane
Class SyntaxStyle
- java.lang.Object
-
- jsyntaxpane.SyntaxStyle
-
public final class SyntaxStyle extends java.lang.ObjectThis class represents the Style for a TokenType. This class is responsible for actually drawing a Token on the View.
-
-
Constructor Summary
Constructors Constructor Description SyntaxStyle()SyntaxStyle(java.awt.Color color, boolean bold, boolean italic)SyntaxStyle(java.awt.Color color, int fontStyle)SyntaxStyle(java.lang.String str)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intdrawText(javax.swing.text.Segment segment, int x, int y, java.awt.Graphics graphics, javax.swing.text.TabExpander e, int startOffset)Draw text.java.awt.ColorgetColor()java.lang.StringgetColorString()intgetFontStyle()booleanisBold()java.lang.BooleanisItalic()voidsetBold(java.lang.Boolean bold)voidsetColorString(java.lang.String color)voidsetItalic(java.lang.Boolean italic)
-
-
-
Method Detail
-
isBold
public boolean isBold()
-
setBold
public void setBold(java.lang.Boolean bold)
-
getColorString
public java.lang.String getColorString()
-
setColorString
public void setColorString(java.lang.String color)
-
isItalic
public java.lang.Boolean isItalic()
-
setItalic
public void setItalic(java.lang.Boolean italic)
-
getFontStyle
public int getFontStyle()
-
getColor
public java.awt.Color getColor()
-
drawText
public int drawText(javax.swing.text.Segment segment, int x, int y, java.awt.Graphics graphics, javax.swing.text.TabExpander e, int startOffset)Draw text. This can directly call the Utilities.drawTabbedText. Sub-classes can override this method to provide any other decorations.- Parameters:
segment- - the source of the textx- - the X origin >= 0y- - the Y origin >= 0graphics- - the graphics contexte- - how to expand the tabs. If this value is null, tabs will be expanded as a space character.startOffset- - starting offset of the text in the document >= 0- Returns:
-
-