Class TranscriptEditorCaret

All Implemented Interfaces:
FocusListener, MouseListener, MouseMotionListener, Shape, Serializable, Cloneable, EventListener, Caret

public class TranscriptEditorCaret extends DefaultCaret
Custom caret implementation for TranscriptEditor.
See Also:
  • Constructor Details

    • TranscriptEditorCaret

      public TranscriptEditorCaret()
  • Method Details

    • install

      public void install(JTextComponent c)
      Specified by:
      install in interface Caret
      Overrides:
      install in class DefaultCaret
    • paint

      public void paint(Graphics g)
      Specified by:
      paint in interface Caret
      Overrides:
      paint in class DefaultCaret
    • getLineHeight

      public int getLineHeight(int dot)
      Get the height of the line at the given dot
      Parameters:
      dot -
      Returns:
      height of line or 0 if line height could not be determined
    • isFreezeCaret

      public boolean isFreezeCaret()
    • setFreezeCaret

      public void setFreezeCaret(boolean freezeCaret)
    • freeze

      public void freeze()
    • unfreeze

      public void unfreeze()
    • setDot

      public void setDot(int dot, boolean force)
    • setDot

      public void setDot(int dot, Position.Bias bias)
      Overrides:
      setDot in class DefaultCaret
    • setDot

      public void setDot(int dot, Position.Bias bias, boolean force)
    • moveDot

      public void moveDot(int dot, Position.Bias bias)
      Overrides:
      moveDot in class DefaultCaret
    • getTranscriptLocation

      public TranscriptElementLocation getTranscriptLocation(int caretOffset)
      Get caret transcript location
    • getCurrentLocation

      public TranscriptElementLocation getCurrentLocation()
      Get the current location of the caret in the transcript
      Returns:
      the current location if set
    • getPreviousLocation

      public TranscriptElementLocation getPreviousLocation()
      Get the previous location of the caret in the transcript
      Returns:
      the previous location if any
    • addCaretHook

      public void addCaretHook(TranscriptEditorCaretHook hook)
      Add a caret hook
      Parameters:
      hook - the hook to add
    • removeCaretHook

      public void removeCaretHook(TranscriptEditorCaretHook hook)
      Remove a caret hook
      Parameters:
      hook - the hook to remove