Interface RSTAView

All Known Implementing Classes:
SyntaxView, WrappedSyntaxView

interface RSTAView
Utility methods for RSyntaxTextArea's views.
Version:
1.0
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    yForLine(Rectangle alloc, int line)
    Returns the y-coordinate of the specified line.
    int
    yForLineContaining(Rectangle alloc, int offs)
    Returns the y-coordinate of the line containing a specified offset.
  • Method Details

    • yForLine

      int yForLine(Rectangle alloc, int line) throws BadLocationException
      Returns the y-coordinate of the specified line.

      This method is quicker than using traditional modelToView(int) calls, as the entire bounding box isn't computed.

      Parameters:
      alloc - The area the text area can render into.
      line - The line number.
      Returns:
      The y-coordinate of the top of the line, or -1 if this text area doesn't yet have a positive size or the line is hidden (i.e. from folding).
      Throws:
      BadLocationException - If line isn't a valid line number for this document.
    • yForLineContaining

      int yForLineContaining(Rectangle alloc, int offs) throws BadLocationException
      Returns the y-coordinate of the line containing a specified offset.

      This method is quicker than using traditional modelToView(int) calls, as the entire bounding box isn't computed.

      Parameters:
      alloc - The area the text area can render into.
      offs - The offset info the document.
      Returns:
      The y-coordinate of the top of the offset, or -1 if this text area doesn't yet have a positive size or the line is hidden (i.e. from folding).
      Throws:
      BadLocationException - If offs isn't a valid offset into the document.