Package org.xhtmlrenderer.swing
Class SelectionHighlighter
java.lang.Object
org.xhtmlrenderer.swing.SelectionHighlighter
- All Implemented Interfaces:
MouseListener,MouseMotionListener,EventListener
@ParametersAreNonnullByDefault
public class SelectionHighlighter
extends Object
implements MouseMotionListener, MouseListener
A simple Selection and Highlighter class for
XHTMLPanel.
The current selection is available as a DOM Range via getSelectionRange. There is also a Swing
action to copy the selection contents to the clipboard:
SelectionHighlighter.CopyAction, which
should be installed on the SelectionHighlighter
Usage: create the XHTMLPanel, create an instance of this class then call install. See also: /demos/samples/src/SelectionHighlighterTest.java
With thanks to Swing'sDefaultCaret- Author:
- Nick Reddel
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected voidadjustVisibility(Rectangle nloc) protected MouseEventvoiddeinstall(XHTMLPanel panel) protected voidvoidinstall(XHTMLPanel panel) voidvoidvoidvoidvoidvoidvoidprotected voidvoidmoveDot(org.xhtmlrenderer.swing.SelectionHighlighter.ViewModelInfo pos) voidvoidvoidsetDot(org.xhtmlrenderer.swing.SelectionHighlighter.ViewModelInfo pos) voidsetHandler(TransferHandler handler)
-
Field Details
-
changeEvent
-
copyAction
- See Also:
-
-
Constructor Details
-
SelectionHighlighter
public SelectionHighlighter()
-
-
Method Details
-
addChangeListener
-
removeChangeListener
-
fireStateChanged
protected void fireStateChanged() -
install
-
deinstall
-
setDot
public void setDot(org.xhtmlrenderer.swing.SelectionHighlighter.ViewModelInfo pos) -
mouseDragged
- Specified by:
mouseDraggedin interfaceMouseMotionListener
-
mouseMoved
- Specified by:
mouseMovedin interfaceMouseMotionListener
-
mouseClicked
- Specified by:
mouseClickedin interfaceMouseListener
-
mouseEntered
- Specified by:
mouseEnteredin interfaceMouseListener
-
mouseExited
- Specified by:
mouseExitedin interfaceMouseListener
-
mousePressed
- Specified by:
mousePressedin interfaceMouseListener
-
mouseReleased
- Specified by:
mouseReleasedin interfaceMouseListener
-
getComponent
-
moveCaret
-
selectAll
public void selectAll() -
moveDot
public void moveDot(org.xhtmlrenderer.swing.SelectionHighlighter.ViewModelInfo pos) -
getSelectionRange
-
adjustVisibility
-
convertMouseEventToScale
-
setHandler
-