rjw.dc.console.components
Class ComponentFactory

java.lang.Object
  |
  +--rjw.dc.console.components.ComponentFactory

public 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:
DC0.50
Author:
Robert-Jan van der Waals

Nested Class Summary
static class ComponentFactory.RefreshSoftwareCategories
          Forces a refresh of the content of the Software categories combobox
 
Field Summary
static int _CHECKBOX
           
static int _LONGTEXTFIELD
           
static int _MOVIECODECCOMBO
           
static int _MP3GENRECOMBO
           
static int _NUMBERFIELD
           
static int _SHORTTEXTFIELD
           
static int _SOFTWARETYPECOMBO
           
static int _YEARCOMBO
           
static int _YESNOCOMBO
           
 
Constructor Summary
ComponentFactory()
           
 
Method Summary
static javax.swing.JTable convertToMovieTable(javax.swing.JTable table)
           
static javax.swing.JTable convertToMP3Table(javax.swing.JTable table)
           
static javax.swing.JTable convertToSoftwareTable(javax.swing.JTable table)
           
static javax.swing.JComboBox fillSoftwareCatagories(javax.swing.JComboBox typeComboBox)
          Adds the software catagories to the Software type combobox.
static javax.swing.border.TitledBorder getBorder(java.lang.String title)
          Returns a standard border with a title
static javax.swing.JButton getButton(javax.swing.ImageIcon icon)
          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 java.awt.Component getComponent(int componentIndex, java.lang.String sLabel, int maxTextLength)
           
static java.awt.Font getDefaultFont()
          Returns the default font for the menubar
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()
          Returns a combobox with the Software database field names
static javax.swing.Icon getIcon(java.lang.String iconLocation)
          Returns a standard 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, int length)
          Returns a standard label with a text
static java.awt.GridBagLayout getLayoutManager()
           
static LongTextField getLongTextField(int maxTextLength)
          Returns a text area with all the defaults set
static javax.swing.JMenuBar getMenuBar()
          Returns a standard menubar
static java.awt.Font getMenuBarFont()
          Returns the default font for the menubar
static java.awt.Font getMenuBarFontCombo()
          Returns the default font for comboboxes in the menubar
static javax.swing.JComboBox getMovieCodecComboBox()
          Returns a combobox with Movie codecs
static javax.swing.JTable getMovieTable(javax.swing.table.DefaultTableModel tableModel, boolean autoScrolls)
          Returns a table for presentation of Movie objects
static javax.swing.JComboBox getMP3GenreComboBox()
          Returns a combobox with MP3 genres
static javax.swing.JTable getMP3Table(javax.swing.table.DefaultTableModel tableModel, boolean autoScrolls)
          Returns a table for presentation of MP3 objects
static NumberField getNumberField()
           
static javax.swing.JComboBox getRealYesNoComboBox()
          Returns a combobox with the items "yes" and "no", not starting with and empty String
static ShortTextField getShortTextField(int maxTextLength)
           
static javax.swing.JTable getSimpleTable(javax.swing.table.TableModel tableModel, boolean autoScrolls)
          Returns a standard table
static javax.swing.JComboBox getSoftwareCatagoriesComboBox()
          Returns a combobox with Sofware types (Catagories
static javax.swing.JTable getSoftwareTable(javax.swing.table.DefaultTableModel tableModel, boolean autoScrolls)
          Returns a table for presentation of Software objects
static java.awt.Font getStandardFont()
          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 java.awt.Color getTableHeaderColor()
          Returns the color for the table header
static java.awt.Font getTableHeaderFont()
          Returns the default font for the menubar
static javax.swing.table.DefaultTableCellRenderer getTableHeaderRenderer()
           
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 getTextField(int length)
          Returns a textfield
static javax.swing.JTree getTree(javax.swing.tree.DefaultMutableTreeNode model)
           
static javax.swing.JComboBox getYearComboBox()
           
static javax.swing.JComboBox getYesNoCombo()
          Returns a combobox with the items " ", "yes" and "no"
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_SOFTWARETYPECOMBO

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

_MOVIECODECCOMBO

public static final int _MOVIECODECCOMBO
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
Constructor Detail

ComponentFactory

public ComponentFactory()
Method Detail

getComponent

public static java.awt.Component getComponent(int componentIndex,
                                              java.lang.String sLabel,
                                              int maxTextLength)

getColorChooser

public static javax.swing.JColorChooser getColorChooser()

getTree

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

getLayoutManager

public static java.awt.GridBagLayout getLayoutManager()

getNumberField

public static NumberField getNumberField()

getFieldsComboBox

public static javax.swing.JComboBox getFieldsComboBox()
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 javax.swing.JComboBox getYearComboBox()

getMovieCodecComboBox

public static javax.swing.JComboBox getMovieCodecComboBox()
Returns a combobox with Movie codecs

Returns:
(JComboBox) combobox filled with Movie codecs. The first item is an empty String

getMP3GenreComboBox

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

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

getSoftwareCatagoriesComboBox

public static javax.swing.JComboBox getSoftwareCatagoriesComboBox()
Returns a combobox with Sofware types (Catagories

Returns:
(JComboBox) combobox filled with Software types. The first item is an empty String.

fillSoftwareCatagories

public static javax.swing.JComboBox fillSoftwareCatagories(javax.swing.JComboBox typeComboBox)
Adds the software catagories to the Software type combobox. The Software types are loaded from the CatagoryCollection class.


getComboBox

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

Parameters:
length - length of this field
Returns:
(JComboBox) an empty combobox

getComboBox

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

Returns:
(JComboBox) an empty combobox

getRealYesNoComboBox

public static 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 javax.swing.JCheckBox getCheckBox(java.lang.String labelText)
Returns a standard checkbox

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

getButton

public static 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 javax.swing.JButton getButton(javax.swing.ImageIcon icon)
Returns a standard button

Returns:
(JButton) button, height 23

getButton

public static 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 javax.swing.JTextArea getTextArea()
Returns a long text field with all the defaults set


getLongTextField

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


getLabel

public static 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 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 javax.swing.JEditorPane getEditorPane()
Returns a standard editor pane

Returns:
(JEditorPane) editor pane, no preferences are set

getShortTextField

public static ShortTextField getShortTextField(int maxTextLength)

getTextField

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

Parameters:
length - length of this field

getTextField

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

Returns:
JTextField textfield, height 23

getTabbedPane

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

Returns:
(JTabbedPane) tabbed pane, no prefences are set

getIcon

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

Parameters:
iconLocation - location of the icon image
Returns:
(Icon) normal icon

getMenuBar

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

Returns:
(JMenuBar) standard menubar, no prefences are set

getYesNoCombo

public static 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

getSoftwareTable

public static javax.swing.JTable getSoftwareTable(javax.swing.table.DefaultTableModel tableModel,
                                                  boolean autoScrolls)
Returns a table for presentation of Software objects

Parameters:
tableModel - model to be used upon this tabel
autoScrolls - specifies if the autoscrolls should be used
Returns:
(JTable) table with table header names and comboboxes for Software types and booleans

convertToSoftwareTable

public static javax.swing.JTable convertToSoftwareTable(javax.swing.JTable table)

getTableHeaderRenderer

public static javax.swing.table.DefaultTableCellRenderer getTableHeaderRenderer()

getMP3Table

public static javax.swing.JTable getMP3Table(javax.swing.table.DefaultTableModel tableModel,
                                             boolean autoScrolls)
Returns a table for presentation of MP3 objects

Parameters:
tableModel - model to be used upon this tabel
autoScrolls - specifies if the autoscrolls should be used
Returns:
(JTable) table with table header names and comboboxes for MP3 genres and booleans

convertToMP3Table

public static javax.swing.JTable convertToMP3Table(javax.swing.JTable table)

getMovieTable

public static javax.swing.JTable getMovieTable(javax.swing.table.DefaultTableModel tableModel,
                                               boolean autoScrolls)
Returns a table for presentation of Movie objects

Parameters:
tableModel - model to be used upon this tabel
autoScrolls - specifies if the autoscrolls should be used
Returns:
(JTable) table with table header names and comboboxes for MP3 genres and booleans

convertToMovieTable

public static javax.swing.JTable convertToMovieTable(javax.swing.JTable table)

getSimpleTable

public static javax.swing.JTable getSimpleTable(javax.swing.table.TableModel tableModel,
                                                boolean autoScrolls)
Returns a standard table

Parameters:
tableModel - model to be used upon this tabel
autoScrolls - specifies if the autoscrolls should be used
Returns:
(JTable) table without headers and components

getBorder

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

Parameters:
title - display String
Returns:
(TitledBorder) border with text

getDefaultFont

public static java.awt.Font getDefaultFont()
Returns the default font for the menubar

Returns:
(Font) Arial Narrow, normal, pixelheight 9

getTableHeaderFont

public static java.awt.Font getTableHeaderFont()
Returns the default font for the menubar

Returns:
(Font) Comic Sans MS font, bold, pixelheight 9

getMenuBarFont

public static java.awt.Font getMenuBarFont()
Returns the default font for the menubar

Returns:
(Font) Comic Sans MS font, bold, pixelheight 9

getMenuBarFontCombo

public static java.awt.Font getMenuBarFontCombo()
Returns the default font for comboboxes in the menubar

Returns:
(Font) Comic Sans MS font, bold, pixelheight 11

getStandardFont

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

Returns:
(Font) Verdana font, pixelheight 11

getDisabledColor

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

Returns:
(Color) light grey color, red 204, green 204, blue 204

getTableHeaderColor

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

Returns:
(Color) light grey color, red 204, green 204, blue 204

getTableColor

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

Returns:
(Color) light yellow, red 246, green 246, blue 230