Module org.autogui

Class LineNumberPane

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, EventListener, DocumentListener

public class LineNumberPane extends JComponent implements DocumentListener
a line-numbers display.
     new LineNumberPane(textPane).install();
 
See Also:
  • Field Details

    • field

      protected JTextComponent field
    • linePosition

      protected List<Integer> linePosition
      line-starting positions excluding 0
    • debug

      protected static boolean debug
    • noOverlappingColor

      protected Color noOverlappingColor
    • caretRepaintListener

      protected CaretListener caretRepaintListener
    • viewportRepaintListener

      protected ChangeListener viewportRepaintListener
    • fieldInstallListener

      protected AncestorListener fieldInstallListener
  • Constructor Details

  • Method Details

    • scroll

      public static JScrollPane scroll(Container c)
    • install

      public void install()
    • installToScrollPane

      public void installToScrollPane(JScrollPane scrollPane)
    • uninstall

      public void uninstall()
    • uninstallFromScrollPane

      public void uninstallFromScrollPane(JScrollPane scrollPane)
    • build

      public void build()
    • insertUpdate

      public void insertUpdate(DocumentEvent e)
      Specified by:
      insertUpdate in interface DocumentListener
    • linePositions

      public List<Integer> linePositions(String text, int off)
      Parameters:
      text - sub-string of the document
      off - an offset in the document (not the text)
      Returns:
      list of line-head positions.
    • findPosition

      public int findPosition(int n)
    • removeUpdate

      public void removeUpdate(DocumentEvent e)
      Specified by:
      removeUpdate in interface DocumentListener
    • changedUpdate

      public void changedUpdate(DocumentEvent e)
      Specified by:
      changedUpdate in interface DocumentListener
    • updatePreferredSize

      public void updatePreferredSize()
    • paintComponent

      protected void paintComponent(Graphics g)
      Overrides:
      paintComponent in class JComponent
    • paintLine

      public void paintLine(Graphics2D g, int i, int lines, int selStart, int selEnd, int selfOffsetY) throws Exception
      Throws:
      Exception
    • paintLine

      public void paintLine(Graphics2D g, int i, int lineStart, boolean overlap, int selfOffsetY) throws Exception
      Throws:
      Exception