org.shaker.dwu
Class GUIFactory

java.lang.Object
  |
  +--org.shaker.dwu.GUIFactory

final class GUIFactory
extends java.lang.Object

This pure static class delivers standardized widgets.

Author:
Philipp Bartsch (codeshaker@gmx.net), GPL License

Field Summary
(package private) static java.awt.Font ARIAL_10B
          Arial 10 bold
(package private) static java.awt.Font ARIAL_10P
          Arial 10 plain
(package private) static java.awt.Font ARIAL_9B
          Arial 9 bold
(package private) static java.awt.Font ARIAL_9P
          Arial 9 plain
(package private) static java.awt.Color BLACK
          Black color object
(package private) static javax.swing.border.Border BLACKLN
          Simple black line border
(package private) static java.awt.Color BLUE
          DWU`s blue color object
private static java.awt.Font COURIER_10
          Courier 10 plain (monospace font)
private static java.awt.Dimension D100x18
          100 x 18 Dimesion object
private static java.awt.Dimension D250x300
          250 x 300 Dimesion object
private static javax.swing.border.Border EMPTY1
          Empty border (5,2,5,2)
(package private) static javax.swing.border.Border EMPTY2
          Empty border (2,2,2,2)
(package private) static javax.swing.border.Border ETCHED
          Lowered etched border
(package private) static java.awt.Color GRAY
          Standard background gray color object
(package private) static javax.swing.border.Border LOW
          Lowered soft bevel border
(package private) static ProgressKit PROGRESSKIT
           
(package private) static java.awt.Color RED
          DWU`s red color object
(package private) static java.awt.Color WHITE
          White color object
 
Constructor Summary
private GUIFactory()
          Invisible constructor.
 
Method Summary
(package private) static javax.swing.JButton button(java.lang.String dictKey, java.awt.event.ActionListener listener, java.lang.String command, java.lang.String iconName)
          Creates a standardized button.
(package private) static javax.swing.JEditorPane editorPane()
          Creates a standardized text/html editorpane with gray background.
(package private) static javax.swing.ImageIcon getIcon(java.lang.String name)
          Returns an ImageIcon.
(package private) static void killProgressWindow()
          Disposes the progress window.
(package private) static javax.swing.JLabel label(java.lang.String dictKey, boolean courierFont, boolean rightAlign)
          Returns a label with requested text.
(package private) static javax.swing.JScrollPane scrollWrap(javax.swing.JComponent component, javax.swing.border.Border border)
          Wraps the given component with a scrollbar.
(package private) static void showProgressWindow(int messageCount)
          Shows a JWindow with an embedded progressbar.
(package private) static javax.swing.JTextArea textArea(java.lang.String dictKey, boolean editable, boolean wordWrap)
          Creates a standardized multiline textarea.
(package private) static javax.swing.JTextField textField(java.lang.String dictKey, java.awt.event.FocusListener flsn)
          Creates a standardized textfield.
(package private) static javax.swing.border.TitledBorder titledEBorder(java.lang.String dictKey)
          Creates a standardized titled, etched border.
(package private) static javax.swing.border.TitledBorder titledLBorder(java.lang.String dictKey)
          Creates a standardized titled, softbevel (lowered) border.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

GRAY

static final java.awt.Color GRAY
Standard background gray color object

BLUE

static final java.awt.Color BLUE
DWU`s blue color object

RED

static final java.awt.Color RED
DWU`s red color object

BLACK

static final java.awt.Color BLACK
Black color object

WHITE

static final java.awt.Color WHITE
White color object

ARIAL_10P

static final java.awt.Font ARIAL_10P
Arial 10 plain

ARIAL_10B

static final java.awt.Font ARIAL_10B
Arial 10 bold

ARIAL_9B

static final java.awt.Font ARIAL_9B
Arial 9 bold

ARIAL_9P

static final java.awt.Font ARIAL_9P
Arial 9 plain

COURIER_10

private static final java.awt.Font COURIER_10
Courier 10 plain (monospace font)

D100x18

private static final java.awt.Dimension D100x18
100 x 18 Dimesion object

D250x300

private static final java.awt.Dimension D250x300
250 x 300 Dimesion object

BLACKLN

static final javax.swing.border.Border BLACKLN
Simple black line border

ETCHED

static final javax.swing.border.Border ETCHED
Lowered etched border

LOW

static final javax.swing.border.Border LOW
Lowered soft bevel border

EMPTY1

private static final javax.swing.border.Border EMPTY1
Empty border (5,2,5,2)

EMPTY2

static final javax.swing.border.Border EMPTY2
Empty border (2,2,2,2)

PROGRESSKIT

static final ProgressKit PROGRESSKIT
Constructor Detail

GUIFactory

private GUIFactory()
Invisible constructor. This class is a factory, so it`s not meant to be instantiated.
Method Detail

textArea

static final javax.swing.JTextArea textArea(java.lang.String dictKey,
                                            boolean editable,
                                            boolean wordWrap)
Creates a standardized multiline textarea.
Parameters:
dictKey - the dictionary key of the shown text
editable - indicates wheter it is editable
wordWrap - indicates wheter to wrap whole words
Returns:
JTextArea the textarea

button

static final javax.swing.JButton button(java.lang.String dictKey,
                                        java.awt.event.ActionListener listener,
                                        java.lang.String command,
                                        java.lang.String iconName)
Creates a standardized button.
Parameters:
dictKey - the dictionary key of the shown text
listener - an actionlistener
command - an actioncommand
iconName - an iconname
Returns:
JButton the button

label

static final javax.swing.JLabel label(java.lang.String dictKey,
                                      boolean courierFont,
                                      boolean rightAlign)
Returns a label with requested text.
Parameters:
dictKey - the language dictionary key for the label text
courierFont - flag indicates wheter to use courier (or arial)
rightAlign - flag indicates wheter to align right (or left)
Returns:
the label

editorPane

static final javax.swing.JEditorPane editorPane()
Creates a standardized text/html editorpane with gray background.
Returns:
JEditorPane the editorpane

scrollWrap

static final javax.swing.JScrollPane scrollWrap(javax.swing.JComponent component,
                                                javax.swing.border.Border border)
Wraps the given component with a scrollbar.
Parameters:
component - component to wrap
border - the requested border
Returns:
the scrollpane

textField

static final javax.swing.JTextField textField(java.lang.String dictKey,
                                              java.awt.event.FocusListener flsn)
Creates a standardized textfield.
Parameters:
dictKey - the dictionary key of the shown text
flsn - an focuslistener or null
Returns:
JTextField the textfield

titledEBorder

static javax.swing.border.TitledBorder titledEBorder(java.lang.String dictKey)
Creates a standardized titled, etched border.
Parameters:
dictKey - the dictionary key
Returns:
TitledBorder the border

titledLBorder

static javax.swing.border.TitledBorder titledLBorder(java.lang.String dictKey)
Creates a standardized titled, softbevel (lowered) border.
Parameters:
dictKey - the dictionary key
Returns:
TitledBorder the border

getIcon

static javax.swing.ImageIcon getIcon(java.lang.String name)
Returns an ImageIcon. The method returns an icon from the jar file.
Parameters:
name - icons filename
Returns:
ImageIcon the ImageIcon

showProgressWindow

static void showProgressWindow(int messageCount)
Shows a JWindow with an embedded progressbar. Always called when submit bug reports visually.
Parameters:
messageCount - the number of stored bugprofiles

killProgressWindow

static void killProgressWindow()
Disposes the progress window.