Class SubMenuUsabilityHelper

  • All Implemented Interfaces:
    java.util.EventListener, javax.swing.event.ChangeListener

    class SubMenuUsabilityHelper
    extends java.lang.Object
    implements javax.swing.event.ChangeListener
    Improves usability of submenus by using a safe triangle to avoid that the submenu closes while the user moves the mouse to it.
    • Field Detail

      • KEY_USE_SAFE_TRIANGLE

        private static final java.lang.String KEY_USE_SAFE_TRIANGLE
        See Also:
        Constant Field Values
      • KEY_SHOW_SAFE_TRIANGLE

        private static final java.lang.String KEY_SHOW_SAFE_TRIANGLE
        See Also:
        Constant Field Values
      • eventQueuePushNotSupported

        private boolean eventQueuePushNotSupported
      • changePending

        private boolean changePending
      • mouseX

        private int mouseX
      • mouseY

        private int mouseY
      • targetX

        private int targetX
      • targetTopY

        private int targetTopY
      • targetBottomY

        private int targetBottomY
      • invokerBounds

        private java.awt.Rectangle invokerBounds
    • Constructor Detail

      • SubMenuUsabilityHelper

        SubMenuUsabilityHelper()
    • Method Detail

      • install

        static boolean install()
      • uninstall

        static void uninstall()
      • stateChanged

        public void stateChanged​(javax.swing.event.ChangeEvent e)
        Specified by:
        stateChanged in interface javax.swing.event.ChangeListener
      • menuSelectionChanged

        private void menuSelectionChanged()
      • uninstallEventQueue

        private void uninstallEventQueue()
      • findSubMenu

        private int findSubMenu​(javax.swing.MenuElement[] path)
      • createSafeTriangle

        private java.awt.Polygon createSafeTriangle()