lineLength = newLineLength;
}
// track the moving of the mouse.
public void mouseMoved(MouseEvent e) {
JEditorPane editor = (JEditorPane) e.getSource();
if (!editor.isEditable()) {
Point pt = new Point(e.getX(), e.getY());
URLSelection newSelection = getIndicatedURL(pt, editor);
if (newSelection != currentSelection) {
if (currentSelection != null) {
editor.fireHyperlinkUpdate(new HyperlinkEvent(currentSelection, HyperlinkEvent.EventType.EXITED, currentSelection.url));
}
if (newSelection != null) {
editor.fireHyperlinkUpdate(new HyperlinkEvent(newSelection, HyperlinkEvent.EventType.ENTERED, newSelection.url));
}
currentSelection = newSelection;
}
}
}