Package editor
Class GosuStyleContext
java.lang.Object
javax.swing.text.StyleContext
editor.GosuStyleContext
- All Implemented Interfaces:
Serializable
,AbstractDocument.AttributeContext
,ViewFactory
A collection of styles used to render gosu source.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) class
View that uses the lexical information to determine the style characteristics of the text that it renders.Nested classes/interfaces inherited from class javax.swing.text.StyleContext
StyleContext.NamedStyle, StyleContext.SmallAttributeSet
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate HashMap<AttributeSet,
Font> private int
private String
static final String
static final int
static final int
static final Integer
static final int
static final Integer
static final int
static final Integer
static final int
static final Integer
static final int
static final Integer
private static String
private static int
static final int
static final Integer
static final int
static final Integer
static final int
static final Integer
static final int
static final Integer
static final int
static final Integer
static final int
static final Integer
static final int
static final Integer
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
private static final Component
static final int
static final Integer
static final int
static final Integer
Fields inherited from class javax.swing.text.StyleContext
DEFAULT_STYLE
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a set of styles to represent gosu lexical tokens. -
Method Summary
Modifier and TypeMethodDescriptionboolean
areStylesEquivalent
(String styleName1, String styleName2) getBackground
(int code) static String
static int
getFont
(int code) Fetch the font to use for a lexical token with the given scan value.getFont
(AttributeSet attr) Fetch the font to use for a given attribute set.private Font
getFont
(AttributeSet attr, String strFamily) int
getForeground
(int code) Fetch the foreground color to use for a lexical token with the given value.getStyleForScanValue
(int code) Fetches the attribute set to use for the given scan code.void
setAttribute
(Style style, Object attr, Object value) void
setBackground
(Style style, Color colorBack) void
static void
setDefaultFontFamily
(String defFontFamily) static void
setDefaultFontSize
(int defFontSize) void
void
setFontFamily
(String strFamily) void
setFontSize
(int iSize) void
setForeground
(Style style, Color colorFore) void
void
setStrikeThrough
(Style style, boolean bStrikeThrough) void
setUnderline
(Style style, boolean bUnderline) Methods inherited from class javax.swing.text.StyleContext
addAttribute, addAttributes, addChangeListener, addStyle, createLargeAttributeSet, createSmallAttributeSet, getBackground, getChangeListeners, getCompressionThreshold, getDefaultStyleContext, getEmptySet, getFont, getFontMetrics, getForeground, getStaticAttribute, getStaticAttributeKey, getStyle, getStyleNames, readAttributes, readAttributeSet, reclaim, registerStaticAttributeKey, removeAttribute, removeAttributes, removeAttributes, removeChangeListener, removeStyle, toString, writeAttributes, writeAttributeSet
-
Field Details
-
KEY_WORD
public static final int KEY_WORD- See Also:
-
PARSE_ERROR
public static final int PARSE_ERROR- See Also:
-
DEPRECATED
public static final int DEPRECATED- See Also:
-
PARSE_WARNING
public static final int PARSE_WARNING- See Also:
-
TYPE_LITERAL
public static final int TYPE_LITERAL- See Also:
-
NESTED_TYPE_LITERAL
public static final int NESTED_TYPE_LITERAL- See Also:
-
METHOD_CALL
public static final int METHOD_CALL- See Also:
-
USES
public static final int USES- See Also:
-
DEFAULT
public static final int DEFAULT- See Also:
-
FIELD_ERROR
public static final int FIELD_ERROR- See Also:
-
FIELD_WARNING
public static final int FIELD_WARNING- See Also:
-
PACKAGE
public static final int PACKAGE- See Also:
-
PROPERTY
public static final int PROPERTY- See Also:
-
ENHANCEMENT_METHOD_CALL
public static final int ENHANCEMENT_METHOD_CALL- See Also:
-
ENHANCEMENT_PROPERTY
public static final int ENHANCEMENT_PROPERTY- See Also:
-
KEY_WORD_KEY
-
PARSE_ERROR_KEY
-
DEPRECATED_KEY
-
TYPE_LITERAL_KEY
-
NESTED_TYPE_LITERAL_KEY
-
PARSE_WARNING_KEY
-
METHOD_CALL_KEY
-
PROPERTY_KEY
-
ENHANCEMENT_METHOD_CALL_KEY
-
ENHANCEMENT_PROPERTY_KEY
-
USES_KEY
-
PACKAGE_KEY
-
FIELD_ERROR_KEY
-
FIELD_WARNING_KEY
-
DASHED
- See Also:
-
THISISSTUPID
-
g_defFontFamily
-
g_defFontSize
private static int g_defFontSize -
STYLE_EOL
- See Also:
-
STYLE_EOF
- See Also:
-
STYLE_Whitespace
- See Also:
-
STYLE_Comment
- See Also:
-
STYLE_Caret
- See Also:
-
STYLE_Number
- See Also:
-
STYLE_Integer
- See Also:
-
STYLE_Word
- See Also:
-
STYLE_Operator
- See Also:
-
STYLE_StringLiteral
- See Also:
-
STYLE_KeyWord
- See Also:
-
STYLE_ParseError
- See Also:
-
STYLE_ParseWarning
- See Also:
-
STYLE_DeprecatedMember
- See Also:
-
STYLE_TypeLiteral
- See Also:
-
STYLE_NestedTypeLiteral
- See Also:
-
STYLE_MethodCall
- See Also:
-
STYLE_Property
- See Also:
-
STYLE_EnhancementMethodCall
- See Also:
-
STYLE_EnhancementProperty
- See Also:
-
STYLE_FieldError
- See Also:
-
STYLE_FieldWarning
- See Also:
-
_strFontFamily
-
_iFontSize
private int _iFontSize -
_fontCache
-
_tokenStyles
-
-
Constructor Details
-
GosuStyleContext
public GosuStyleContext()Constructs a set of styles to represent gosu lexical tokens.
-
-
Method Details
-
setForeground
-
setBackground
-
setBold
-
setItalic
-
setUnderline
-
setStrikeThrough
-
setAttribute
-
setDefaultStyles
public void setDefaultStyles() -
setDefaultFontFamily
-
getDefaultFontFamily
-
setDefaultFontSize
public static void setDefaultFontSize(int defFontSize) -
getDefaultFontSize
public static int getDefaultFontSize() -
getForeground
Fetch the foreground color to use for a lexical token with the given value. -
getBackground
-
getFont
Fetch the font to use for a lexical token with the given scan value. -
getStyleForScanValue
Fetches the attribute set to use for the given scan code. The set is stored in a table to facilitate relatively fast access to use in conjunction with the scanner. -
getFont
Fetch the font to use for a given attribute set.- Overrides:
getFont
in classStyleContext
-
getFont
-
getFontFamily
-
getFontFamily
-
setFontFamily
-
getFontSize
public int getFontSize() -
setFontSize
public void setFontSize(int iSize) -
create
- Specified by:
create
in interfaceViewFactory
-
getStyles
-
areStylesEquivalent
-