jsyntaxpane
Class SyntaxStyle
java.lang.Object
jsyntaxpane.SyntaxStyle
public final class SyntaxStyle
- extends java.lang.Object
This class represents the Style for a TokenType. This class is responsible
for actually drawing a Token on the View.
- Author:
- Ayman Al-Sairafi
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SyntaxStyle
public SyntaxStyle()
SyntaxStyle
public SyntaxStyle(java.awt.Color color,
boolean bold,
boolean italic)
SyntaxStyle
public SyntaxStyle(java.awt.Color color,
int fontStyle)
SyntaxStyle
public SyntaxStyle(java.lang.String str)
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: