aplp.TextAreaPainter Class Reference

List of all members.

Public Member Functions

 TextAreaPainter (JEditTextArea textArea, TextAreaDefaults defaults)
final SyntaxStyle[] getStyles ()
final void setStyles (SyntaxStyle[] styles)
final Color getCaretColor ()
final void setCaretColor (Color caretColor)
final Color getSelectionColor ()
final void setSelectionColor (Color selectionColor)
final Color getLineHighlightColor ()
final void setLineHighlightColor (Color lineHighlightColor)
final boolean isLineHighlightEnabled ()
final void setLineHighlightEnabled (boolean lineHighlight)
final Color getBracketHighlightColor ()
final void setBracketHighlightColor (Color bracketHighlightColor)
final boolean isBracketHighlightEnabled ()
final void setBracketHighlightEnabled (boolean bracketHighlight)
final boolean isBlockCaretEnabled ()
final void setBlockCaretEnabled (boolean blockCaret)
final Color getEOLMarkerColor ()
final void setEOLMarkerColor (Color eolMarkerColor)
final boolean getEOLMarkersPainted ()
final void setEOLMarkersPainted (boolean eolMarkers)
boolean getInvalidLinesPainted ()
void setInvalidLinesPainted (boolean paintInvalid)
void addCustomHighlight (Highlight highlight)
String getToolTipText (MouseEvent evt)
FontMetrics getFontMetrics ()
void setFont (Font font)
void paint (Graphics gfx)
final void invalidateLine (int line)
final void invalidateLineRange (int firstLine, int lastLine)
final void invalidateSelectedLines ()
float nextTabStop (float x, int tabOffset)
Dimension getPreferredSize ()
Dimension getMinimumSize ()

Protected Member Functions

void paintLine (Graphics gfx, TokenMarker tokenMarker, int line, int x)
void paintPlainLine (Graphics gfx, int line, Font defaultFont, Color defaultColor, int x, int y)
void paintSyntaxLine (Graphics gfx, TokenMarker tokenMarker, int line, Font defaultFont, Color defaultColor, int x, int y)
void paintHighlight (Graphics gfx, int line, int y)
void paintLineHighlight (Graphics gfx, int line, int y)
void paintBracketHighlight (Graphics gfx, int line, int y)
void paintCaret (Graphics gfx, int line, int y)

Protected Attributes

JEditTextArea textArea
SyntaxStyle[] styles
Color caretColor
Color selectionColor
Color lineHighlightColor
Color bracketHighlightColor
Color eolMarkerColor
boolean blockCaret
boolean lineHighlight
boolean bracketHighlight
boolean paintInvalid
boolean eolMarkers
int cols
int rows
int tabSize
FontMetrics fm
Highlight highlights

Package Attributes

int currentLineIndex
Token currentLineTokens
Segment currentLine

Static Private Attributes

static final long serialVersionUID = 8455073142089642026L

Classes

interface  Highlight

Detailed Description

The text area repaint manager. It performs double buffering and paints lines of text.

Author:
Slava Pestov
Version:
Id
TextAreaPainter.java,v 1.1 2004/09/14 10:58:06 cvs-3apl Exp


Constructor & Destructor Documentation

aplp.TextAreaPainter.TextAreaPainter JEditTextArea  textArea,
TextAreaDefaults  defaults
 

Creates a new repaint manager. This should be not be called directly.


Member Function Documentation

void aplp.TextAreaPainter.addCustomHighlight Highlight  highlight  ) 
 

Adds a custom highlight painter.

Parameters:
highlight The highlight

final Color aplp.TextAreaPainter.getBracketHighlightColor  ) 
 

Returns the bracket highlight color.

final Color aplp.TextAreaPainter.getCaretColor  ) 
 

Returns the caret color.

final Color aplp.TextAreaPainter.getEOLMarkerColor  ) 
 

Returns the EOL marker color.

final boolean aplp.TextAreaPainter.getEOLMarkersPainted  ) 
 

Returns true if EOL markers are drawn, false otherwise.

FontMetrics aplp.TextAreaPainter.getFontMetrics  ) 
 

Returns the font metrics used by this component.

boolean aplp.TextAreaPainter.getInvalidLinesPainted  ) 
 

Returns true if invalid lines are painted as red tildes (~), false otherwise.

final Color aplp.TextAreaPainter.getLineHighlightColor  ) 
 

Returns the line highlight color.

Dimension aplp.TextAreaPainter.getMinimumSize  ) 
 

Returns the painter's minimum size.

Dimension aplp.TextAreaPainter.getPreferredSize  ) 
 

Returns the painter's preferred size.

final Color aplp.TextAreaPainter.getSelectionColor  ) 
 

Returns the selection color.

final SyntaxStyle [] aplp.TextAreaPainter.getStyles  ) 
 

Returns the syntax styles used to paint colorized text. Entry n will be used to paint tokens with id = n.

See also:
org.gjt.sp.jedit.syntax.Token

String aplp.TextAreaPainter.getToolTipText MouseEvent  evt  ) 
 

Returns the tool tip to display at the specified location.

Parameters:
evt The mouse event

final void aplp.TextAreaPainter.invalidateLine int  line  ) 
 

Marks a line as needing a repaint.

Parameters:
line The line to invalidate

final void aplp.TextAreaPainter.invalidateLineRange int  firstLine,
int  lastLine
 

Marks a range of lines as needing a repaint.

Parameters:
firstLine The first line to invalidate
lastLine The last line to invalidate

final void aplp.TextAreaPainter.invalidateSelectedLines  ) 
 

Repaints the lines containing the selection.

final boolean aplp.TextAreaPainter.isBlockCaretEnabled  ) 
 

Returns true if the caret should be drawn as a block, false otherwise.

final boolean aplp.TextAreaPainter.isBracketHighlightEnabled  ) 
 

Returns true if bracket highlighting is enabled, false otherwise. When bracket highlighting is enabled, the bracket matching the one before the caret (if any) is highlighted.

final boolean aplp.TextAreaPainter.isLineHighlightEnabled  ) 
 

Returns true if line highlight is enabled, false otherwise.

float aplp.TextAreaPainter.nextTabStop float  x,
int  tabOffset
 

Implementation of TabExpander interface. Returns next tab stop after a specified point.

Parameters:
x The x co-ordinate
tabOffset Ignored
Returns:
The next tab stop after x

void aplp.TextAreaPainter.paint Graphics  gfx  ) 
 

Repaints the text.

Parameters:
g The graphics context

void aplp.TextAreaPainter.paintBracketHighlight Graphics  gfx,
int  line,
int  y
[protected]
 

void aplp.TextAreaPainter.paintCaret Graphics  gfx,
int  line,
int  y
[protected]
 

void aplp.TextAreaPainter.paintHighlight Graphics  gfx,
int  line,
int  y
[protected]
 

void aplp.TextAreaPainter.paintLine Graphics  gfx,
TokenMarker  tokenMarker,
int  line,
int  x
[protected]
 

void aplp.TextAreaPainter.paintLineHighlight Graphics  gfx,
int  line,
int  y
[protected]
 

void aplp.TextAreaPainter.paintPlainLine Graphics  gfx,
int  line,
Font  defaultFont,
Color  defaultColor,
int  x,
int  y
[protected]
 

void aplp.TextAreaPainter.paintSyntaxLine Graphics  gfx,
TokenMarker  tokenMarker,
int  line,
Font  defaultFont,
Color  defaultColor,
int  x,
int  y
[protected]
 

final void aplp.TextAreaPainter.setBlockCaretEnabled boolean  blockCaret  ) 
 

Sets if the caret should be drawn as a block, false otherwise.

Parameters:
blockCaret True if the caret should be drawn as a block, false otherwise.

final void aplp.TextAreaPainter.setBracketHighlightColor Color  bracketHighlightColor  ) 
 

Sets the bracket highlight color.

Parameters:
bracketHighlightColor The bracket highlight color

final void aplp.TextAreaPainter.setBracketHighlightEnabled boolean  bracketHighlight  ) 
 

Enables or disables bracket highlighting. When bracket highlighting is enabled, the bracket matching the one before the caret (if any) is highlighted.

Parameters:
bracketHighlight True if bracket highlighting should be enabled, false otherwise

final void aplp.TextAreaPainter.setCaretColor Color  caretColor  ) 
 

Sets the caret color.

Parameters:
caretColor The caret color

final void aplp.TextAreaPainter.setEOLMarkerColor Color  eolMarkerColor  ) 
 

Sets the EOL marker color.

Parameters:
eolMarkerColor The EOL marker color

final void aplp.TextAreaPainter.setEOLMarkersPainted boolean  eolMarkers  ) 
 

Sets if EOL markers are to be drawn.

Parameters:
eolMarkers True if EOL markers should be drawn, false otherwise

void aplp.TextAreaPainter.setFont Font  font  ) 
 

Sets the font for this component. This is overridden to update the cached font metrics and to recalculate which lines are visible.

Parameters:
font The font

void aplp.TextAreaPainter.setInvalidLinesPainted boolean  paintInvalid  ) 
 

Sets if invalid lines are to be painted as red tildes.

Parameters:
paintInvalid True if invalid lines should be drawn, false otherwise

final void aplp.TextAreaPainter.setLineHighlightColor Color  lineHighlightColor  ) 
 

Sets the line highlight color.

Parameters:
lineHighlightColor The line highlight color

final void aplp.TextAreaPainter.setLineHighlightEnabled boolean  lineHighlight  ) 
 

Enables or disables current line highlighting.

Parameters:
lineHighlight True if current line highlight should be enabled, false otherwise

final void aplp.TextAreaPainter.setSelectionColor Color  selectionColor  ) 
 

Sets the selection color.

Parameters:
selectionColor The selection color

final void aplp.TextAreaPainter.setStyles SyntaxStyle[]  styles  ) 
 

Sets the syntax styles used to paint colorized text. Entry n will be used to paint tokens with id = n.

Parameters:
styles The syntax styles
See also:
org.gjt.sp.jedit.syntax.Token


Member Data Documentation

boolean aplp.TextAreaPainter.blockCaret [protected]
 

boolean aplp.TextAreaPainter.bracketHighlight [protected]
 

Color aplp.TextAreaPainter.bracketHighlightColor [protected]
 

Color aplp.TextAreaPainter.caretColor [protected]
 

int aplp.TextAreaPainter.cols [protected]
 

Segment aplp.TextAreaPainter.currentLine [package]
 

int aplp.TextAreaPainter.currentLineIndex [package]
 

Token aplp.TextAreaPainter.currentLineTokens [package]
 

Color aplp.TextAreaPainter.eolMarkerColor [protected]
 

boolean aplp.TextAreaPainter.eolMarkers [protected]
 

FontMetrics aplp.TextAreaPainter.fm [protected]
 

Highlight aplp.TextAreaPainter.highlights [protected]
 

boolean aplp.TextAreaPainter.lineHighlight [protected]
 

Color aplp.TextAreaPainter.lineHighlightColor [protected]
 

boolean aplp.TextAreaPainter.paintInvalid [protected]
 

int aplp.TextAreaPainter.rows [protected]
 

Color aplp.TextAreaPainter.selectionColor [protected]
 

final long aplp.TextAreaPainter.serialVersionUID = 8455073142089642026L [static, private]
 

SyntaxStyle [] aplp.TextAreaPainter.styles [protected]
 

int aplp.TextAreaPainter.tabSize [protected]
 

JEditTextArea aplp.TextAreaPainter.textArea [protected]
 


The documentation for this class was generated from the following file:
Generated on Mon Dec 12 15:07:18 2005 for 3APL by  doxygen 1.4.5