Package org.xhtmlrenderer.swing
Class HoverListener
java.lang.Object
org.xhtmlrenderer.swing.DefaultFSMouseListener
org.xhtmlrenderer.swing.HoverListener
- All Implemented Interfaces:
FSMouseListener
A HoverListener is used to respond to a mouse hovering over a Box in a
BasicPanel
.
In particular, it applies any :hover selectors that apply to the Box in question, and resets those styles
as the mouse exits the Box.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate @Nullable Element
getHoveredElement
(StyleReference style, @Nullable Box ib) void
onMouseOut
(BasicPanel panel, Box box) Sent when the mouse leaves a Box in the render tree after entering it.void
onMouseOver
(BasicPanel panel, Box box) Sent when the mouse moves over a Box in the render tree.void
reset()
Resets the tracking information related to the currently hovered element.Methods inherited from class org.xhtmlrenderer.swing.DefaultFSMouseListener
onMouseDragged, onMousePressed, onMouseUp
-
Field Details
-
_previouslyHovered
-
-
Constructor Details
-
HoverListener
public HoverListener()
-
-
Method Details
-
onMouseOut
Description copied from interface:FSMouseListener
Sent when the mouse leaves a Box in the render tree after entering it.- Specified by:
onMouseOut
in interfaceFSMouseListener
- Overrides:
onMouseOut
in classDefaultFSMouseListener
- Parameters:
panel
- the panel where the box is displayedbox
- the box the mouse has just left
-
onMouseOver
Description copied from interface:FSMouseListener
Sent when the mouse moves over a Box in the render tree.- Specified by:
onMouseOver
in interfaceFSMouseListener
- Overrides:
onMouseOver
in classDefaultFSMouseListener
- Parameters:
panel
- the panel where the box is displayedbox
- the box the mouse has just moved over
-
getHoveredElement
@CheckReturnValue private @Nullable Element getHoveredElement(StyleReference style, @Nullable Box ib) -
reset
public void reset()Resets the tracking information related to the currently hovered element.- Specified by:
reset
in interfaceFSMouseListener
- Overrides:
reset
in classDefaultFSMouseListener
-