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| 限定符和类型 | 类和说明 |
|---|---|
static class |
SelectionHighlighter.CopyAction |
class |
SelectionHighlighter.ViewModelInfo |
| 限定符和类型 | 字段和说明 |
|---|---|
protected ChangeEvent |
changeEvent |
static String |
copyAction |
protected EventListenerList |
listenerList |
| 构造器和说明 |
|---|
SelectionHighlighter() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addChangeListener(ChangeListener l) |
protected void |
adjustVisibility(Rectangle nloc) |
protected MouseEvent |
convertMouseEventToScale(MouseEvent e) |
void |
deinstall(XHTMLPanel panel) |
protected void |
fireStateChanged() |
XHTMLPanel |
getComponent() |
org.w3c.dom.ranges.Range |
getSelectionRange() |
void |
install(XHTMLPanel panel) |
void |
mouseClicked(MouseEvent e) |
void |
mouseDragged(MouseEvent e) |
void |
mouseEntered(MouseEvent e) |
void |
mouseExited(MouseEvent e) |
void |
mouseMoved(MouseEvent e) |
void |
mousePressed(MouseEvent e) |
void |
mouseReleased(MouseEvent e) |
protected void |
moveCaret(MouseEvent e) |
void |
moveDot(SelectionHighlighter.ViewModelInfo pos) |
String |
normalizeSpaces(String s) |
void |
removeChangeListener(ChangeListener l) |
void |
selectAll() |
void |
setDot(SelectionHighlighter.ViewModelInfo pos) |
void |
setHandler(TransferHandler handler) |
protected EventListenerList listenerList
protected transient ChangeEvent changeEvent
public void addChangeListener(ChangeListener l)
public void removeChangeListener(ChangeListener l)
protected void fireStateChanged()
public void install(XHTMLPanel panel)
public void deinstall(XHTMLPanel panel)
public void setDot(SelectionHighlighter.ViewModelInfo pos)
public void mouseDragged(MouseEvent e)
mouseDragged 在接口中 MouseMotionListenerpublic void mouseMoved(MouseEvent e)
mouseMoved 在接口中 MouseMotionListenerpublic void mouseClicked(MouseEvent e)
mouseClicked 在接口中 MouseListenerpublic void mouseEntered(MouseEvent e)
mouseEntered 在接口中 MouseListenerpublic void mouseExited(MouseEvent e)
mouseExited 在接口中 MouseListenerpublic void mousePressed(MouseEvent e)
mousePressed 在接口中 MouseListenerpublic void mouseReleased(MouseEvent e)
mouseReleased 在接口中 MouseListenerpublic XHTMLPanel getComponent()
protected void moveCaret(MouseEvent e)
public void selectAll()
public void moveDot(SelectionHighlighter.ViewModelInfo pos)
public org.w3c.dom.ranges.Range getSelectionRange()
protected void adjustVisibility(Rectangle nloc)
protected MouseEvent convertMouseEventToScale(MouseEvent e)
public void setHandler(TransferHandler handler)
Copyright © 2019. All Rights Reserved.