Module org.autogui

Class TextCellRenderer.LineInfo

java.lang.Object
org.autogui.swing.util.TextCellRenderer.LineInfo
Direct Known Subclasses:
GuiSwingLogEntryString.LineInfoHead
Enclosing class:
TextCellRenderer<ValueType>

public static class TextCellRenderer.LineInfo extends Object
a line holding AttributedString
  • Field Details

    • attributedString

      public AttributedString attributedString
    • start

      public int start
    • end

      public int end
    • indent

      public int indent
    • layout

      protected TextLayout layout
    • selectionStart

      protected int selectionStart
    • selectionEnd

      protected int selectionEnd
    • layoutState

      protected List<Object> layoutState
    • findRanges

      protected List<int[]> findRanges
  • Constructor Details

    • LineInfo

      public LineInfo(AttributedString attributedString, int start, int end)
  • Method Details

    • getWidth

      public int getWidth()
      Returns:
      number of characters including indents
    • setIndent

      public void setIndent(int indent)
      Parameters:
      indent - number of indent characters
    • getIndent

      public int getIndent()
    • getLayout

      public TextLayout getLayout(FontRenderContext frc)
      Parameters:
      frc - the font-rendering-context used when creating a new text-layout
      Returns:
      a new or cached text-layout
    • getLayout

      public TextLayout getLayout(FontRenderContext frc, int selectionStart, int selectionEnd, Color foreground, Color background, Color selectionForeground, Color selectionBackground, Map<Color,Map<Color,Color>> textToBackToColor)
    • colorUpdate

      public AttributedString colorUpdate(AttributedString attrStr, Color text, Color background, Color selectionForeground, Color selectionBackground, Map<Color,Map<Color,Color>> textToBackToColor)
    • getColor

      public Color getColor(Color foreground, Color regularForeground, Color background)
    • brightness

      public double brightness(Color c)
    • clearLayout

      public void clearLayout()
    • getX

      public float getX(TextLayout l, int i)
      Parameters:
      l - text-layout of the line
      i - a character index (0 means the line-top)
      Returns:
      X position of the right-hit of the character i
    • getSelectionShape

      public Shape getSelectionShape(TextLayout l, int start, int end)
      Parameters:
      l - created text-layout of this line
      start - same origin as this.start
      end - same origin as this.start
      Returns:
      a logical highlight shape for the range
    • addFindRange

      public void addFindRange(int start, int end)
      add a new range
      Parameters:
      start - same origin as this.start
      end - same origin as this.start
    • getFindRanges

      public List<int[]> getFindRanges()
      Returns:
      never null
    • clearFindRanges

      public void clearFindRanges()