adavid.util
Class JResource

java.lang.Object
  |
  +--adavid.util.Bundle
        |
        +--adavid.util.ResourceLoader
              |
              +--adavid.util.JResource

public class JResource
extends ResourceLoader

syntax of the class passed in argument: class Data { ### all members should be declared public, otherwise they may not be read or written static String name1; => name1 is the resource name and the default value static String name2="default"; => here the default value is given static Icon name3; => name3 is the resource name for an icon object default is name3.gif ### String resources are defined as: resourceName.name=... ### Icon resources are defined as: resourceName.icon=... JMenu menu1; => resource name + default name => menu entry JMenuItem menu1_item1; => its menu item JMenu menu1_menu2; => sub menu entry JMenuItem menu1_menu2_item => item of the sub menu JCheckBoxMenuItem jcbmi; => jcbmi is the default name + resource name ... no icon ### resource definitions: ### menu.name=... menu.mnemo=... for the menu and submenu ### menuitem.name=... menuitem.icon=... menuitem.mnemo=... ### the menu have the ActionListener given in argument to the constructor of ### JResource ### if no JMenu are defined , the file gives the structure: MenuBar= File Options File=Open Save Quit Open.action=menuItemOpen Open.icon=open.gif Save.action=menuItemSave Quit.action=menuItemQuit Options=Cool Cool=SubCool SubCool=jCheckBoxMenuItem ### definitions are static or not


Fields inherited from class adavid.util.ResourceLoader
AREA, BORDER_PAINTED_DEF, DISABLED_DEF, DISABLED_SELECTED_DEF, ENABLED_DEF, EXTENDED_DEF, FLOATABLE_DEF, FOCUS_BORDER_DEF, FOCUS_PAINTED, GLUE_NAME, H_STRUT, HIDE_NAME_DEF, HORIZONTAL_GLUE_NAME, PRESSED_DEF, RAISED_BORDER_DEF, ROLLOVER_DEF, ROLLOVER_ENABLED_DEF, ROLLOVER_SELECTED_DEF, SELECTED_DEF, textPosition, TOOLTIP_DEF, V_STRUT, 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
JResource(java.lang.Object data)
          contructors
JResource(java.lang.Object data, java.awt.event.ActionListener listener)
           
JResource(java.lang.Object data, java.awt.event.ActionListener listener, java.util.ResourceBundle bundle)
           
JResource(java.lang.Object data, java.awt.event.ActionListener listener, java.util.ResourceBundle bundle, java.lang.Object actionHandler)
           
JResource(java.lang.Object data, java.awt.event.ActionListener listener, java.lang.String bundleName)
           
JResource(java.lang.Object data, java.awt.event.ActionListener listener, java.lang.String bundleName, java.lang.Object actionHandler)
           
 
Method Summary
 void initialize(java.lang.Object data, java.awt.event.ActionListener listener)
          the initialization function called if data is not null => the class can be used only to load resources in an easy way, with no initialization
 void initialize(java.lang.Object data, java.awt.event.ActionListener listener, java.lang.Object actionHandler)
           
static boolean isButtonMenuItem(java.lang.Class c)
           
static boolean isButtonMenuItem(java.lang.String className)
           
static boolean isColor(java.lang.String className)
           
static boolean isFiller(java.lang.Class c)
           
static boolean isFiller(java.lang.String className)
           
static boolean isIcon(java.lang.Class c)
           
static boolean isIcon(java.lang.String className)
           
static boolean isImageIcon(java.lang.Class c)
           
static boolean isImageIcon(java.lang.String className)
           
static boolean isJButton(java.lang.Class c)
           
static boolean isJButton(java.lang.String className)
           
static boolean isJCheckBoxMenuItem(java.lang.Class c)
           
static boolean isJCheckBoxMenuItem(java.lang.String className)
           
static boolean isJLabel(java.lang.Class c)
           
static boolean isJLabel(java.lang.String className)
           
static boolean isJMenu(java.lang.Class c)
           
static boolean isJMenu(java.lang.String className)
           
static boolean isJMenuBar(java.lang.Class c)
           
static boolean isJMenuBar(java.lang.String className)
           
static boolean isJMenuItem(java.lang.Class c)
           
static boolean isJMenuItem(java.lang.String className)
           
static boolean isJPopupMenu(java.lang.Class c)
           
static boolean isJPopupMenu(java.lang.String className)
           
static boolean isJRadioButton(java.lang.Class c)
           
static boolean isJRadioButton(java.lang.String className)
           
static boolean isJRadioButtonMenuItem(java.lang.Class c)
           
static boolean isJRadioButtonMenuItem(java.lang.String className)
           
static boolean isJSeparator(java.lang.Class c)
           
static boolean isJSeparator(java.lang.String className)
           
static boolean isJToggleButton(java.lang.Class c)
           
static boolean isJToggleButton(java.lang.String className)
           
static boolean isJToolBar(java.lang.Class c)
           
static boolean isJToolBar(java.lang.String className)
           
static boolean isRadioButtonMenuItem(java.lang.Class c)
           
static boolean isRadioButtonMenuItem(java.lang.String className)
           
static boolean isString(java.lang.Class c)
          tests on Class: convenient methods
static boolean isString(java.lang.String className)
           
static boolean isToggleButtonMenuItem(java.lang.Class c)
           
static boolean isToggleButtonMenuItem(java.lang.String className)
           
static boolean isToggleCheckButtonMenuItem(java.lang.Class c)
           
static boolean isToggleCheckButtonMenuItem(java.lang.String className)
           
static void setProgressBar(javax.swing.JProgressBar progress)
           
static void setTitleLabel(javax.swing.JLabel label)
           
 
Methods inherited from class adavid.util.ResourceLoader
getBoxFiller, getButtonMenuItem, getIcon, getJButton, getJCheckBoxMenuItem, getJLabel, getJMenu, getJMenuBar, getJMenuItem, getJPopupMenu, getJRadioButton, getJRadioButtonMenuItem, getJToggleButton, getJToolBar, getProgressBar, getRadioButtonMenuItem, getToggleButtonMenuItem, getToolTipResource, loadIcon, setActionListener, setupButton, setupItem
 
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
 

Constructor Detail

JResource

public JResource(java.lang.Object data)
contructors

JResource

public JResource(java.lang.Object data,
                 java.awt.event.ActionListener listener)

JResource

public JResource(java.lang.Object data,
                 java.awt.event.ActionListener listener,
                 java.lang.String bundleName)

JResource

public JResource(java.lang.Object data,
                 java.awt.event.ActionListener listener,
                 java.lang.String bundleName,
                 java.lang.Object actionHandler)

JResource

public JResource(java.lang.Object data,
                 java.awt.event.ActionListener listener,
                 java.util.ResourceBundle bundle)

JResource

public JResource(java.lang.Object data,
                 java.awt.event.ActionListener listener,
                 java.util.ResourceBundle bundle,
                 java.lang.Object actionHandler)
Method Detail

initialize

public void initialize(java.lang.Object data,
                       java.awt.event.ActionListener listener)
the initialization function called if data is not null => the class can be used only to load resources in an easy way, with no initialization

initialize

public void initialize(java.lang.Object data,
                       java.awt.event.ActionListener listener,
                       java.lang.Object actionHandler)

isString

public static boolean isString(java.lang.Class c)
tests on Class: convenient methods

isString

public static boolean isString(java.lang.String className)

isIcon

public static boolean isIcon(java.lang.Class c)

isImageIcon

public static boolean isImageIcon(java.lang.Class c)

isIcon

public static boolean isIcon(java.lang.String className)

isImageIcon

public static boolean isImageIcon(java.lang.String className)

isJButton

public static boolean isJButton(java.lang.Class c)

isJButton

public static boolean isJButton(java.lang.String className)

isJLabel

public static boolean isJLabel(java.lang.Class c)

isJLabel

public static boolean isJLabel(java.lang.String className)

isJSeparator

public static boolean isJSeparator(java.lang.Class c)

isJSeparator

public static boolean isJSeparator(java.lang.String className)

isFiller

public static boolean isFiller(java.lang.Class c)

isFiller

public static boolean isFiller(java.lang.String className)

isJToggleButton

public static boolean isJToggleButton(java.lang.Class c)

isJToggleButton

public static boolean isJToggleButton(java.lang.String className)

isJMenu

public static boolean isJMenu(java.lang.Class c)

isJMenu

public static boolean isJMenu(java.lang.String className)

isJMenuBar

public static boolean isJMenuBar(java.lang.Class c)

isJMenuBar

public static boolean isJMenuBar(java.lang.String className)

isJToolBar

public static boolean isJToolBar(java.lang.Class c)

isJToolBar

public static boolean isJToolBar(java.lang.String className)

isJMenuItem

public static boolean isJMenuItem(java.lang.Class c)

isJMenuItem

public static boolean isJMenuItem(java.lang.String className)

isJRadioButtonMenuItem

public static boolean isJRadioButtonMenuItem(java.lang.Class c)

isJRadioButtonMenuItem

public static boolean isJRadioButtonMenuItem(java.lang.String className)

isJCheckBoxMenuItem

public static boolean isJCheckBoxMenuItem(java.lang.Class c)

isJCheckBoxMenuItem

public static boolean isJCheckBoxMenuItem(java.lang.String className)

isJPopupMenu

public static boolean isJPopupMenu(java.lang.Class c)

isJPopupMenu

public static boolean isJPopupMenu(java.lang.String className)

isToggleButtonMenuItem

public static boolean isToggleButtonMenuItem(java.lang.Class c)

isToggleButtonMenuItem

public static boolean isToggleButtonMenuItem(java.lang.String className)

isRadioButtonMenuItem

public static boolean isRadioButtonMenuItem(java.lang.Class c)

isRadioButtonMenuItem

public static boolean isRadioButtonMenuItem(java.lang.String className)

isJRadioButton

public static boolean isJRadioButton(java.lang.Class c)

isJRadioButton

public static boolean isJRadioButton(java.lang.String className)

isToggleCheckButtonMenuItem

public static boolean isToggleCheckButtonMenuItem(java.lang.Class c)

isToggleCheckButtonMenuItem

public static boolean isToggleCheckButtonMenuItem(java.lang.String className)

isButtonMenuItem

public static boolean isButtonMenuItem(java.lang.Class c)

isButtonMenuItem

public static boolean isButtonMenuItem(java.lang.String className)

isColor

public static boolean isColor(java.lang.String className)

setTitleLabel

public static void setTitleLabel(javax.swing.JLabel label)

setProgressBar

public static void setProgressBar(javax.swing.JProgressBar progress)