Interface TextPane.Skin

  • All Known Implementing Classes:
    TerraTextPaneSkin, TextPaneSkin
    Enclosing class:
    TextPane

    public static interface TextPane.Skin
    Text pane skin interface. Text pane skins are required to implement this.
    • Method Detail

      • getInsertionPoint

        int getInsertionPoint​(int x,
                              int y)
        Returns the insertion point for a given location.
        Parameters:
        x - The X-coordinate of the location to check.
        y - The Y-coordinate of the location.
        Returns:
        The insertion point for the given location.
      • getNextInsertionPoint

        int getNextInsertionPoint​(int x,
                                  int from,
                                  TextPane.ScrollDirection direction)
        Returns the next insertion point given an x coordinate and a character offset.
        Parameters:
        x - The current X-coordinate to move from.
        from - The current character offset to move from.
        direction - The direction to move from the current location.
        Returns:
        The next insertion point.
      • getRowAt

        int getRowAt​(int offset)
        Returns the row index of the character at a given offset within the document.
        Parameters:
        offset - The character offset to check.
        Returns:
        The row index of the character at the given offset.
      • getRowCount

        int getRowCount()
        Returns:
        The total number of rows in the document.
      • getCharacterBounds

        Bounds getCharacterBounds​(int offset)
        Returns the bounds of the character at a given offset within the document.
        Parameters:
        offset - The index of the character we want the bounds for.
        Returns:
        The bounds of the character at the given offset.
      • getTabWidth

        int getTabWidth()
        Returns:
        The current setting of the "tabWidth" style (so "setText" uses the same value as Ctrl-Tab from user).