com.bluemarsh.jswat.view
Interface DrawLayer

All Known Implementing Classes:
BasicDrawLayer

public interface DrawLayer

A DrawLayer is responsible for altering the graphics context in a manner appropriate for the token that is about to be drawn.

Author:
Nathan Fiedler

Field Summary
static int PRIORITY_COLORIZER
          Draw layer priority given to the layer colorizing source code.
static int PRIORITY_HIGHEST
           
static int PRIORITY_LOWEST
           
static int PRIORITY_SELECTION
          Draw layer priority given to the layer showing text selection.
static int PRIORITY_STEPPING
          Draw layer priority given to the layer showing the current stepping line.
 
Method Summary
 boolean extendsEOL()
          Indicates that this layer wants to affect the background color beyond the end of the line of text.
 boolean isActive()
          Returns true if this draw layer wants to take part in the current painting event.
 int updateContext(DrawContext ctx, int offset)
          Update the draw context by setting colors, fonts and possibly other draw properties.
 

Field Detail

PRIORITY_LOWEST

public static final int PRIORITY_LOWEST

PRIORITY_COLORIZER

public static final int PRIORITY_COLORIZER
Draw layer priority given to the layer colorizing source code.

PRIORITY_STEPPING

public static final int PRIORITY_STEPPING
Draw layer priority given to the layer showing the current stepping line.

PRIORITY_SELECTION

public static final int PRIORITY_SELECTION
Draw layer priority given to the layer showing text selection.

PRIORITY_HIGHEST

public static final int PRIORITY_HIGHEST
Method Detail

extendsEOL

public boolean extendsEOL()
Indicates that this layer wants to affect the background color beyond the end of the line of text.
Returns:
true to extend past EOL, false otherwise.

isActive

public boolean isActive()
Returns true if this draw layer wants to take part in the current painting event.
Returns:
true if active, false otherwise.

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