|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectzinger.swing.SwingUtil
public class SwingUtil
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 |
|---|
public static java.awt.Font createFont(java.lang.String propertyBase,
java.util.Properties config)
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). |
public static javax.swing.JMenuItem createMenuItem(java.lang.String propertyBase,
java.util.Properties config)
JMenuItem objects.
Constructs a JMenuItem obejct and passes it to
configButton(AbstractButton, String, Properties)
method.
configButton(javax.swing.AbstractButton, java.lang.String, java.util.Properties)
public static javax.swing.JButton createButton(java.lang.String propertyBase,
java.util.Properties config)
JButton objects.
Constructs a JButton obejct and passes it to
configButton(AbstractButton, String, Properties)
method.
configButton(javax.swing.AbstractButton, java.lang.String, java.util.Properties)
public static void configMenuItem(javax.swing.JMenuItem menuItem,
java.lang.String propertyBase,
java.util.Properties config)
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. |
configButton(javax.swing.AbstractButton, java.lang.String, java.util.Properties)
public static void configButton(javax.swing.AbstractButton button,
java.lang.String propertyBase,
java.util.Properties config)
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. |
createIcon(java.lang.String, java.util.Properties),
configComponent(javax.swing.JComponent, java.lang.String, java.util.Properties)
public static void configComponent(javax.swing.JComponent comp,
java.lang.String propertyBase,
java.util.Properties config)
JComponent objects.
Configures a JComponent object based on specified properties as follows:
| Property | Description |
|---|---|
<propertyBase>.tool_tip |
Tool tip text. May be null. |
public static javax.swing.Icon createIcon(java.lang.String propertyBase,
java.util.Properties config)
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. |
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||