net.sf.dc.console
Class ComponentFactory

java.lang.Object
  extended bynet.sf.dc.console.ComponentFactory

public final class ComponentFactory
extends java.lang.Object

This class is the Component holder for the UI. The look and feel, as well as all the other preference are set here

Since:
1.3
Version:
0.5
Author:
Robert Jan van der Waals

Field Summary
static int _BOOKCATEGORYCOMBO
           
static int _CHECKBOX
           
static int _FILEFIELD
           
static int _FONTSELECTOR
           
static int _LONGTEXTFIELD
           
static int _MP3GENRECOMBO
           
static int _NUMBERFIELD
           
static int _PASSWORDFIELD
           
static int _PICTUREFIELD
           
static int _PROGRAMDEFINITIONFIELD
           
static int _RATINGCOMBOBOX
           
static int _REPORTTEXTPOSCOMBO
           
static int _SHORTTEXTFIELD
           
static int _SOFTWARECATEGORYCOMBO
           
static int _THEMEFIELD
           
static int _TIMEFIELD
           
static int _URLFIELD
           
static int _YEARCOMBO
           
static int _YESNOCOMBO
           
 
Constructor Summary
ComponentFactory()
           
 
Method Summary
static javax.swing.JComboBox getBookCatComboBox()
           
static javax.swing.border.Border getBorder()
          Returns a standard border
static javax.swing.JButton getButton(javax.swing.ImageIcon icon)
          Returns a standard button
static javax.swing.JButton getButton(javax.swing.ImageIcon icon, java.lang.String buttonText)
          Returns a standard button
static javax.swing.JButton getButton(java.lang.String buttonText)
          Returns a standard button
static javax.swing.JButton getButton(java.lang.String buttonText, int length)
          Returns a standard button
static javax.swing.JCheckBox getCheckBox(java.lang.String labelText)
          Returns a standard checkbox
static javax.swing.JColorChooser getColorChooser()
           
static javax.swing.JComboBox getComboBox()
          Returns an empty combobox
static javax.swing.JComponent getComponent(int componentIndex, java.lang.String sLabel, int maxTextLength)
           
static java.lang.Object getComponentValue(int fieldType, javax.swing.JComponent comp)
           
static DcTable getDCTable(boolean readonly, boolean caching)
           
static DcTable getDCTable(DCModule module, boolean readonly, boolean caching)
           
static java.awt.Color getDisabledColor()
          Returns the color for displaying disabled fields
static javax.swing.JEditorPane getEditorPane()
          Returns a standard editor pane
static javax.swing.JComboBox getFieldsComboBox(DcObject o)
          Returns a combobox with the Software database field names
static DcFileField getFileField(boolean save, boolean dirsOnly)
           
static DcFileField getFileField(boolean save, boolean dirsOnly, javax.swing.filechooser.FileFilter filter)
           
static DcFontSelector getFontSelector()
           
static javax.swing.Icon getIcon(java.lang.String iconLocation)
          Returns a standard icon
static javax.swing.JLabel getLabel(javax.swing.ImageIcon icon)
          Returns a standard label with an icon
static javax.swing.JLabel getLabel(java.lang.String labelText)
          Returns a standard label with a text
static javax.swing.JLabel getLabel(java.lang.String labelText, javax.swing.ImageIcon icon)
          Returns a standard label with a text and an icon
static javax.swing.JLabel getLabel(java.lang.String labelText, int length)
          Returns a standard label with a text
static DcList getList()
           
static DcList getList(java.util.Collection data)
           
static DcLongTextField getLongTextField(int maxTextLength)
          Returns a text area with all the defaults set
static javax.swing.JMenu getMenu(java.lang.String text)
           
static javax.swing.JMenuBar getMenuBar()
          Returns a standard menubar
static javax.swing.JMenuItem getMenuItem(javax.swing.ImageIcon icon, java.lang.String text)
           
static javax.swing.JMenuItem getMenuItem(java.lang.String text)
           
static javax.swing.JComboBox getMP3GenreComboBox()
          Returns a combobox with MP3 genres
static DcNumberField getNumberField()
           
static DcPasswordField getPasswordField()
           
static DcPictureField getPictureField(boolean allowZoom)
           
static DcPictureField getPictureField(boolean scaled, boolean allowZoom, boolean thumbnail)
           
static DcProgramDefinitionsField getProgramDefinitionField()
           
static DcRatingComboBox getRatingComboBox()
           
static javax.swing.JComboBox getRealYesNoComboBox()
          Returns a combobox with the items "yes" and "no", not starting with and empty String
static DcReportTextPositionCombo getReportTextPositionCombo()
           
static java.awt.Color getRequiredColor()
          Returns the color for displaying required fields
static DcShortTextField getShortTextField(int maxTextLength)
           
static javax.swing.JComboBox getSoftwareCatComboBox()
           
static java.awt.Font getStandardFont()
           
static java.awt.Font getSystemFont()
           
static javax.swing.JTabbedPane getTabbedPane()
          Returns a standard tabbed pane
static javax.swing.JButton getTableHeader(java.lang.String title)
          Returns a standard button
static java.awt.Color getTableHeaderColor()
          Returns the color for the table header
static javax.swing.JTextArea getTextArea()
          Returns a long text field with all the defaults set
static javax.swing.JTextField getTextField()
          Returns a textfield
static javax.swing.JTextField getTextFieldDisabled()
           
static javax.swing.JTextPane getTextPane()
           
static DcTimeField getTimeField()
           
static javax.swing.border.TitledBorder getTitleBorder(java.lang.String title)
          Returns a standard border with a title
static javax.swing.JTree getTree(javax.swing.tree.DefaultMutableTreeNode model)
           
static java.awt.Font getUnreadableFont()
           
static DcUrlField getURLField(int maxLength)
           
static javax.swing.JComboBox getYearComboBox()
           
static javax.swing.JComboBox getYesNoCombo()
          Returns a combobox with the items " ", "yes" and "no"
static void setComponentValue(int fieldType, javax.swing.JComponent comp, java.lang.Object value)
           
static javax.swing.JComponent setUneditable(javax.swing.JComponent comp)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_SOFTWARECATEGORYCOMBO

public static final int _SOFTWARECATEGORYCOMBO
See Also:
Constant Field Values

_YESNOCOMBO

public static final int _YESNOCOMBO
See Also:
Constant Field Values

_MP3GENRECOMBO

public static final int _MP3GENRECOMBO
See Also:
Constant Field Values

_LONGTEXTFIELD

public static final int _LONGTEXTFIELD
See Also:
Constant Field Values

_YEARCOMBO

public static final int _YEARCOMBO
See Also:
Constant Field Values

_CHECKBOX

public static final int _CHECKBOX
See Also:
Constant Field Values

_NUMBERFIELD

public static final int _NUMBERFIELD
See Also:
Constant Field Values

_SHORTTEXTFIELD

public static final int _SHORTTEXTFIELD
See Also:
Constant Field Values

_URLFIELD

public static final int _URLFIELD
See Also:
Constant Field Values

_PICTUREFIELD

public static final int _PICTUREFIELD
See Also:
Constant Field Values

_FONTSELECTOR

public static final int _FONTSELECTOR
See Also:
Constant Field Values

_TIMEFIELD

public static final int _TIMEFIELD
See Also:
Constant Field Values

_THEMEFIELD

public static final int _THEMEFIELD
See Also:
Constant Field Values

_RATINGCOMBOBOX

public static final int _RATINGCOMBOBOX
See Also:
Constant Field Values

_FILEFIELD

public static final int _FILEFIELD
See Also:
Constant Field Values

_PASSWORDFIELD

public static final int _PASSWORDFIELD
See Also:
Constant Field Values

_BOOKCATEGORYCOMBO

public static final int _BOOKCATEGORYCOMBO
See Also:
Constant Field Values

_REPORTTEXTPOSCOMBO

public static final int _REPORTTEXTPOSCOMBO
See Also:
Constant Field Values

_PROGRAMDEFINITIONFIELD

public static final int _PROGRAMDEFINITIONFIELD
See Also:
Constant Field Values
Constructor Detail

ComponentFactory

public ComponentFactory()
Method Detail

getComponent

public static final javax.swing.JComponent getComponent(int componentIndex,
                                                        java.lang.String sLabel,
                                                        int maxTextLength)

setUneditable

public static final javax.swing.JComponent setUneditable(javax.swing.JComponent comp)

getProgramDefinitionField

public static final DcProgramDefinitionsField getProgramDefinitionField()

getReportTextPositionCombo

public static final DcReportTextPositionCombo getReportTextPositionCombo()

getPasswordField

public static final DcPasswordField getPasswordField()

getFontSelector

public static final DcFontSelector getFontSelector()

getTimeField

public static final DcTimeField getTimeField()

getFileField

public static final DcFileField getFileField(boolean save,
                                             boolean dirsOnly)

getFileField

public static final DcFileField getFileField(boolean save,
                                             boolean dirsOnly,
                                             javax.swing.filechooser.FileFilter filter)

getList

public static final DcList getList(java.util.Collection data)

getList

public static final DcList getList()

getPictureField

public static final DcPictureField getPictureField(boolean scaled,
                                                   boolean allowZoom,
                                                   boolean thumbnail)

getPictureField

public static final DcPictureField getPictureField(boolean allowZoom)

getURLField

public static final DcUrlField getURLField(int maxLength)

getColorChooser

public static final javax.swing.JColorChooser getColorChooser()

getTree

public static final javax.swing.JTree getTree(javax.swing.tree.DefaultMutableTreeNode model)

getNumberField

public static final DcNumberField getNumberField()

getRatingComboBox

public static final DcRatingComboBox getRatingComboBox()

getFieldsComboBox

public static final javax.swing.JComboBox getFieldsComboBox(DcObject o)
Returns a combobox with the Software database field names

Returns:
(JComboBox) combobox filled with the database field names. The first item in the list is an empty String

getYearComboBox

public static final javax.swing.JComboBox getYearComboBox()

getMP3GenreComboBox

public static final javax.swing.JComboBox getMP3GenreComboBox()
Returns a combobox with MP3 genres

Returns:
combobox filled with MP3 genres. The first item is an empty String

getSoftwareCatComboBox

public static final javax.swing.JComboBox getSoftwareCatComboBox()

getBookCatComboBox

public static final javax.swing.JComboBox getBookCatComboBox()

getComboBox

public static final javax.swing.JComboBox getComboBox()
Returns an empty combobox

Returns:
(JComboBox) an empty combobox

getRealYesNoComboBox

public static final javax.swing.JComboBox getRealYesNoComboBox()
Returns a combobox with the items "yes" and "no", not starting with and empty String

Returns:
(JComboBox) combobox with the items "yes" and "no"

getCheckBox

public static final javax.swing.JCheckBox getCheckBox(java.lang.String labelText)
Returns a standard checkbox

Returns:
(JCheckBox) simple checbox, no prefenrences are set

getMenuItem

public static final javax.swing.JMenuItem getMenuItem(java.lang.String text)

getMenuItem

public static final javax.swing.JMenuItem getMenuItem(javax.swing.ImageIcon icon,
                                                      java.lang.String text)

getMenu

public static final javax.swing.JMenu getMenu(java.lang.String text)

getTableHeader

public static final javax.swing.JButton getTableHeader(java.lang.String title)
Returns a standard button

Returns:
(JButton) button, height 23

getButton

public static final javax.swing.JButton getButton(java.lang.String buttonText,
                                                  int length)
Returns a standard button

Parameters:
buttonText - display String, also used for naming the button
length - length of this button
Returns:
(JButton) button, height 23

getButton

public static final javax.swing.JButton getButton(javax.swing.ImageIcon icon)
Returns a standard button

Returns:
(JButton) button, height 23

getButton

public static final javax.swing.JButton getButton(javax.swing.ImageIcon icon,
                                                  java.lang.String buttonText)
Returns a standard button

Parameters:
buttonText - display String, also used for naming the button
Returns:
(JButton) button, height 23

getButton

public static final javax.swing.JButton getButton(java.lang.String buttonText)
Returns a standard button

Parameters:
buttonText - display String, also used for naming the button
Returns:
(JButton) button, height 23

getTextArea

public static final javax.swing.JTextArea getTextArea()
Returns a long text field with all the defaults set


getTextPane

public static final javax.swing.JTextPane getTextPane()

getLongTextField

public static final DcLongTextField getLongTextField(int maxTextLength)
Returns a text area with all the defaults set


getLabel

public static final javax.swing.JLabel getLabel(javax.swing.ImageIcon icon)
Returns a standard label with an icon

Parameters:
icon -

getLabel

public static final javax.swing.JLabel getLabel(java.lang.String labelText,
                                                javax.swing.ImageIcon icon)
Returns a standard label with a text and an icon

Returns:
(JLabel) label, no preferemces are set

getLabel

public static final javax.swing.JLabel getLabel(java.lang.String labelText,
                                                int length)
Returns a standard label with a text

Parameters:
length - length of this field
Returns:
(JLabel) label, no preferemces are set

getLabel

public static final javax.swing.JLabel getLabel(java.lang.String labelText)
Returns a standard label with a text

Returns:
(JLabel) label, no preferemces are set

getEditorPane

public static final javax.swing.JEditorPane getEditorPane()
Returns a standard editor pane

Returns:
editor pane with no preferences are set

getShortTextField

public static final DcShortTextField getShortTextField(int maxTextLength)

getTextFieldDisabled

public static final javax.swing.JTextField getTextFieldDisabled()

getTextField

public static final javax.swing.JTextField getTextField()
Returns a textfield

Returns:
JTextField textfield, height 23

getTabbedPane

public static final javax.swing.JTabbedPane getTabbedPane()
Returns a standard tabbed pane


getDCTable

public static final DcTable getDCTable(boolean readonly,
                                       boolean caching)

getDCTable

public static final DcTable getDCTable(DCModule module,
                                       boolean readonly,
                                       boolean caching)

getIcon

public static final javax.swing.Icon getIcon(java.lang.String iconLocation)
Returns a standard icon

Parameters:
iconLocation - location of the icon image

getMenuBar

public static final javax.swing.JMenuBar getMenuBar()
Returns a standard menubar


getYesNoCombo

public static final javax.swing.JComboBox getYesNoCombo()
Returns a combobox with the items " ", "yes" and "no"

Returns:
(JComboBox) a combox with the items "yes" and "no", the first item is an empty String

getBorder

public static final javax.swing.border.Border getBorder()
Returns a standard border


getTitleBorder

public static final javax.swing.border.TitledBorder getTitleBorder(java.lang.String title)
Returns a standard border with a title

Parameters:
title - display String

getStandardFont

public static final java.awt.Font getStandardFont()

getSystemFont

public static final java.awt.Font getSystemFont()

getUnreadableFont

public static final java.awt.Font getUnreadableFont()

getDisabledColor

public static final java.awt.Color getDisabledColor()
Returns the color for displaying disabled fields


getRequiredColor

public static final java.awt.Color getRequiredColor()
Returns the color for displaying required fields


getTableHeaderColor

public static final java.awt.Color getTableHeaderColor()
Returns the color for the table header


setComponentValue

public static final void setComponentValue(int fieldType,
                                           javax.swing.JComponent comp,
                                           java.lang.Object value)

getComponentValue

public static java.lang.Object getComponentValue(int fieldType,
                                                 javax.swing.JComponent comp)