elge.gui
Class ElgeSwingUtilities

java.lang.Object
  |
  +--elge.gui.ElgeSwingUtilities

public class ElgeSwingUtilities
extends Object

Utility class for various methods wich mostly works with swing components.

Author:
Pavol Žibrita

Method Summary
static void listSelectionChanged(ListSelectionEvent e, Hashtable deps)
          Very common method to enable - disable depended components if a selection in the list is made or unmade.
static void positionFrame(Window frame)
          Position the frame on screen.
static void setListSelection(JList list, int[] sels)
          Renews the selection on a list.
static void showPopupMenu(JPopupMenu menu, MouseEvent e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

listSelectionChanged

public static void listSelectionChanged(ListSelectionEvent e,
                                        Hashtable deps)
Very common method to enable - disable depended components if a selection in the list is made or unmade.

If the selection is empty, the components are disabled, else enabled. The deps hashtable should contains a pairs of JList -> Object[] { depend JComponents... }.

Parameters:
e - the ListSelectionEvent event
deps - The depended components.

positionFrame

public static void positionFrame(Window frame)
Position the frame on screen.

Parameters:
frame - frame to position

setListSelection

public static void setListSelection(JList list,
                                    int[] sels)
Renews the selection on a list.

Parameters:
list - the list where the renew the selection
sels - the old selection

showPopupMenu

public static void showPopupMenu(JPopupMenu menu,
                                 MouseEvent e)