Interface RSTAView

  • All Known Implementing Classes:
    SyntaxView, WrappedSyntaxView

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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      int yForLine​(java.awt.Rectangle alloc, int line)
      Returns the y-coordinate of the specified line.
      int yForLineContaining​(java.awt.Rectangle alloc, int offs)
      Returns the y-coordinate of the line containing a specified offset.
    • Method Detail

      • yForLine

        int yForLine​(java.awt.Rectangle alloc,
                     int line)
              throws javax.swing.text.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:
        javax.swing.text.BadLocationException - If line isn't a valid line number for this document.
      • yForLineContaining

        int yForLineContaining​(java.awt.Rectangle alloc,
                               int offs)
                        throws javax.swing.text.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:
        javax.swing.text.BadLocationException - If offs isn't a valid offset into the document.