Class HoverTracker
- java.lang.Object
-
- com.inductiveautomation.ignition.client.util.HoverTracker
-
public class HoverTracker extends java.lang.ObjectThis class is an overly complex way to do something that you think should be simple. It calls callbacks when the mouse hovers over a component and another when it exits. This could be done easily with aMouseListenerbut unfortunately that strategy only works for simple components with no children. This implementation puts mouse listeners on the given component and all children, and tracks whenever the mouse is anywhere in the interior of the outermost component. Note that the tracker does not handle the case where the children are altered after the tracker is created, so make the tracker after the UI has been initialized.
-
-
Constructor Summary
Constructors Constructor Description HoverTracker(javax.swing.JComponent component, java.lang.Runnable onEnter, java.lang.Runnable onExit)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static HoverTrackerinstallHoverBackground(javax.swing.JComponent component, java.awt.Color normalColor, java.awt.Color hoverColor)static HoverTrackerinstallHoverBorder(javax.swing.JComponent component, javax.swing.border.Border normalBorder, javax.swing.border.Border hoverBorder)voiduninstall()Removes the mouse listeners from all the components they were installed on.
-
-
-
Method Detail
-
installHoverBackground
public static HoverTracker installHoverBackground(javax.swing.JComponent component, java.awt.Color normalColor, java.awt.Color hoverColor)
-
installHoverBorder
public static HoverTracker installHoverBorder(javax.swing.JComponent component, javax.swing.border.Border normalBorder, javax.swing.border.Border hoverBorder)
-
uninstall
public void uninstall()
Removes the mouse listeners from all the components they were installed on.
-
-