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

Constructor Index

 o SyntaxColoringModel(RichText, LanguageTokenizerFactory)
Constructs a model with the specified rich text and factory of the language tokenizer.
 o SyntaxColoringModel(RichText, LanguageTokenizerFactory, Font)
Constructs a model with the specified rich text, factory of the language tokenizer, and base font.

Method Index

 o getBaseFont()
Returns the base font of this model.
 o getCommentColor()
Returns the font color for the comment tokens.
 o getCommentStyle()
Returns the font style for the comment tokens.
 o getConstantColor()
Returns the font color for the constant tokens.
 o getConstantStyle()
Returns the font style for the constant tokens.
 o getKeywordColor()
Returns the font color for the keyword tokens.
 o getKeywordStyle()
Returns the font style for the keyword tokens.
 o getNormalColor()
Returns the font color for the normal tokens.
 o getNormalStyle()
Returns the font style for the normal tokens.
 o isSyntaxColoringEnabled()
Tests if the syntax coloring is enabled.
 o modifyTextStyle(int, int, TextStyleModifier)
 o replace(int, int, Text)
Replaces the specified range of the rich text of this model with the specified replacement text object.
 o setBaseFont(Font)
Sets the base font of this model.
 o setCommentColor(Color)
Sets the font color for the comment tokens.
 o setCommentStyle(int)
Sets the font style for the comment tokens.
 o setCommentStyleAndColor(int, Color)
Sets the font style and color for the comment tokens.
 o setConstantColor(Color)
Sets the font color for the constant tokens.
 o setConstantStyle(int)
Sets the font style for the constant tokens.
 o setConstantStyleAndColor(int, Color)
Sets the font style and color for the constant tokens.
 o setKeywordColor(Color)
Sets the font color for the keyword tokens.
 o setKeywordStyle(int)
Sets the font style for the keyword tokens.
 o setKeywordStyleAndColor(int, Color)
Sets the font style and color for the keyword tokens.
 o setNormalColor(Color)
Sets the font color for the normal tokens.
 o setNormalStyle(int)
Sets the font style for the normal tokens.
 o setNormalStyleAndColor(int, Color)
Sets the font style and color for the normal tokens.
 o setRichText(RichText)
Sets the rich text of this model to be the specified rich text.
 o setSyntaxColoringEnabled(boolean)
Enables or disables the syntax coloring.
 o setTextStyle(int, int, TextStyle)

Constructors

 o 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.
 o 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.

Methods

 o isSyntaxColoringEnabled
 public boolean isSyntaxColoringEnabled()
Tests if the syntax coloring is enabled.

 o setSyntaxColoringEnabled
 public void setSyntaxColoringEnabled(boolean b)
Enables or disables the syntax coloring.

 o getNormalStyle
 public int getNormalStyle()
Returns the font style for the normal tokens.

 o getNormalColor
 public Color getNormalColor()
Returns the font color for the normal tokens.

 o getKeywordStyle
 public int getKeywordStyle()
Returns the font style for the keyword tokens.

 o getKeywordColor
 public Color getKeywordColor()
Returns the font color for the keyword tokens.

 o getConstantStyle
 public int getConstantStyle()
Returns the font style for the constant tokens.

 o getConstantColor
 public Color getConstantColor()
Returns the font color for the constant tokens.

 o getCommentStyle
 public int getCommentStyle()
Returns the font style for the comment tokens.

 o getCommentColor
 public Color getCommentColor()
Returns the font color for the comment tokens.

 o setNormalStyle
 public void setNormalStyle(int fontStyle)
Sets the font style for the normal tokens.

 o setNormalColor
 public void setNormalColor(Color color)
Sets the font color for the normal tokens.

 o setNormalStyleAndColor
 public void setNormalStyleAndColor(int fontStyle,
                                    Color color)
Sets the font style and color for the normal tokens.

 o setKeywordStyle
 public void setKeywordStyle(int fontStyle)
Sets the font style for the keyword tokens.

 o setKeywordColor
 public void setKeywordColor(Color color)
Sets the font color for the keyword tokens.

 o setKeywordStyleAndColor
 public void setKeywordStyleAndColor(int fontStyle,
                                     Color color)
Sets the font style and color for the keyword tokens.

 o setConstantStyle
 public void setConstantStyle(int fontStyle)
Sets the font style for the constant tokens.

 o setConstantColor
 public void setConstantColor(Color color)
Sets the font color for the constant tokens.

 o setConstantStyleAndColor
 public void setConstantStyleAndColor(int fontStyle,
                                      Color color)
Sets the font style and color for the constant tokens.

 o setCommentStyle
 public void setCommentStyle(int fontStyle)
Sets the font style for the comment tokens.

 o setCommentColor
 public void setCommentColor(Color color)
Sets the font color for the comment tokens.

 o setCommentStyleAndColor
 public void setCommentStyleAndColor(int fontStyle,
                                     Color color)
Sets the font style and color for the comment tokens.

 o getBaseFont
 public Font getBaseFont()
Returns the base font of this model.

 o setBaseFont
 public void setBaseFont(Font baseFont)
Sets the base font of this model.

 o 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
 o 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
 o setTextStyle
 public Undo setTextStyle(int begin,
                          int end,
                          TextStyle textStyle)
Overrides:
setTextStyle in class DefaultTextEditModel
 o modifyTextStyle
 public Undo modifyTextStyle(int begin,
                             int end,
                             TextStyleModifier modifier)
Overrides:
modifyTextStyle in class DefaultTextEditModel

All Packages  Class Hierarchy  This Package  Previous  Next  Index