net.sf.dc.console.components
Class ComponentFactory

java.lang.Object
  extended bynet.sf.dc.console.components.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.50
Author:
Robert-Jan van der Waals

Field Summary
static int _AUDIOCDREQFIELDTABLE
           
static int _AUDIOTRACKREQFIELDTABLE
           
static int _BOOKCATEGORYCOMBO
           
static int _BOOKREQUIREDFIELDTABLE
           
static int _CHECKBOX
           
static int _FILEFIELD
           
static int _FONTSELECTOR
           
static int _LONGTEXTFIELD
           
static int _MOVIEREQFIELDTABLE
           
static int _MP3GENRECOMBO
           
static int _MUSICREQFIELDTABLE
           
static int _NUMBERFIELD
           
static int _PASSWORDFIELD
           
static int _PICTUREFIELD
           
static int _RATINGCOMBOBOX
           
static int _REPORTTEXTPOSCOMBO
           
static int _SHORTTEXTFIELD
           
static int _SOFTWARECATEGORYCOMBO
           
static int _SOFTWAREREQFIELDTABLE
           
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.JComboBox getComboBox(int length)
          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 java.awt.Color getEvenRowColor()
           
static javax.swing.JComboBox getFieldsComboBox(DCObject o)
          Returns a combobox with the Software database field names
static FileField getFileField(boolean save, boolean dirsOnly)
           
static FileField getFileField(boolean save, boolean dirsOnly, javax.swing.filechooser.FileFilter filter)
           
static FontSelector 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 javax.swing.JList getList(java.util.Collection data)
           
static LongTextField 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 NumberField getNumberField()
           
static java.awt.Color getOddRowColor()
           
static PasswordField getPasswordField()
           
static PictureField getPictureField(boolean allowZoom)
           
static PictureField getPictureField(boolean scaled, boolean allowZoom, boolean thumbnail)
           
static RatingComboBox getRatingComboBox()
           
static javax.swing.JComboBox getRealYesNoComboBox()
          Returns a combobox with the items "yes" and "no", not starting with and empty String
static ReportTextPositionCombo getReportTextPositionCombo()
           
static java.awt.Color getRequiredColor()
          Returns the color for displaying required fields
static java.awt.Color getSelectionColor()
           
static ShortTextField getShortTextField(int maxTextLength)
           
static javax.swing.JComboBox getSoftwareCatComboBox()
           
static java.awt.Font getStandardFont()
          Returns the default font
static java.awt.Font getSystemFont()
          Returns the default font
static javax.swing.JTabbedPane getTabbedPane()
          Returns a standard tabbed pane
static java.awt.Color getTableColor()
          Returns the color for the background of tables
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 java.awt.Color getTextColor()
           
static javax.swing.JTextField getTextField()
          Returns a textfield
static TimeField 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 URLField 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

_SOFTWAREREQFIELDTABLE

public static final int _SOFTWAREREQFIELDTABLE
See Also:
Constant Field Values

_MUSICREQFIELDTABLE

public static final int _MUSICREQFIELDTABLE
See Also:
Constant Field Values

_MOVIEREQFIELDTABLE

public static final int _MOVIEREQFIELDTABLE
See Also:
Constant Field Values

_AUDIOCDREQFIELDTABLE

public static final int _AUDIOCDREQFIELDTABLE
See Also:
Constant Field Values

_AUDIOTRACKREQFIELDTABLE

public static final int _AUDIOTRACKREQFIELDTABLE
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

_BOOKREQUIREDFIELDTABLE

public static final int _BOOKREQUIREDFIELDTABLE
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
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)

getReportTextPositionCombo

public static final ReportTextPositionCombo getReportTextPositionCombo()

getPasswordField

public static final PasswordField getPasswordField()

getFontSelector

public static final FontSelector getFontSelector()

getTimeField

public static final TimeField getTimeField()

getFileField

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

getFileField

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

getList

public static final javax.swing.JList getList(java.util.Collection data)

getPictureField

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

getPictureField

public static final PictureField getPictureField(boolean allowZoom)

getURLField

public static final URLField 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 NumberField getNumberField()

getRatingComboBox

public static final RatingComboBox 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(int length)
Returns an empty combobox

Parameters:
length - length of this field

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


getLongTextField

public static final LongTextField 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:
(JEditorPane) editor pane, no preferences are set

getShortTextField

public static final ShortTextField getShortTextField(int maxTextLength)

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()
Returns the default font


getUnreadableFont

public static final java.awt.Font getUnreadableFont()

getSystemFont

public static final java.awt.Font getSystemFont()
Returns the default font


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


getOddRowColor

public static final java.awt.Color getOddRowColor()

getSelectionColor

public static final java.awt.Color getSelectionColor()

getEvenRowColor

public static final java.awt.Color getEvenRowColor()

getTextColor

public static final java.awt.Color getTextColor()

getTableColor

public static final java.awt.Color getTableColor()
Returns the color for the background of tables


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)