Class BasePopupMenu

    • Constructor Detail

      • BasePopupMenu

        public BasePopupMenu()
    • Method Detail

      • showAbsolute

        public void showAbsolute​(Component invoker,
                                 MouseEvent e)
        Displays the popup menu using the absolute screen position.
        Parameters:
        invoker - the invoking component
        e - the absolute positions of the event are used
      • showAbsolute

        public void showAbsolute​(Component invoker,
                                 int x,
                                 int y)
        Displays the popup menu using the absolute screen position.
        Parameters:
        invoker - the invoking component
        x - the absolute X position on screen
        y - the absolute Y position on screen
      • createCascadingMenu

        public static BasePopupMenu createCascadingMenu​(JMenuItem[] menuitems,
                                                        int y,
                                                        int max,
                                                        String more)
        Creates a cascading menu that has at most "max entries". Ones the threshold is reached, a new submenu with the "more" label is introduced and subsequent entries are placed in their.
        Parameters:
        menuitems - the menuitems to create the menu from
        y - where the menu will be displayed
        max - the maximum number of items (+ one for the "more") to show
        more - the text label for the sub-menu
        Returns:
        the menu
      • createCascadingMenu

        public static BasePopupMenu createCascadingMenu​(List<JMenuItem> menuitems,
                                                        int y,
                                                        int max,
                                                        String more)
        Creates a cascading menu that has at most "max entries". Ones the threshold is reached, a new submenu with the "more" label is introduced and subsequent entries are placed in their.
        Parameters:
        menuitems - the menuitems to create the menu from
        y - where the menu will be displayed
        max - the maximum number of items (+ one for the "more") to show, use -1 for automatic maximum based on screen size
        more - the text label for the sub-menu
        Returns:
        the menu