Class HoverTracker

java.lang.Object
com.inductiveautomation.ignition.client.util.HoverTracker

public class HoverTracker extends Object
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 Details

  • 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.