All Packages Class Hierarchy This Package Previous Next Index
Class jp.kyasu.awt.util.SyntaxColoringModel
java.lang.Object
|
+----jp.kyasu.awt.DefaultTextModel
|
+----jp.kyasu.awt.DefaultTextEditModel
|
+----jp.kyasu.awt.util.SyntaxColoringModel
- public class SyntaxColoringModel
- extends DefaultTextEditModel
The SyntaxColoringModel
class implements the
TextEditModel
interface. The SyntaxColoringModel
object hilights the syntax of the text representing a program written in
a computer language.
- Version:
- 13 Aug 1998
- Author:
- Kazuki YASUMATSU
- See Also:
- LanguageTokenizer, LanguageTokenizerFactory
-
SyntaxColoringModel(RichText, LanguageTokenizerFactory)
- Constructs a model with the specified rich text and factory of the
language tokenizer.
-
SyntaxColoringModel(RichText, LanguageTokenizerFactory, Font)
- Constructs a model with the specified rich text, factory of the
language tokenizer, and base font.
-
getBaseFont()
- Returns the base font of this model.
-
getCommentColor()
- Returns the font color for the comment tokens.
-
getCommentStyle()
- Returns the font style for the comment tokens.
-
getConstantColor()
- Returns the font color for the constant tokens.
-
getConstantStyle()
- Returns the font style for the constant tokens.
-
getKeywordColor()
- Returns the font color for the keyword tokens.
-
getKeywordStyle()
- Returns the font style for the keyword tokens.
-
getNormalColor()
- Returns the font color for the normal tokens.
-
getNormalStyle()
- Returns the font style for the normal tokens.
-
isSyntaxColoringEnabled()
- Tests if the syntax coloring is enabled.
-
modifyTextStyle(int, int, TextStyleModifier)
-
-
replace(int, int, Text)
- Replaces the specified range of the rich text of this model with
the specified replacement text object.
-
setBaseFont(Font)
- Sets the base font of this model.
-
setCommentColor(Color)
- Sets the font color for the comment tokens.
-
setCommentStyle(int)
- Sets the font style for the comment tokens.
-
setCommentStyleAndColor(int, Color)
- Sets the font style and color for the comment tokens.
-
setConstantColor(Color)
- Sets the font color for the constant tokens.
-
setConstantStyle(int)
- Sets the font style for the constant tokens.
-
setConstantStyleAndColor(int, Color)
- Sets the font style and color for the constant tokens.
-
setKeywordColor(Color)
- Sets the font color for the keyword tokens.
-
setKeywordStyle(int)
- Sets the font style for the keyword tokens.
-
setKeywordStyleAndColor(int, Color)
- Sets the font style and color for the keyword tokens.
-
setNormalColor(Color)
- Sets the font color for the normal tokens.
-
setNormalStyle(int)
- Sets the font style for the normal tokens.
-
setNormalStyleAndColor(int, Color)
- Sets the font style and color for the normal tokens.
-
setRichText(RichText)
- Sets the rich text of this model to be the specified rich text.
-
setSyntaxColoringEnabled(boolean)
- Enables or disables the syntax coloring.
-
setTextStyle(int, int, TextStyle)
-
SyntaxColoringModel
public SyntaxColoringModel(RichText richText,
LanguageTokenizerFactory factory)
- Constructs a model with the specified rich text and factory of the
language tokenizer.
- Parameters:
- richText - the rich text.
- factory - the factory of the language tokenizer.
SyntaxColoringModel
public SyntaxColoringModel(RichText richText,
LanguageTokenizerFactory factory,
Font baseFont)
- Constructs a model with the specified rich text, factory of the
language tokenizer, and base font.
- Parameters:
- richText - the rich text.
- factory - the factory of the language tokenizer.
- baseFont - the base font of the model.
isSyntaxColoringEnabled
public boolean isSyntaxColoringEnabled()
- Tests if the syntax coloring is enabled.
setSyntaxColoringEnabled
public void setSyntaxColoringEnabled(boolean b)
- Enables or disables the syntax coloring.
getNormalStyle
public int getNormalStyle()
- Returns the font style for the normal tokens.
getNormalColor
public Color getNormalColor()
- Returns the font color for the normal tokens.
getKeywordStyle
public int getKeywordStyle()
- Returns the font style for the keyword tokens.
getKeywordColor
public Color getKeywordColor()
- Returns the font color for the keyword tokens.
getConstantStyle
public int getConstantStyle()
- Returns the font style for the constant tokens.
getConstantColor
public Color getConstantColor()
- Returns the font color for the constant tokens.
getCommentStyle
public int getCommentStyle()
- Returns the font style for the comment tokens.
getCommentColor
public Color getCommentColor()
- Returns the font color for the comment tokens.
setNormalStyle
public void setNormalStyle(int fontStyle)
- Sets the font style for the normal tokens.
setNormalColor
public void setNormalColor(Color color)
- Sets the font color for the normal tokens.
setNormalStyleAndColor
public void setNormalStyleAndColor(int fontStyle,
Color color)
- Sets the font style and color for the normal tokens.
setKeywordStyle
public void setKeywordStyle(int fontStyle)
- Sets the font style for the keyword tokens.
setKeywordColor
public void setKeywordColor(Color color)
- Sets the font color for the keyword tokens.
setKeywordStyleAndColor
public void setKeywordStyleAndColor(int fontStyle,
Color color)
- Sets the font style and color for the keyword tokens.
setConstantStyle
public void setConstantStyle(int fontStyle)
- Sets the font style for the constant tokens.
setConstantColor
public void setConstantColor(Color color)
- Sets the font color for the constant tokens.
setConstantStyleAndColor
public void setConstantStyleAndColor(int fontStyle,
Color color)
- Sets the font style and color for the constant tokens.
setCommentStyle
public void setCommentStyle(int fontStyle)
- Sets the font style for the comment tokens.
setCommentColor
public void setCommentColor(Color color)
- Sets the font color for the comment tokens.
setCommentStyleAndColor
public void setCommentStyleAndColor(int fontStyle,
Color color)
- Sets the font style and color for the comment tokens.
getBaseFont
public Font getBaseFont()
- Returns the base font of this model.
setBaseFont
public void setBaseFont(Font baseFont)
- Sets the base font of this model.
setRichText
public synchronized void setRichText(RichText richText)
- Sets the rich text of this model to be the specified rich text.
- Parameters:
- richText - the rich text.
- Overrides:
- setRichText in class DefaultTextEditModel
replace
public synchronized Undo replace(int repBegin,
int repEnd,
Text rep)
- Replaces the specified range of the rich text of this model with
the specified replacement text object.
- Parameters:
- repBegin - the beginning text position to replace, inclusive.
- repEnd - the ending text position to replace, exclusive.
- rep - a replacement
Text
object.
- Returns:
- the undo object for this operation, or
null
if
the undo is not supported.
- Overrides:
- replace in class DefaultTextEditModel
setTextStyle
public Undo setTextStyle(int begin,
int end,
TextStyle textStyle)
- Overrides:
- setTextStyle in class DefaultTextEditModel
modifyTextStyle
public Undo modifyTextStyle(int begin,
int end,
TextStyleModifier modifier)
- Overrides:
- modifyTextStyle in class DefaultTextEditModel
All Packages Class Hierarchy This Package Previous Next Index