de.uni_paderborn.fujaba.gui
Class FPopupMenu

java.lang.Object
  extended byde.uni_paderborn.fujaba.gui.FPopupMenu

public class FPopupMenu
extends java.lang.Object

FPopupMenu is a wrapper class for a JPopupMenu, which overwrites the show method in that case, that the popup menu is shown on the screen and is not cuttet off by the screens bounds.

Version:
$Revision: 1.11 $
Author:
$Author: lowende $

Constructor Summary
FPopupMenu()
           
 
Method Summary
static void show(javax.swing.JPopupMenu menu, java.awt.Component invoker, int x, int y)
          Display the popupmenu at the position x,y in the coordinate space of the component invoker.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FPopupMenu

public FPopupMenu()
Method Detail

show

public static void show(javax.swing.JPopupMenu menu,
                        java.awt.Component invoker,
                        int x,
                        int y)
Display the popupmenu at the position x,y in the coordinate space of the component invoker. The position is recalculated if the popup menu can not be shown in the screen. Therefore the position is calculated as follows: x = (x + popupwidth > screenwidth) ? (x - popupwidth) : x y = min (screenheight - popupheight, y) If the popupmenu is larger than the screensize, the menu will popup at position (0,0) or (0,y) or (x,0).

Parameters:
menu - the popup menu to display
invoker - The component in whose space the popupmenu is to appear
x - the x coordinate in invoker's coordinate space at which the popup menu is to be displayed
y - the y coordinate in invoker's coordinate space at which the popup menu is to be displayed