zinger.swing
Class SwingUtil

java.lang.Object
  extended by zinger.swing.SwingUtil

public class SwingUtil
extends java.lang.Object

Utility and factory class for graphics (mostly Swing-related).


Method Summary
static void configButton(javax.swing.AbstractButton button, java.lang.String propertyBase, java.util.Properties config)
          Factory utility method for configuring AbstractButton objects.
static void configComponent(javax.swing.JComponent comp, java.lang.String propertyBase, java.util.Properties config)
          Factory utility method for configuring JComponent objects.
static void configMenuItem(javax.swing.JMenuItem menuItem, java.lang.String propertyBase, java.util.Properties config)
          Factory utility method for configuring JMenuItem objects.
static javax.swing.JButton createButton(java.lang.String propertyBase, java.util.Properties config)
          Factory method for JButton objects.
static java.awt.Font createFont(java.lang.String propertyBase, java.util.Properties config)
          Factory method for Font objects.
static javax.swing.Icon createIcon(java.lang.String propertyBase, java.util.Properties config)
          Factory method for Icon objects.
static javax.swing.JMenuItem createMenuItem(java.lang.String propertyBase, java.util.Properties config)
          Factory method for JMenuItem objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createFont

public static java.awt.Font createFont(java.lang.String propertyBase,
                                       java.util.Properties config)
Factory method for Font objects. Constructs a Font object based on specified properties as follows:
Property Description
<propertyBase>.name Font name.
<propertyBase>.size Font size. Must be Integer-parsable.
<propertyBase>.style Comma-separated list of applied font styles. Spaces are allowed, but do not separate the values. Possible allowed values are bold and italic (case insensitive).

Since:
0.8

createMenuItem

public static javax.swing.JMenuItem createMenuItem(java.lang.String propertyBase,
                                                   java.util.Properties config)
Factory method for JMenuItem objects. Constructs a JMenuItem obejct and passes it to configButton(AbstractButton, String, Properties) method.

See Also:
configButton(javax.swing.AbstractButton, java.lang.String, java.util.Properties)

createButton

public static javax.swing.JButton createButton(java.lang.String propertyBase,
                                               java.util.Properties config)
Factory method for JButton objects. Constructs a JButton obejct and passes it to configButton(AbstractButton, String, Properties) method.

See Also:
configButton(javax.swing.AbstractButton, java.lang.String, java.util.Properties)

configMenuItem

public static void configMenuItem(javax.swing.JMenuItem menuItem,
                                  java.lang.String propertyBase,
                                  java.util.Properties config)
Factory utility method for configuring JMenuItem objects. Configures a JMenuItem object and passes it to configButton(AbstractButton, String, Properties) method. The menu item is configured as follows:
Property Description
<propertyBase>.accelerator Keyboard accelerator string (as per javax.swing.KeyStroke). May be null.

Since:
1.0.3
See Also:
configButton(javax.swing.AbstractButton, java.lang.String, java.util.Properties)

configButton

public static void configButton(javax.swing.AbstractButton button,
                                java.lang.String propertyBase,
                                java.util.Properties config)
Factory utility method for configuring AbstractButton objects. Configures an AbstractButton object and passes it to configComponent(JComponent, String, Properties) method. The button is configured as follows:
Property Description
<propertyBase>.label Button text.
<propertyBase>.action Action command.
<propertyBase>.icon Icon base property that's given to createIcon(String, Properties) method. May be null.

See Also:
createIcon(java.lang.String, java.util.Properties), configComponent(javax.swing.JComponent, java.lang.String, java.util.Properties)

configComponent

public static void configComponent(javax.swing.JComponent comp,
                                   java.lang.String propertyBase,
                                   java.util.Properties config)
Factory utility method for configuring JComponent objects. Configures a JComponent object based on specified properties as follows:
Property Description
<propertyBase>.tool_tip Tool tip text. May be null.


createIcon

public static javax.swing.Icon createIcon(java.lang.String propertyBase,
                                          java.util.Properties config)
Factory method for Icon objects. Constructs an Icon object based on specified properties as follows:
Property Description
<propertyBase>.url Icon image URL. Note: mutually exclusive.
<propertyBase>.resource Icon image resource name to be loaded by the class loader that loaded this class.