org.jets3t.gui.skins
Class SkinsFactory

java.lang.Object
  extended by org.jets3t.gui.skins.SkinsFactory

public class SkinsFactory
extends Object

Manages the creation of skinned GUI elements. Skinned elements are created using the following process:

  1. Instantiate a skin-specific class in the skin's package org.jets3t.gui.skins.<skinName>
  2. 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 nameExtends
SkinnedJButtonjavax.swing.JButton
SkinnedJHtmlLabelorg.jets3t.gui.JHtmlLabel
SkinnedJPaneljavax.swing.JPanel
SkinnedLookAndFeeljavax.swing.plaf.metal.MetalLookAndFeel

Author:
James Murty

Field Summary
static String NO_SKIN
           
 
Method Summary
 JButton createSkinnedJButton(String itemName)
           
 JCheckBox createSkinnedJCheckBox(String itemName)
           
 JComboBox createSkinnedJComboBox(String itemName)
           
 JHtmlLabel createSkinnedJHtmlLabel(String itemName)
           
 JHtmlLabel createSkinnedJHtmlLabel(String itemName, HyperlinkActivatedListener hyperlinkListener)
           
 JMenuItem createSkinnedJMenuItem(String itemName)
           
 JPanel createSkinnedJPanel(String itemName)
           
 JPasswordField createSkinnedJPasswordField(String itemName)
           
 JPopupMenu createSkinnedJPopupMenu(String itemName)
           
 JProgressBar createSkinnedJProgressBar(String itemName, int min, int max)
           
 JRadioButton createSkinnedJRadioButton(String itemName)
           
 JScrollPane createSkinnedJScrollPane(String itemName)
           
 JScrollPane createSkinnedJScrollPane(String itemName, Object view)
           
 JTable createSkinnedJTable(String itemName)
           
 JTextArea createSkinnedJTextArea(String itemName)
           
 JTextField createSkinnedJTextField(String itemName)
           
 LookAndFeel createSkinnedMetalTheme(String itemName)
           
static SkinsFactory getInstance(Properties properties)
          Provides a skin factory initialised with skin-specific properties from the provided properties set.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_SKIN

public static final String NO_SKIN
See Also:
Constant Field Values
Method Detail

getInstance

public static SkinsFactory getInstance(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 LookAndFeel createSkinnedMetalTheme(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 JButton createSkinnedJButton(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 JRadioButton createSkinnedJRadioButton(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 JComboBox createSkinnedJComboBox(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 JCheckBox createSkinnedJCheckBox(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 JPanel createSkinnedJPanel(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 JTable createSkinnedJTable(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 JScrollPane createSkinnedJScrollPane(String itemName,
                                            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 JScrollPane createSkinnedJScrollPane(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(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(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 JPasswordField createSkinnedJPasswordField(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 JTextField createSkinnedJTextField(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 JTextArea createSkinnedJTextArea(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 JPopupMenu createSkinnedJPopupMenu(String itemName)

createSkinnedJMenuItem

public JMenuItem createSkinnedJMenuItem(String itemName)

createSkinnedJProgressBar

public JProgressBar createSkinnedJProgressBar(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.