Class TranscriptEditorCaret
java.lang.Object
java.awt.geom.RectangularShape
java.awt.geom.Rectangle2D
java.awt.Rectangle
javax.swing.text.DefaultCaret
ca.phon.app.session.editor.view.transcript.TranscriptEditorCaret
- All Implemented Interfaces:
FocusListener,MouseListener,MouseMotionListener,Shape,Serializable,Cloneable,EventListener,Caret
Custom caret implementation for
TranscriptEditor.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.awt.geom.Rectangle2D
Rectangle2D.Double, Rectangle2D.Float -
Field Summary
Fields inherited from class javax.swing.text.DefaultCaret
ALWAYS_UPDATE, changeEvent, listenerList, NEVER_UPDATE, UPDATE_WHEN_ON_EDTFields inherited from class java.awt.geom.Rectangle2D
OUT_BOTTOM, OUT_LEFT, OUT_RIGHT, OUT_TOP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a caret hookvoidfreeze()Get the current location of the caret in the transcriptintgetLineHeight(int dot) Get the height of the line at the given dotGet the previous location of the caret in the transcriptgetTranscriptLocation(int caretOffset) Get caret transcript locationvoidbooleanvoidmoveDot(int dot, Position.Bias bias) voidvoidRemove a caret hookvoidsetDot(int dot, boolean force) voidsetDot(int dot, Position.Bias bias) voidsetDot(int dot, Position.Bias bias, boolean force) voidsetFreezeCaret(boolean freezeCaret) voidunfreeze()Methods inherited from class javax.swing.text.DefaultCaret
addChangeListener, adjustVisibility, damage, deinstall, equals, fireStateChanged, focusGained, focusLost, getBlinkRate, getChangeListeners, getComponent, getDot, getDotBias, getListeners, getMagicCaretPosition, getMark, getMarkBias, getSelectionPainter, getUpdatePolicy, isActive, isSelectionVisible, isVisible, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, moveCaret, moveDot, positionCaret, removeChangeListener, repaint, setBlinkRate, setDot, setMagicCaretPosition, setSelectionVisible, setUpdatePolicy, setVisible, toStringMethods inherited from class java.awt.Rectangle
add, add, add, contains, contains, contains, contains, createIntersection, createUnion, getBounds, getBounds2D, getHeight, getLocation, getSize, getWidth, getX, getY, grow, inside, intersection, intersects, isEmpty, move, outcode, reshape, resize, setBounds, setBounds, setLocation, setLocation, setRect, setSize, setSize, translate, unionMethods inherited from class java.awt.geom.Rectangle2D
add, add, add, contains, contains, getPathIterator, getPathIterator, hashCode, intersect, intersects, intersectsLine, intersectsLine, outcode, setFrame, setRect, unionMethods inherited from class java.awt.geom.RectangularShape
clone, contains, contains, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonalMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.awt.Shape
contains, contains, contains, contains, getPathIterator, getPathIterator, intersects, intersects
-
Constructor Details
-
TranscriptEditorCaret
public TranscriptEditorCaret()
-
-
Method Details
-
install
- Specified by:
installin interfaceCaret- Overrides:
installin classDefaultCaret
-
paint
- Specified by:
paintin interfaceCaret- Overrides:
paintin classDefaultCaret
-
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
- Overrides:
setDotin classDefaultCaret
-
setDot
-
moveDot
- Overrides:
moveDotin classDefaultCaret
-
getTranscriptLocation
Get caret transcript location -
getCurrentLocation
Get the current location of the caret in the transcript- Returns:
- the current location if set
-
getPreviousLocation
Get the previous location of the caret in the transcript- Returns:
- the previous location if any
-
addCaretHook
Add a caret hook- Parameters:
hook- the hook to add
-
removeCaretHook
Remove a caret hook- Parameters:
hook- the hook to remove
-