net.clackrouter.jgraph.utils
Class HTMLPane.CustomLinkHandler

java.lang.Object
  extended by net.clackrouter.jgraph.utils.HTMLPane.CustomLinkHandler
All Implemented Interfaces:
java.util.EventListener, javax.swing.event.HyperlinkListener
Enclosing class:
HTMLPane

protected class HTMLPane.CustomLinkHandler
extends java.lang.Object
implements javax.swing.event.HyperlinkListener

Handles URL hyperlink events and provides status information.


Field Summary
protected  java.lang.String hoveredURLString
           
protected  boolean isHovering
           
protected  javax.swing.JEditorPane pane
           
 
Constructor Summary
HTMLPane.CustomLinkHandler(javax.swing.JEditorPane inpane)
          Constructor for the CustomLinkHandler object
 
Method Summary
 java.lang.String getHoveredURL()
          Gets the URL being hovered over.
 void hyperlinkUpdate(javax.swing.event.HyperlinkEvent e)
          Launch browser if hyperlink is clicked by user.
 boolean isHoveringOverHyperlink()
          Determines if current mouse location is hovering over a hyperlink.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pane

protected javax.swing.JEditorPane pane

isHovering

protected boolean isHovering

hoveredURLString

protected java.lang.String hoveredURLString
Constructor Detail

HTMLPane.CustomLinkHandler

public HTMLPane.CustomLinkHandler(javax.swing.JEditorPane inpane)
Constructor for the CustomLinkHandler object

Parameters:
inpane - Description of Parameter
Method Detail

isHoveringOverHyperlink

public boolean isHoveringOverHyperlink()
Determines if current mouse location is hovering over a hyperlink. Remember, CustomLinkHandler is NOT notified of hyperlink events if editing is enabled by defintion in JEditorPane. In otherwords, when HTML code is being displayed, then hyperlink tracking is not occuring.

Returns:
true if mouse if hovering over hyperlink and pane is not editable

getHoveredURL

public java.lang.String getHoveredURL()
Gets the URL being hovered over.

Returns:
The URL value if mouse is currently hovering over a URL, or null if not currently hovering over a URL

hyperlinkUpdate

public void hyperlinkUpdate(javax.swing.event.HyperlinkEvent e)
Launch browser if hyperlink is clicked by user. Will go to existing opened browser if one exists. If not clicked, then store url pointed to.

Specified by:
hyperlinkUpdate in interface javax.swing.event.HyperlinkListener
Parameters:
e - event passed by source