Class HoverTracker
java.lang.Object
com.inductiveautomation.ignition.client.util.HoverTracker
This 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 a
MouseListener but 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 -
Method Summary
Modifier and TypeMethodDescriptionstatic HoverTrackerinstallHoverBackground(JComponent component, Color normalColor, Color hoverColor) static HoverTrackerinstallHoverBorder(JComponent component, Border normalBorder, Border hoverBorder) voidRemoves the mouse listeners from all the components they were installed on.
-
Constructor Details
-
HoverTracker
-
-
Method Details
-
installHoverBackground
public static HoverTracker installHoverBackground(JComponent component, Color normalColor, Color hoverColor) -
installHoverBorder
public static HoverTracker installHoverBorder(JComponent component, Border normalBorder, Border hoverBorder) -
uninstall
public void uninstall()Removes the mouse listeners from all the components they were installed on.
-