adavid.util
Class ResourceLoader

java.lang.Object
  |
  +--adavid.util.Bundle
        |
        +--adavid.util.ResourceLoader
Direct Known Subclasses:
JResource

public class ResourceLoader
extends Bundle


Field Summary
static char AREA
           
static java.lang.String BORDER_PAINTED_DEF
           
static java.lang.String DISABLED_DEF
           
static java.lang.String DISABLED_SELECTED_DEF
           
static java.lang.String ENABLED_DEF
           
static java.lang.String EXTENDED_DEF
           
static java.lang.String FLOATABLE_DEF
           
static java.lang.String FOCUS_BORDER_DEF
           
static java.lang.String FOCUS_PAINTED
           
static java.lang.String GLUE_NAME
           
static char H_STRUT
           
static java.lang.String HIDE_NAME_DEF
           
static java.lang.String HORIZONTAL_GLUE_NAME
           
static java.lang.String PRESSED_DEF
           
static java.lang.String RAISED_BORDER_DEF
           
static java.lang.String ROLLOVER_DEF
           
static java.lang.String ROLLOVER_ENABLED_DEF
           
static java.lang.String ROLLOVER_SELECTED_DEF
           
static java.lang.String SELECTED_DEF
           
static int textPosition
           
static java.lang.String TOOLTIP_DEF
          extensions of the resource names to define attributes
static char V_STRUT
           
static java.lang.String VERTICAL_GLUE_NAME
           
 
Fields inherited from class adavid.util.Bundle
COLOR_DEF, FALSE, ICON_DEF, ICON_EXT, MNEMO_DEF, NAME_DEF, PATH_NAME, STATE_DEF, TEAR_DEF, tracker, TRUE
 
Constructor Summary
ResourceLoader(java.lang.Class target)
          constructor with a class
ResourceLoader(java.util.ResourceBundle bundle)
          constructor: takes the resource bundle in argument
ResourceLoader(java.lang.String bundleName, java.lang.Class target)
          constructor: takes the name of the resource bundle, and tries to locate the resource bundle
 
Method Summary
static javax.swing.Box.Filler getBoxFiller(java.lang.String name)
           
 ButtonMenuItem getButtonMenuItem(java.lang.String name, javax.swing.JButton button)
           
 javax.swing.ImageIcon getIcon(java.lang.String def)
          get an icon by its resource name (without .icon extension) return null if not found the default name is resourceName.gif where the '.' in the resourceName have been replaced by '_'
 javax.swing.JButton getJButton(java.lang.String name)
          returns the corresponding button resource with the name definition
 javax.swing.JCheckBoxMenuItem getJCheckBoxMenuItem(java.lang.String name)
           
 javax.swing.JLabel getJLabel(java.lang.String name)
           
 javax.swing.JMenu getJMenu(java.lang.String name)
          returns the corresponding menu
static javax.swing.JMenuBar getJMenuBar()
           
 javax.swing.JMenuItem getJMenuItem(java.lang.String name)
          returns the corresponding menu item
 javax.swing.JPopupMenu getJPopupMenu(java.lang.String name)
          return the corresponding popup menu
 javax.swing.JRadioButton getJRadioButton(java.lang.String name)
          returns the corresponding button resource with the name definition
 javax.swing.JRadioButtonMenuItem getJRadioButtonMenuItem(java.lang.String name)
           
 javax.swing.JToggleButton getJToggleButton(java.lang.String name)
          returns the corresponding button resource with the name definition
 javax.swing.JToolBar getJToolBar(java.lang.String name)
           
static javax.swing.JProgressBar getProgressBar()
          returns a preset progress bar
 RadioButtonMenuItem getRadioButtonMenuItem(java.lang.String name, javax.swing.JRadioButton button)
           
 ToggleButtonMenuItem getToggleButtonMenuItem(java.lang.String name, javax.swing.JToggleButton button)
           
 java.lang.String getToolTipResource(java.lang.String def, java.lang.String defaultValue)
          convenient function: load a tooltip definition
 javax.swing.ImageIcon loadIcon(java.lang.String name)
          load an icon, given its name the icon is path+name return the icon, or null if the name is null or the icon was not found
 void setActionListener(java.awt.event.ActionListener listener)
          change the ActionListener
 javax.swing.AbstractButton setupButton(javax.swing.AbstractButton button, java.lang.String name, java.lang.String def)
          setup a button
 javax.swing.AbstractButton setupItem(javax.swing.AbstractButton item, java.lang.String name)
          initialize an AbstractButton item the name is the resource definition name
 
Methods inherited from class adavid.util.Bundle
getBoolResource, getButton, getCheckbox, getCheckboxMenuItem, getColor, getColorResource, getImage, getLabel, getMenu, getMenuItem, getNameResource, getPopupMenu, getResource, getResource, getString, iconName, init, init, loadImage, loadImageFrom, pathName, pathName, pathName, setActionHandler, setIconPath, setLocation, setLocation, setMenuItem, shortName, shortName, shortName, show, show, waitImage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TOOLTIP_DEF

public static final java.lang.String TOOLTIP_DEF
extensions of the resource names to define attributes

DISABLED_DEF

public static final java.lang.String DISABLED_DEF

DISABLED_SELECTED_DEF

public static final java.lang.String DISABLED_SELECTED_DEF

PRESSED_DEF

public static final java.lang.String PRESSED_DEF

ROLLOVER_DEF

public static final java.lang.String ROLLOVER_DEF

ROLLOVER_SELECTED_DEF

public static final java.lang.String ROLLOVER_SELECTED_DEF

SELECTED_DEF

public static final java.lang.String SELECTED_DEF

ROLLOVER_ENABLED_DEF

public static final java.lang.String ROLLOVER_ENABLED_DEF

ENABLED_DEF

public static final java.lang.String ENABLED_DEF

BORDER_PAINTED_DEF

public static final java.lang.String BORDER_PAINTED_DEF

FOCUS_BORDER_DEF

public static final java.lang.String FOCUS_BORDER_DEF

FOCUS_PAINTED

public static final java.lang.String FOCUS_PAINTED

RAISED_BORDER_DEF

public static final java.lang.String RAISED_BORDER_DEF

HIDE_NAME_DEF

public static final java.lang.String HIDE_NAME_DEF

GLUE_NAME

public static final java.lang.String GLUE_NAME

HORIZONTAL_GLUE_NAME

public static final java.lang.String HORIZONTAL_GLUE_NAME

VERTICAL_GLUE_NAME

public static final java.lang.String VERTICAL_GLUE_NAME

H_STRUT

public static final char H_STRUT

V_STRUT

public static final char V_STRUT

AREA

public static final char AREA

FLOATABLE_DEF

public static final java.lang.String FLOATABLE_DEF

EXTENDED_DEF

public static final java.lang.String EXTENDED_DEF

textPosition

public static int textPosition
Constructor Detail

ResourceLoader

public ResourceLoader(java.lang.Class target)
constructor with a class

ResourceLoader

public ResourceLoader(java.lang.String bundleName,
                      java.lang.Class target)
constructor: takes the name of the resource bundle, and tries to locate the resource bundle

ResourceLoader

public ResourceLoader(java.util.ResourceBundle bundle)
constructor: takes the resource bundle in argument
Method Detail

setActionListener

public void setActionListener(java.awt.event.ActionListener listener)
change the ActionListener

getIcon

public javax.swing.ImageIcon getIcon(java.lang.String def)
get an icon by its resource name (without .icon extension) return null if not found the default name is resourceName.gif where the '.' in the resourceName have been replaced by '_'

loadIcon

public javax.swing.ImageIcon loadIcon(java.lang.String name)
load an icon, given its name the icon is path+name return the icon, or null if the name is null or the icon was not found

getToolTipResource

public java.lang.String getToolTipResource(java.lang.String def,
                                           java.lang.String defaultValue)
convenient function: load a tooltip definition

setupItem

public javax.swing.AbstractButton setupItem(javax.swing.AbstractButton item,
                                            java.lang.String name)
initialize an AbstractButton item the name is the resource definition name

getProgressBar

public static javax.swing.JProgressBar getProgressBar()
returns a preset progress bar

setupButton

public javax.swing.AbstractButton setupButton(javax.swing.AbstractButton button,
                                              java.lang.String name,
                                              java.lang.String def)
setup a button

getJButton

public javax.swing.JButton getJButton(java.lang.String name)
returns the corresponding button resource with the name definition

getJToggleButton

public javax.swing.JToggleButton getJToggleButton(java.lang.String name)
returns the corresponding button resource with the name definition

getJRadioButton

public javax.swing.JRadioButton getJRadioButton(java.lang.String name)
returns the corresponding button resource with the name definition

getJMenu

public javax.swing.JMenu getJMenu(java.lang.String name)
returns the corresponding menu

getJMenuItem

public javax.swing.JMenuItem getJMenuItem(java.lang.String name)
returns the corresponding menu item

getJPopupMenu

public javax.swing.JPopupMenu getJPopupMenu(java.lang.String name)
return the corresponding popup menu

getToggleButtonMenuItem

public ToggleButtonMenuItem getToggleButtonMenuItem(java.lang.String name,
                                                    javax.swing.JToggleButton button)

getButtonMenuItem

public ButtonMenuItem getButtonMenuItem(java.lang.String name,
                                        javax.swing.JButton button)

getRadioButtonMenuItem

public RadioButtonMenuItem getRadioButtonMenuItem(java.lang.String name,
                                                  javax.swing.JRadioButton button)

getJRadioButtonMenuItem

public javax.swing.JRadioButtonMenuItem getJRadioButtonMenuItem(java.lang.String name)

getJCheckBoxMenuItem

public javax.swing.JCheckBoxMenuItem getJCheckBoxMenuItem(java.lang.String name)

getJLabel

public javax.swing.JLabel getJLabel(java.lang.String name)

getBoxFiller

public static javax.swing.Box.Filler getBoxFiller(java.lang.String name)

getJMenuBar

public static javax.swing.JMenuBar getJMenuBar()

getJToolBar

public javax.swing.JToolBar getJToolBar(java.lang.String name)