Package org.xhtmlrenderer.swing
Class LinkListener
- java.lang.Object
-
- org.xhtmlrenderer.swing.DefaultFSMouseListener
-
- org.xhtmlrenderer.swing.LinkListener
-
- All Implemented Interfaces:
FSMouseListener
public class LinkListener extends DefaultFSMouseListener
A LinkListener is used to respond to a user clicking Box elements in aBasicPanel
, 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 Constructor Description LinkListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
linkClicked(BasicPanel panel, java.lang.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
-
-
-
-
Method Detail
-
linkClicked
public void linkClicked(BasicPanel panel, java.lang.String uri)
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
public void onMouseUp(BasicPanel panel, Box box)
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
-
-