Package org.xhtmlrenderer.swing
Class LinkListener
java.lang.Object
org.xhtmlrenderer.swing.DefaultFSMouseListener
org.xhtmlrenderer.swing.LinkListener
- All Implemented Interfaces:
FSMouseListener
A LinkListener is used to respond to a user clicking Box elements in a
BasicPanel
,
in particular to handle anchors and navigation. When a Box is clicked, if it has an anchor associated with it, the
panel will be requested to navigate to that URI.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
linkClicked
(BasicPanel panel, String uri) Utility method to request the panel navigate to the given URI.void
onMouseUp
(BasicPanel panel, Box box) Triggers the click on a box.Methods inherited from class org.xhtmlrenderer.swing.DefaultFSMouseListener
onMouseDragged, onMouseOut, onMouseOver, onMousePressed, reset
-
Constructor Details
-
LinkListener
public LinkListener()
-
-
Method Details
-
linkClicked
Utility method to request the panel navigate to the given URI.- Parameters:
panel
- the panel on which the listener is attacheduri
- the URI to navigate to
-
onMouseUp
Triggers the click on a box. If the Box's element has an associated URI (e.g. is an anchor), notifies the panel to navigate to that URI.- Specified by:
onMouseUp
in interfaceFSMouseListener
- Overrides:
onMouseUp
in classDefaultFSMouseListener
- Parameters:
panel
- the panel where the mouse button has been released.box
- the box on which the mouse cursor is currently located
-