project35.system
Class Project35UIFactory

java.lang.Object
  extended by project35.system.Project35UIFactory

public class Project35UIFactory
extends java.lang.Object

a factory for generating all UI components used in Project35 it was thought that centralising the production of UI code would simplify the UI code base and would allow other UI properties to be easily changed. Admittedly I don't yet know much about configuring things like look and feel and may revisit the idea of not using this class in future releases.


Copyright (c) 2008 Kevin Garwood for Project35. The original code was developed by Kevin Garwood for the University of Manchester. Revisions have been made for Project35, a project that is independent of that institution. This code is licensed under the Academic Free License version 3.0. The code attribution for the original code is included here:

Copyright (c) Kevin Garwood and University of Manchester 2007. All rights reserved. Licensed under the Academic Free License version 3.0. For more information on the terms and conditions, please see the file "LICENSE" that is included in this distribution.


Version:
1.0
Author:
Kevin Garwood (kgarwood@users.sourceforge.net)

Field Summary
static int LARGE_FONT
           
static int MEDIUM_FONT
           
static int SMALL_FONT
           
 
Constructor Summary
Project35UIFactory()
           
 
Method Summary
 void applyBoldFont(javax.swing.JComponent component)
           
 javax.swing.JButton createButton(java.lang.String buttonText)
           
 javax.swing.JCheckBox createCheckBox(java.lang.String checkBoxTitle)
           
 javax.swing.JCheckBoxMenuItem createCheckBoxMenuItem(java.lang.String menuItemName)
           
 javax.swing.JColorChooser createColourChooser()
           
 javax.swing.JComboBox createComboBox()
           
 javax.swing.JComboBox createComboBox(java.lang.String[] choices)
           
 javax.swing.JComboBox createComboBox(java.util.Vector choices)
           
 javax.swing.JEditorPane createEditorPane()
           
 javax.swing.JFileChooser createFileChooser()
           
 javax.swing.JFileChooser createFileChooser(java.io.File startingDirectory)
           
 javax.swing.JFileChooser createFileChooser(java.lang.String startingDirectoryName)
           
 java.awt.GridBagConstraints createGridBagConstraints()
           
 javax.swing.JTextArea createImmutableTextArea(int numberOfRows, int numberOfColumns)
           
 javax.swing.JTextField createImmutableTextField()
           
 javax.swing.JTextField createImmutableTextField(int numberOfColumns)
           
 javax.swing.JLabel createLabel()
           
 javax.swing.JLabel createLabel(java.lang.String labelText)
           
 javax.swing.JList createList()
           
 javax.swing.JList createList(javax.swing.AbstractListModel listModel)
           
 javax.swing.JList createList(java.lang.Object[] objects)
           
 javax.swing.JList createList(java.util.Vector vector)
           
 javax.swing.JMenu createMenu(java.lang.String menuName)
           
 javax.swing.JMenuBar createMenuBar()
           
 javax.swing.JMenuItem createMenuItem(java.lang.String menuItemName)
           
 javax.swing.JPanel createPanel()
           
 javax.swing.JPanel createPanel(java.awt.LayoutManager layoutManager)
           
 javax.swing.JPasswordField createPasswordField(int numberOfColumns)
           
 javax.swing.JPopupMenu createPopupMenu()
           
 javax.swing.JPopupMenu createPopupMenu(java.lang.String menuItemName)
           
 javax.swing.JRadioButton createRadioButton(java.lang.String buttonText)
           
 javax.swing.JRadioButtonMenuItem createRadioButtonMenuItem(java.lang.String buttonText)
           
 javax.swing.JScrollPane createScrollPane()
           
 javax.swing.JScrollPane createScrollPane(java.awt.Component component)
           
 javax.swing.JSeparator createSeparator()
           
 javax.swing.JSlider createSlider(int minimum, int maximum)
           
 javax.swing.JSplitPane createSplitPane(int orientation, java.awt.Component leftComponent, java.awt.Component rightComponent)
           
 javax.swing.JTabbedPane createTabbedPane()
           
 javax.swing.JTable createTable()
           
 javax.swing.JTable createTable(javax.swing.table.TableModel tableModel)
           
 javax.swing.JTextArea createTextArea()
           
 javax.swing.JTextArea createTextArea(int numberOfRows, int numberOfColumns)
           
 javax.swing.JTextField createTextField()
           
 javax.swing.JTextField createTextField(int numberOfColumns)
           
 javax.swing.JTree createTree()
           
 javax.swing.JTree createTree(javax.swing.tree.TreeModel treeModel)
           
 javax.swing.JTree createTree(javax.swing.tree.TreeNode treeNode)
           
 java.awt.Font getBoldFont()
           
 java.awt.Color getButtonBackground()
          Get the value of buttonBackground.
 java.lang.String getDarkYellow()
           
 java.awt.Color getErrorMessageColour()
          Get the value of errorMessageColour.
static Project35UIFactory getFactory()
           
 java.awt.Color getFieldBackground()
          Get the value of fieldBackground.
 java.awt.Color getFormBackground()
          Get the value of formBackground.
 java.awt.Font getLargeFont()
           
 java.lang.String getLightYellow()
           
 java.awt.Font getMediumFont()
           
 java.awt.Font getPlainFont()
           
 java.awt.Font getSmallFont()
           
 java.awt.Color getTextColour()
          Get the value of textColour.
 java.awt.Color getTreeNodeCommentsColour()
           
 java.awt.Color getTreeNodeDeletedColour()
           
 java.awt.Color getTreeNodeErrorColour()
           
 java.awt.Color getTreeNodeGhostBorderColour()
           
 java.awt.Color getTreeNodeGhostTextColour()
           
 java.awt.Color getTreeNodeSearchResultColour()
           
 java.awt.Color getTreeNodeSelectedColour()
           
 boolean isLeftToRight()
           
 void registerComponent(javax.swing.JComponent component)
           
 void setBasicProperties(javax.swing.JComponent component)
           
 void setButtonBackground(java.awt.Color buttonBackground)
          Set the value of buttonBackground.
 void setButtonProperties(javax.swing.JButton button)
           
 void setCheckBoxMenuProperties(javax.swing.JCheckBoxMenuItem checkBoxMenuItem)
           
 void setCheckBoxProperties(javax.swing.JCheckBox checkBox)
           
 void setErrorMessageColour(java.awt.Color errorMessageColour)
          Set the value of errorMessageColour.
 void setFieldBackground(java.awt.Color fieldBackground)
          Set the value of fieldBackground.
 void setFont(int fontType)
           
 void setFormBackground(java.awt.Color formBackground)
          Set the value of formBackground.
 void setLabelProperties(javax.swing.JLabel label)
           
 void setListProperties(javax.swing.JList list)
           
 void setLocale(java.util.Locale locale)
           
 void setMenuBarProperties(javax.swing.JMenuBar menuBar)
           
 void setMenuItemProperties(javax.swing.JMenuItem menuItem)
           
 void setMenuProperties(javax.swing.JMenu menu)
           
 void setPanelProperties(javax.swing.JPanel panel)
           
 void setScrollPaneProperties(javax.swing.JScrollPane scrollPane)
           
 void setSelectedItemBackground(java.awt.Color selectedItemBackground)
           
 void setTextColour(java.awt.Color textColour)
          Set the value of textColour.
 void setTreeProperties(javax.swing.JTree tree)
           
 void unregisterComponent(javax.swing.JComponent component)
           
 void updateUISettings()
          this is used by the configuration tool to help restore UIDefaults after a test application has been closed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SMALL_FONT

public static final int SMALL_FONT
See Also:
Constant Field Values

MEDIUM_FONT

public static final int MEDIUM_FONT
See Also:
Constant Field Values

LARGE_FONT

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

Project35UIFactory

public Project35UIFactory()
Method Detail

getFactory

public static Project35UIFactory getFactory()

getSmallFont

public java.awt.Font getSmallFont()

getMediumFont

public java.awt.Font getMediumFont()

getLargeFont

public java.awt.Font getLargeFont()

getLightYellow

public java.lang.String getLightYellow()

getDarkYellow

public java.lang.String getDarkYellow()

setFont

public void setFont(int fontType)

createColourChooser

public javax.swing.JColorChooser createColourChooser()

createGridBagConstraints

public java.awt.GridBagConstraints createGridBagConstraints()

getPlainFont

public java.awt.Font getPlainFont()

getBoldFont

public java.awt.Font getBoldFont()

applyBoldFont

public void applyBoldFont(javax.swing.JComponent component)

getTreeNodeCommentsColour

public java.awt.Color getTreeNodeCommentsColour()

getTreeNodeGhostTextColour

public java.awt.Color getTreeNodeGhostTextColour()

getTreeNodeGhostBorderColour

public java.awt.Color getTreeNodeGhostBorderColour()

getTreeNodeDeletedColour

public java.awt.Color getTreeNodeDeletedColour()

getTreeNodeSelectedColour

public java.awt.Color getTreeNodeSelectedColour()

getTreeNodeSearchResultColour

public java.awt.Color getTreeNodeSearchResultColour()

getTreeNodeErrorColour

public java.awt.Color getTreeNodeErrorColour()

createPanel

public javax.swing.JPanel createPanel()

createPanel

public javax.swing.JPanel createPanel(java.awt.LayoutManager layoutManager)

createEditorPane

public javax.swing.JEditorPane createEditorPane()

createSlider

public javax.swing.JSlider createSlider(int minimum,
                                        int maximum)

createSplitPane

public javax.swing.JSplitPane createSplitPane(int orientation,
                                              java.awt.Component leftComponent,
                                              java.awt.Component rightComponent)

createTable

public javax.swing.JTable createTable(javax.swing.table.TableModel tableModel)

createTabbedPane

public javax.swing.JTabbedPane createTabbedPane()

createTextField

public javax.swing.JTextField createTextField()

createTextField

public javax.swing.JTextField createTextField(int numberOfColumns)

createPasswordField

public javax.swing.JPasswordField createPasswordField(int numberOfColumns)

createImmutableTextField

public javax.swing.JTextField createImmutableTextField(int numberOfColumns)

createImmutableTextField

public javax.swing.JTextField createImmutableTextField()

createImmutableTextArea

public javax.swing.JTextArea createImmutableTextArea(int numberOfRows,
                                                     int numberOfColumns)

createTextArea

public javax.swing.JTextArea createTextArea()

createTextArea

public javax.swing.JTextArea createTextArea(int numberOfRows,
                                            int numberOfColumns)

setListProperties

public void setListProperties(javax.swing.JList list)

setBasicProperties

public void setBasicProperties(javax.swing.JComponent component)

createButton

public javax.swing.JButton createButton(java.lang.String buttonText)

createRadioButtonMenuItem

public javax.swing.JRadioButtonMenuItem createRadioButtonMenuItem(java.lang.String buttonText)

createRadioButton

public javax.swing.JRadioButton createRadioButton(java.lang.String buttonText)

createLabel

public javax.swing.JLabel createLabel()

createLabel

public javax.swing.JLabel createLabel(java.lang.String labelText)

createComboBox

public javax.swing.JComboBox createComboBox(java.util.Vector choices)

createComboBox

public javax.swing.JComboBox createComboBox(java.lang.String[] choices)

createComboBox

public javax.swing.JComboBox createComboBox()

createMenuBar

public javax.swing.JMenuBar createMenuBar()

setMenuBarProperties

public void setMenuBarProperties(javax.swing.JMenuBar menuBar)

createMenu

public javax.swing.JMenu createMenu(java.lang.String menuName)

createMenuItem

public javax.swing.JMenuItem createMenuItem(java.lang.String menuItemName)

createCheckBox

public javax.swing.JCheckBox createCheckBox(java.lang.String checkBoxTitle)

createCheckBoxMenuItem

public javax.swing.JCheckBoxMenuItem createCheckBoxMenuItem(java.lang.String menuItemName)

createScrollPane

public javax.swing.JScrollPane createScrollPane()

createScrollPane

public javax.swing.JScrollPane createScrollPane(java.awt.Component component)

createFileChooser

public javax.swing.JFileChooser createFileChooser(java.io.File startingDirectory)

createFileChooser

public javax.swing.JFileChooser createFileChooser(java.lang.String startingDirectoryName)

createFileChooser

public javax.swing.JFileChooser createFileChooser()

createList

public javax.swing.JList createList(java.lang.Object[] objects)

createList

public javax.swing.JList createList(java.util.Vector vector)

createList

public javax.swing.JList createList(javax.swing.AbstractListModel listModel)

createPopupMenu

public javax.swing.JPopupMenu createPopupMenu()

createPopupMenu

public javax.swing.JPopupMenu createPopupMenu(java.lang.String menuItemName)

createTable

public javax.swing.JTable createTable()

createTree

public javax.swing.JTree createTree(javax.swing.tree.TreeModel treeModel)

createTree

public javax.swing.JTree createTree()

createTree

public javax.swing.JTree createTree(javax.swing.tree.TreeNode treeNode)

createList

public javax.swing.JList createList()

createSeparator

public javax.swing.JSeparator createSeparator()

setScrollPaneProperties

public void setScrollPaneProperties(javax.swing.JScrollPane scrollPane)

setLabelProperties

public void setLabelProperties(javax.swing.JLabel label)

setMenuProperties

public void setMenuProperties(javax.swing.JMenu menu)

setMenuItemProperties

public void setMenuItemProperties(javax.swing.JMenuItem menuItem)

setCheckBoxMenuProperties

public void setCheckBoxMenuProperties(javax.swing.JCheckBoxMenuItem checkBoxMenuItem)

setCheckBoxProperties

public void setCheckBoxProperties(javax.swing.JCheckBox checkBox)

setButtonProperties

public void setButtonProperties(javax.swing.JButton button)

setPanelProperties

public void setPanelProperties(javax.swing.JPanel panel)

registerComponent

public void registerComponent(javax.swing.JComponent component)

unregisterComponent

public void unregisterComponent(javax.swing.JComponent component)

getTextColour

public java.awt.Color getTextColour()
Get the value of textColour.

Returns:
value of textColour.

getFieldBackground

public java.awt.Color getFieldBackground()
Get the value of fieldBackground.

Returns:
value of fieldBackground.

getFormBackground

public java.awt.Color getFormBackground()
Get the value of formBackground.

Returns:
value of formBackground.

getButtonBackground

public java.awt.Color getButtonBackground()
Get the value of buttonBackground.

Returns:
value of buttonBackground.

getErrorMessageColour

public java.awt.Color getErrorMessageColour()
Get the value of errorMessageColour.

Returns:
value of errorMessageColour.

setLocale

public void setLocale(java.util.Locale locale)

isLeftToRight

public boolean isLeftToRight()

setTreeProperties

public void setTreeProperties(javax.swing.JTree tree)

setTextColour

public void setTextColour(java.awt.Color textColour)
Set the value of textColour.

Parameters:
textColour - Value to assign to textColour.

setFormBackground

public void setFormBackground(java.awt.Color formBackground)
Set the value of formBackground.

Parameters:
formBackground - Value to assign to formBackground.

setFieldBackground

public void setFieldBackground(java.awt.Color fieldBackground)
Set the value of fieldBackground.

Parameters:
fieldBackground - Value to assign to fieldBackground.

setButtonBackground

public void setButtonBackground(java.awt.Color buttonBackground)
Set the value of buttonBackground.

Parameters:
buttonBackground - Value to assign to buttonBackground.

setSelectedItemBackground

public void setSelectedItemBackground(java.awt.Color selectedItemBackground)

setErrorMessageColour

public void setErrorMessageColour(java.awt.Color errorMessageColour)
Set the value of errorMessageColour.

Parameters:
errorMessageColour - Value to assign to errorMessageColour.

updateUISettings

public void updateUISettings()
this is used by the configuration tool to help restore UIDefaults after a test application has been closed