com.bluemarsh.jswat.view
Class JavaDrawLayer

java.lang.Object
  |
  +--com.bluemarsh.jswat.view.BasicDrawLayer
        |
        +--com.bluemarsh.jswat.view.JavaDrawLayer
All Implemented Interfaces:
DrawLayer

public class JavaDrawLayer
extends BasicDrawLayer

JavaDrawLayer is responsible for syntax colorizing Java source code.

Author:
Nathan Fiedler

Field Summary
protected static java.awt.Color characterColor
          The color for drawing characters.
protected static java.awt.Color commentColor
          The color for drawing comments.
protected static boolean DEBUG
          Turn on to enable extra debugging.
protected static java.awt.Color identifierColor
          The color for drawing identifiers.
protected static java.awt.Color keywordColor
          The color for drawing keywords.
protected static java.awt.Color literalColor
          The color for drawing literals.
protected static java.awt.Color numberColor
          The color for drawing numbers.
protected static java.awt.Color primitiveColor
          The color for drawing primitives.
protected static java.awt.Color stringColor
          The color for drawing strings.
protected  com.bluemarsh.adt.SkipList tokenInfo
          List of token info objects.
 
Fields inherited from class com.bluemarsh.jswat.view.BasicDrawLayer
active, extendsEOL
 
Fields inherited from interface com.bluemarsh.jswat.view.DrawLayer
PRIORITY_COLORIZER, PRIORITY_HIGHEST, PRIORITY_LOWEST, PRIORITY_SELECTION, PRIORITY_STEPPING
 
Constructor Summary
JavaDrawLayer()
           
 
Method Summary
 int updateContext(DrawContext ctx, int offset)
          Update the draw context by setting colors, fonts and possibly other draw properties.
 
Methods inherited from class com.bluemarsh.jswat.view.BasicDrawLayer
extendsEOL, isActive, setExtendsEOL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

characterColor

protected static final java.awt.Color characterColor
The color for drawing characters.

commentColor

protected static final java.awt.Color commentColor
The color for drawing comments.

identifierColor

protected static final java.awt.Color identifierColor
The color for drawing identifiers.

keywordColor

protected static final java.awt.Color keywordColor
The color for drawing keywords.

literalColor

protected static final java.awt.Color literalColor
The color for drawing literals.

numberColor

protected static final java.awt.Color numberColor
The color for drawing numbers.

primitiveColor

protected static final java.awt.Color primitiveColor
The color for drawing primitives.

stringColor

protected static final java.awt.Color stringColor
The color for drawing strings.

DEBUG

protected static final boolean DEBUG
Turn on to enable extra debugging.

tokenInfo

protected com.bluemarsh.adt.SkipList tokenInfo
List of token info objects.
Constructor Detail

JavaDrawLayer

public JavaDrawLayer()
Method Detail

updateContext

public int updateContext(DrawContext ctx,
                         int offset)
Update the draw context by setting colors, fonts and possibly other draw properties. After making the changes, the draw layer should return of the offset at which it would like to update the context again. This is an efficiency heuristic.
Overrides:
updateContext in class BasicDrawLayer
Parameters:
ctx - draw context.
offset - offset into character buffer indicating where drawing is presently taking place.
Returns:
offset into character buffer at which this draw layer would like to update the draw context again. In other words, how long this updated context is valid for in terms of characters in the buffer.