org.jets3t.gui.skins
Class SkinsFactory
java.lang.Object
org.jets3t.gui.skins.SkinsFactory
public class SkinsFactory
- extends java.lang.Object
Manages the creation of skinned GUI elements.
Skinned elements are created using the following process:
- Instantiate a skin-specific class in the skin's package
org.jets3t.gui.skins.<skinName>
- If a skin-specific class is not available or cannot be created,
instantiate a generic GUI class instead
Skinned classes are specially-named extensions to standard Swing classes, which must have a
constructor of the form
public SkinnedJButton(Properties skinProperties, String itemName)
.
This constructor allows skinned GUI elements to change their look or behaviour based on any
skin-specific properties that are provided, or based on the name of a specific GUI element.
The skinned class names supported by this factory include:
Class name | Extends |
SkinnedJButton | javax.swing.JButton |
SkinnedJHtmlLabel | org.jets3t.gui.JHtmlLabel |
SkinnedJPanel | javax.swing.JPanel |
SkinnedLookAndFeel | javax.swing.plaf.metal.MetalLookAndFeel |
- Author:
- James Murty
Field Summary |
static java.lang.String |
NO_SKIN
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NO_SKIN
public static final java.lang.String NO_SKIN
- See Also:
- Constant Field Values
getInstance
public static SkinsFactory getInstance(java.util.Properties properties)
- Provides a skin factory initialised with skin-specific properties from the provided
properties set. Skin-specific properties are identified as those properties with the
prefix
skin.<skinName>.
- Parameters:
properties
- a set of properties that may contain skin-specific properties.
- Returns:
- the skins factory initialised with skin settings.
createSkinnedMetalTheme
public javax.swing.LookAndFeel createSkinnedMetalTheme(java.lang.String itemName)
- Parameters:
itemName
- the name of this specific item in the GUI, which may be used to determine how the skinned
item should look or behave.
- Returns:
- a
SkinnedLookAndFeel
class implementation for the current skin, or the default
system LookAndFeel if no skin-specific implementation is available.
createSkinnedJButton
public javax.swing.JButton createSkinnedJButton(java.lang.String itemName)
- Parameters:
itemName
- the name of this specific item in the GUI, which may be used to determine how the skinned
item should look or behave.
- Returns:
- a
SkinnedJButton
class implementation for the current skin, or a default
JButton if no skin-specific implementation is available.
createSkinnedJRadioButton
public javax.swing.JRadioButton createSkinnedJRadioButton(java.lang.String itemName)
- Parameters:
itemName
- the name of this specific item in the GUI, which may be used to determine how the skinned
item should look or behave.
- Returns:
- a
SkinnedJRadioButton
class implementation for the current skin, or a default
JRadioButton if no skin-specific implementation is available.
createSkinnedJComboBox
public javax.swing.JComboBox createSkinnedJComboBox(java.lang.String itemName)
- Parameters:
itemName
- the name of this specific item in the GUI, which may be used to determine how the skinned
item should look or behave.
- Returns:
- a
SkinnedJComboBox
class implementation for the current skin, or a default
JComboBox if no skin-specific implementation is available.
createSkinnedJCheckBox
public javax.swing.JCheckBox createSkinnedJCheckBox(java.lang.String itemName)
- Parameters:
itemName
- the name of this specific item in the GUI, which may be used to determine how the skinned
item should look or behave.
- Returns:
- a
SkinnedJComboBox
class implementation for the current skin, or a default
JComboBox if no skin-specific implementation is available.
createSkinnedJPanel
public javax.swing.JPanel createSkinnedJPanel(java.lang.String itemName)
- Parameters:
itemName
- the name of this specific item in the GUI, which may be used to determine how the skinned
item should look or behave.
- Returns:
- a
SkinnedJPanel
class implementation for the current skin, or a default
JPanel if no skin-specific implementation is available.
createSkinnedJTable
public javax.swing.JTable createSkinnedJTable(java.lang.String itemName)
- Parameters:
itemName
- the name of this specific item in the GUI, which may be used to determine how the skinned
item should look or behave.
- Returns:
- a
SkinnedJTable
class implementation for the current skin, or a default
JPanel if no skin-specific implementation is available.
createSkinnedJScrollPane
public javax.swing.JScrollPane createSkinnedJScrollPane(java.lang.String itemName,
java.lang.Object view)
- Parameters:
itemName
- the name of this specific item in the GUI, which may be used to determine how the skinned
item should look or behave.view
- the client's viewport view to be used.
- Returns:
- a
SkinnedJScrollPane
class implementation for the current skin, or a default
JScrollPane if no skin-specific implementation is available.
createSkinnedJScrollPane
public javax.swing.JScrollPane createSkinnedJScrollPane(java.lang.String itemName)
- Parameters:
itemName
- the name of this specific item in the GUI, which may be used to determine how the skinned
item should look or behave.
- Returns:
- a
SkinnedJScrollPane
class implementation for the current skin, or a default
JScrollPane if no skin-specific implementation is available.
createSkinnedJHtmlLabel
public JHtmlLabel createSkinnedJHtmlLabel(java.lang.String itemName,
HyperlinkActivatedListener hyperlinkListener)
- Parameters:
itemName
- the name of this specific item in the GUI, which may be used to determine how the skinned
item should look or behave.
- Returns:
- a
SkinnedJLabel
class implementation for the current skin, or a default
JHtmlLabel if no skin-specific implementation is available.
createSkinnedJHtmlLabel
public JHtmlLabel createSkinnedJHtmlLabel(java.lang.String itemName)
- Parameters:
itemName
- the name of this specific item in the GUI, which may be used to determine how the skinned
item should look or behave.
- Returns:
- a
SkinnedJLabel
class implementation for the current skin, or a default
JHtmlLabel if no skin-specific implementation is available.
createSkinnedJPasswordField
public javax.swing.JPasswordField createSkinnedJPasswordField(java.lang.String itemName)
- Parameters:
itemName
- the name of this specific item in the GUI, which may be used to determine how the skinned
item should look or behave.
- Returns:
- a
SkinnedJPasswordField
class implementation for the current skin, or a default
JPasswordField if no skin-specific implementation is available.
createSkinnedJTextField
public javax.swing.JTextField createSkinnedJTextField(java.lang.String itemName)
- Parameters:
itemName
- the name of this specific item in the GUI, which may be used to determine how the skinned
item should look or behave.
- Returns:
- a
SkinnedJTextField
class implementation for the current skin, or a default
JTextField if no skin-specific implementation is available.
createSkinnedJTextArea
public javax.swing.JTextArea createSkinnedJTextArea(java.lang.String itemName)
- Parameters:
itemName
- the name of this specific item in the GUI, which may be used to determine how the skinned
item should look or behave.
- Returns:
- a
SkinnedJTextArea
class implementation for the current skin, or a default
JTextArea if no skin-specific implementation is available.
createSkinnedJPopupMenu
public javax.swing.JPopupMenu createSkinnedJPopupMenu(java.lang.String itemName)
createSkinnedJMenuItem
public javax.swing.JMenuItem createSkinnedJMenuItem(java.lang.String itemName)
createSkinnedJProgressBar
public javax.swing.JProgressBar createSkinnedJProgressBar(java.lang.String itemName,
int min,
int max)
- Parameters:
itemName
- the name of this specific item in the GUI, which may be used to determine how the skinned
item should look or behave.
- Returns:
- a
SkinnedJProgressBar
class implementation for the current skin, or a default
JProgressBar if no skin-specific implementation is available.