org.rosuda.JGR.toolkit
Class iMenu

java.lang.Object
  extended by org.rosuda.JGR.toolkit.iMenu

public class iMenu
extends Object

iMenu - implementation of an menu build form an String array.

Author:
Markus Helbig RoSuDa 2003 - 2005

Field Summary
static boolean hasSVG
           
static boolean staticInitDone
           
 
Constructor Summary
iMenu()
           
 
Method Summary
static void addMenu(JFrame f, String name)
          Add menu to existing menubar.
static void addMenuItem(JFrame f, String menu, String name, String command, ActionListener al)
          Add menuitem to existing menu.
static void addMenuSeparator(JFrame f, String menu)
          Add a menuseparator to existing menu.
static JMenuItem getItem(JFrame f, String name)
          Get JMenuItem to supplied name (ActionCommand).
static JMenuItem getItemByLabel(JFrame f, String name)
          Get JMenuItem to supplied name (Label).
static JMenuBar getMenu(JFrame f, ActionListener al, String[] menuDef)
          Get JMenuBar build from menuDef.
static JMenu getMenu(JFrame f, String name)
          Get JMenu to supplied name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

staticInitDone

public static boolean staticInitDone

hasSVG

public static boolean hasSVG
Constructor Detail

iMenu

public iMenu()
Method Detail

getMenu

public static JMenuBar getMenu(JFrame f,
                               ActionListener al,
                               String[] menuDef)
Get JMenuBar build from menuDef.

Parameters:
f - frame where menubar should be added
al - ActionListener which cares about menu-actions
menuDef - menuitem list
Returns:
menubar

addMenu

public static void addMenu(JFrame f,
                           String name)
Add menu to existing menubar.

Parameters:
f - frame where to add menu.
name - menuname

addMenuItem

public static void addMenuItem(JFrame f,
                               String menu,
                               String name,
                               String command,
                               ActionListener al)
Add menuitem to existing menu.

Parameters:
f - frame which contains menu
menu - menu where to add new item
name - name of new item
command - ActionCommand of this new item
al - ActionListener which should be attached to this menuitem

addMenuSeparator

public static void addMenuSeparator(JFrame f,
                                    String menu)
Add a menuseparator to existing menu.

Parameters:
f - frame which contains menu
menu - menu where to ad separator

getMenu

public static JMenu getMenu(JFrame f,
                            String name)
Get JMenu to supplied name.

Parameters:
f - frame which might contains this menu
name - name of menu
Returns:
JMenu which matches name

getItem

public static JMenuItem getItem(JFrame f,
                                String name)
Get JMenuItem to supplied name (ActionCommand).

Parameters:
f - frame which might contain menuitem
name - name of searched menuitem
Returns:
JMenuItem which equals to name

getItemByLabel

public static JMenuItem getItemByLabel(JFrame f,
                                       String name)
Get JMenuItem to supplied name (Label).

Parameters:
f - frame which might contain menuitem
name - name of searched menuitem
Returns:
JMenuItem which equals to name