net.sf.magicproject.ui
Class UIHelper

java.lang.Object
  extended by net.sf.magicproject.ui.UIHelper

public final class UIHelper
extends java.lang.Object

Since:
0.92
Author:
Fabrice Daugan

Method Summary
static javax.swing.JButton buildButton(java.lang.String actionName)
          Build and return a JButton instance with a gif icon with actionName as action command.
static javax.swing.JButton buildButton(java.lang.String actionName, java.awt.event.ActionListener actionListener)
          Build and return a JButton instance with a gif icon with actionName as action command.
static javax.swing.JMenu buildMenu(java.lang.String menuName)
          Build and return a JMenu instance with an i18n text, and menuName as action command.
static javax.swing.JMenuItem buildMenu(java.lang.String menuName, java.awt.event.ActionListener actionListener)
          Build and return a JMenuItem instance with an i18n text, and menuName as action command.
static javax.swing.JMenu buildMenu(java.lang.String menuName, char mnemonic)
          Build and return a JMenu instance with an i18n text, and menuName as action command.
static javax.swing.JMenuItem buildMenu(java.lang.String menuName, char mnemonic, java.awt.event.ActionListener actionListener)
          Build and return a JMenuItem instance with an i18n text, and menuName as action command.
static javax.swing.JMenuItem buildMenu(java.lang.String menuName, char mnemonic, java.lang.String icon, java.awt.event.ActionListener actionListener)
          Build and return a JMenuItem instance with an i18n text, and menuName as action command.
static javax.swing.ImageIcon getIcon(java.lang.String icon)
          Returns the associated icon.
static javax.swing.ImageIcon getTbsIcon(java.lang.String icon)
          Returns the associated TBS icon.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getIcon

public static javax.swing.ImageIcon getIcon(java.lang.String icon)
Returns the associated icon.

Parameters:
icon - the icon path relative to the images dir
Returns:
the icon used for the UI

getTbsIcon

public static javax.swing.ImageIcon getTbsIcon(java.lang.String icon)
Returns the associated TBS icon.

Parameters:
icon - the TBS icon path relative to the images dir
Returns:
the icon used for the UI

buildMenu

public static javax.swing.JMenu buildMenu(java.lang.String menuName)
Build and return a JMenu instance with an i18n text, and menuName as action command.

Parameters:
menuName - the menu key name.
Returns:
the new JMenu instance.

buildButton

public static javax.swing.JButton buildButton(java.lang.String actionName)
Build and return a JButton instance with a gif icon with actionName as action command.

Parameters:
actionName - the action name.
Returns:
the new JMenu instance.

buildButton

public static javax.swing.JButton buildButton(java.lang.String actionName,
                                              java.awt.event.ActionListener actionListener)
Build and return a JButton instance with a gif icon with actionName as action command.

Parameters:
actionName - the action name.
actionListener - the listern to register to the new component.
Returns:
the new JMenu instance.

buildMenu

public static javax.swing.JMenu buildMenu(java.lang.String menuName,
                                          char mnemonic)
Build and return a JMenu instance with an i18n text, and menuName as action command.

Parameters:
menuName - the menu key name.
mnemonic - the mnemonic char for this menu.
Returns:
the new JMenu instance.

buildMenu

public static javax.swing.JMenuItem buildMenu(java.lang.String menuName,
                                              char mnemonic,
                                              java.lang.String icon,
                                              java.awt.event.ActionListener actionListener)
Build and return a JMenuItem instance with an i18n text, and menuName as action command. The tooltip is also set with the i18n + '.tooltip' key.

Parameters:
menuName - the menu key name.
mnemonic - the mnemonic char for this menu.
icon - the icon name to set to this menu.
actionListener - the listern to register to the new component.
Returns:
the new JMenuItem instance.

buildMenu

public static javax.swing.JMenuItem buildMenu(java.lang.String menuName,
                                              char mnemonic,
                                              java.awt.event.ActionListener actionListener)
Build and return a JMenuItem instance with an i18n text, and menuName as action command. The tooltip is also set with the i18n + '.tooltip' key.

Parameters:
menuName - the menu key name.
mnemonic - the mnemonic char for this menu.
actionListener - the listern to register to the new component.
Returns:
the new JMenuItem instance.

buildMenu

public static javax.swing.JMenuItem buildMenu(java.lang.String menuName,
                                              java.awt.event.ActionListener actionListener)
Build and return a JMenuItem instance with an i18n text, and menuName as action command. The tooltip is also set with the i18n + '.tooltip' key. The used icon is first '.gif', then '.png' extension using menuName as basename.

Parameters:
menuName - the menu key name.
actionListener - the listern to register to the new component.
Returns:
the new JMenuItem instance.


Copyright © 2003-2007 Magic-Project. All Rights Reserved.