org.ceryle.ui
Class G27y

java.lang.Object
  extended by org.ceryle.ui.G27y

public class G27y
extends Object

A Graphical User Interface Factory ("G27y") class containing static methods for creating consistent interface objects.

This includes a set of colors, based on the idea of warmer colors for attention, cooler colors for static or background objects, lower saturation for less attention. The human eye is most sensitive to yellow-green.

(It was a bit unclear in naming this class, as at first I thought it might be more correct as "G30y", if one counted the spaces between words.)

Version:
$Id: G27y.java,v 3.27 2007-06-15 12:09:37 altheim Exp $
Author:
Murray Altheim

Field Summary
static boolean buttonBordersPainted
          When true, paint the borders of toolbar buttons.
static Color COLOR_BASE
          The set of standard UI colors available to the application.
static Color COLOR_DASHED
          The set of standard UI colors available to the application.
static Color COLOR_DIFF_ADDED
          The set of standard UI colors available to the application.
static Color COLOR_DIFF_REMOVED
          The set of standard UI colors available to the application.
static Color COLOR_DIM
          The set of standard UI colors available to the application.
static Color COLOR_DIMMER
          The set of standard UI colors available to the application.
static Color COLOR_ED_TEXT_BG
          The set of standard UI colors available to the application.
static Color COLOR_ED_TEXT_CARET
          The set of standard UI colors available to the application.
static Color COLOR_ED_TEXT_FG
          The set of standard UI colors available to the application.
static Color COLOR_ED_TEXT_SBG
          The set of standard UI colors available to the application.
static Color COLOR_ED_TEXT_SFG
          The set of standard UI colors available to the application.
static Color COLOR_MESSAGE_BACK
          The set of standard UI colors available to the application.
static Color COLOR_MESSAGE_FORE
          The set of standard UI colors available to the application.
static Color COLOR_NOTICEABLE
          The set of standard UI colors available to the application.
static Color COLOR_PROGRESS
          The set of standard UI colors available to the application.
static Color COLOR_PROGRESS_DIM
          The set of standard UI colors available to the application.
static Color COLOR_SKY_BLUE
          The set of standard UI colors available to the application.
static Color COLOR_STATUS
          The set of standard UI colors available to the application.
static Color COLOR_STATUS_DIM
          The set of standard UI colors available to the application.
static Color COLOR_TEXT_BG
          The set of standard UI colors available to the application.
static Color COLOR_TEXT_CARET
          The set of standard UI colors available to the application.
static Color COLOR_TEXT_FG
          The set of standard UI colors available to the application.
static Color COLOR_TEXT_SBG
          The set of standard UI colors available to the application.
static Color COLOR_TEXT_SFG
          The set of standard UI colors available to the application.
static Color COLOR_TRANSPARENT
          The set of standard UI colors available to the application.
static Color COLOR_UI
          The set of standard UI colors available to the application.
static Color COLOR_UI_DARK
          The set of standard UI colors available to the application.
static Color COLOR_UI_DARKGRAY
          The set of standard UI colors available to the application.
static Color COLOR_UI_DIM
          The set of standard UI colors available to the application.
static Color COLOR_UI_GRAY
          The set of standard UI colors available to the application.
static Color COLOR_UI_LIGHT
          The set of standard UI colors available to the application.
static Color COLOR_UI_LIGHTGRAY
          The set of standard UI colors available to the application.
static Color COLOR_UI_TINT
          The set of standard UI colors available to the application.
static int DEFAULT_ROW_COUNT
          The default number of rows to show in the text display lists.
static String DEFAULT_SKIN_NAME
          The default UI skin name.
static boolean editorLineWrap
          When true, generated editor text areas follow a line-wrapping policy.
static int FONT_EDIT
          An indicator of the editor font (#6).
static int FONT_GRAPH
          An indicator of the graph font (#10).
static int FONT_HELP
          An indicator of the help font (#8).
static int FONT_LABEL
          An indicator of the label font (#3).
static int FONT_MENU
          An indicator of the menu font (#2).
static int FONT_MONO
          An indicator of the monospaced font (#5).
static int FONT_MSG
          An indicator of the message font (#4).
static int FONT_NOTE
          An indicator of the note font (#9).
static int FONT_SMALL
          An indicator of the small font (#7).
static int FONT_TINY
          An indicator of the tiny font (#11).
static int FONT_TITLE
          An indicator of the title font (#1).
static boolean halfVerticalGutter
          When true, the editor's vertical gutter is set to half of the horizontal value.
static String ICON_DEF
          The extension string for default icons.
static String ICON_DIS
          The extension string for disabled icons.
static String ICON_PRS
          The extension string for pressed icons.
static String ICON_SEL
          The extension string for selected icons.
static boolean initialNotes
          When true, notes are initially visible upon opening the application.
static int maxGutter
          Maximum permitted editor gutter value.
static String PROPERTY_diffTextAddedColor
          Ceryle property determining the diff text added color.
static String PROPERTY_diffTextRemovedColor
          Ceryle property determining the diff text removed color.
static String PROPERTY_editorBGColor
          Ceryle property determining the editor background color.
static String PROPERTY_editorCaretColor
          Ceryle property determining the editor caret color.
static String PROPERTY_editorFGColor
          Ceryle property determining the editor foreground color.
static String PROPERTY_editorFontFamily
          Ceryle property determining the editor font family.
static String PROPERTY_editorFontSize
          Ceryle property determining the editor font size.
static String PROPERTY_editorGutter
          Ceryle property determining the editor gutter.
static String PROPERTY_editorLineWrap
          Ceryle property determining the editor line wrapping policy.
static String PROPERTY_editorSBGColor
          Ceryle property determining the editor selection (BG) color.
static String PROPERTY_editorSFGColor
          Ceryle property determining the editor selected text (FG) color.
static String PROPERTY_pageLayout
          Ceryle property determining the choice of displaying the eidtor view as a "page layout".
static File skinDirectory
          The default skin directory ("resource/skin/").
static boolean usePageLayout
          When true, add an additional dim border around the editor text area, similar to the "page layout" view of a word processor.
protected static boolean useToolTips
          When true, use ToolTips.
 
Method Summary
static void borderize(JComponent component, String title)
          Attaches a titled, line border around the JComponent component, using the String title.
static Border createBevelBorder()
          Returns a Lowered BevelBorder with colors compatible with the rest of the layout.
static JCheckBox createCheckBox(String name, String tooltip, boolean checked, ItemListener listener)
          Return a checkbox button provided with its features.
static JCheckBoxMenuItem createCheckBoxMenuItem(String name, String labelId, String descId, boolean enabled, int key, boolean checked, EventListener listener)
          Return a checkbox menu item provided with its features.
static JPanel createComboBoxPanel(String title, String tooltipText, JComboBox combobox, EventListener listener, ListCellRenderer renderer)
          Returns a labeled combobox provided its label text, etc.
static JButton createDialogButton(String label, String tooltip, boolean enabled, boolean small, EventListener listener)
          Returns a dialog button provided its parameters.
static JTextField createEditableField(String content, int columns, EventListener listener)
          Return an editable text field with width columns and optional String content (provide either an empty string or null if unwanted).
static JPanel createFlowPanel()
          Returns a JPanel managed by an left-aligned FlowLayout with color COLOR_BASE.
static JFormattedTextField createFormattedField(String content, int columns, Format format, PropertyChangeListener listener)
          Return a editable text field with width columns and optional String content (provide either an empty string or null if unwanted).
static JPanel createHelpPanel(JEditorPane ep, String text)
          Creates and returns a help panel, optionally supplied with its JEditorPane and help text.
static Component createHpad()
          A GUI utility that returns a horizontal padding of a default fixed width and no height.
static ImageIcon createImageIcon(String basename)
          Returns an ImageIcon given its base name basename (to, which "_def.gif" will be suffixed) or null if this should fail.
static ImageIcon createImageIcon(String basename, String ext)
          Returns an ImageIcon given its base name basename and extension (which are simply concatenated to form the filename).
static JLabel createLabel(String title, String tooltip)
          Returns a label, provided an optional title and optional tooltip text.
static JMenu createMenu(String name, int mnemonic)
          Return a menu provided with an name and optional mnemonic.
static JMenuItem createMenuItem(Action action, String labelId, String descId, boolean enabled)
          Return a menu item provided with an Action.
static JMenuItem createMenuItem(String name, String labelId, String descId, boolean enabled, int key, Object o)
          Return a menu item provided with its features.
static JPanel createPanel()
          Returns a JPanel managed by a BorderLayout with color COLOR_BASE.
static JRadioButton createRadioButton(String id, String label, String toolTip, EventListener listener, ButtonGroup group)
          Creates a radio button, provided with its properties, IDs, labels, etc.
static JRadioButtonMenuItem createRadioButtonMenuItem(String id, String label, String toolTip, int key, ActionListener listener, ButtonGroup group)
          Creates a radio button, provided with its properties, IDs, labels, etc.
static JScrollPane createScrollableTextArea(JTextArea textArea, Document doc)
          Provided with a JTextArea, sets up some default attributes and surrounds it with a scrollable pane, returning the scrollPane.
static JScrollPane createScrollableTextArea(JTextArea textArea, Document doc, int vsbPolicy, int hsbPolicy)
          Provided with a JTextArea, sets up some default attributes and surrounds it with a scrollable pane, returning the scrollPane.
static JScrollPane createScrollableTextPane(JTextPane textPane)
          This calls createScrollableTextPane(JTextPane,int,int) with defaults for the scrollbars (vertical always, horizontal as needed).
static JScrollPane createScrollableTextPane(JTextPane textPane, int vsbPolicy, int hsbPolicy)
          Provided with a JTextPane, sets up some default attributes and surrounds it with a scrollable pane, returning the scrollPane.
static Component createVpad()
          A GUI utility that returns a vertical padding of a default fixed height and no width.
static JPanel createXBoxPanel()
          Returns a JPanel managed by an X axis BoxLayout with color COLOR_BASE.
static JPanel createYBoxPanel()
          Returns a JPanel managed by a Y axis BoxLayout with color COLOR_BASE.
static JScrollPane decorateEditableTextArea(JTextArea textarea)
          Decorates a JTextArea as an editable field, returning a JScrollPane wrapper around it.
static Font getFont(int number)
          Returns a font, given its number (1-10).
static int getGutter()
          Returns the current setting of the gutter (the space between the edge of the "page" and the text in text areas).
static String getStyleString(int number, String source)
          Returns the source String, wrapped by a <div> element containing the font style information for the font having number (1-10).
static boolean isSkinned()
          Returns true if the UI is skinned.
static int setGutter(int value)
          Sets the the gutter (the space between the edge of the "page" and the text in text areas).
static void setLookAndFeel()
          Set the Look and Feel of the GUI window according to properties from the PropertyManager.
static void setSkin(String name)
          Sets the application skin colors to the skin named name (based on an external properties file).
static void setSkinned(boolean state)
          Set the skinned state to the provided boolean.
static void setToolTip(JComponent component, String tip)
          If useToolTips is true, sets the tool tip on JComponent component to the String tip.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FONT_TITLE

public static final int FONT_TITLE
An indicator of the title font (#1). See getFont(int).

See Also:
Constant Field Values

FONT_MENU

public static final int FONT_MENU
An indicator of the menu font (#2). See getFont(int).

See Also:
Constant Field Values

FONT_LABEL

public static final int FONT_LABEL
An indicator of the label font (#3). See getFont(int).

See Also:
Constant Field Values

FONT_MSG

public static final int FONT_MSG
An indicator of the message font (#4). See getFont(int).

See Also:
Constant Field Values

FONT_MONO

public static final int FONT_MONO
An indicator of the monospaced font (#5). See getFont(int).

See Also:
Constant Field Values

FONT_EDIT

public static final int FONT_EDIT
An indicator of the editor font (#6). See getFont(int).

See Also:
Constant Field Values

FONT_SMALL

public static final int FONT_SMALL
An indicator of the small font (#7). See getFont(int).

See Also:
Constant Field Values

FONT_HELP

public static final int FONT_HELP
An indicator of the help font (#8). See getFont(int).

See Also:
Constant Field Values

FONT_NOTE

public static final int FONT_NOTE
An indicator of the note font (#9). See getFont(int).

See Also:
Constant Field Values

FONT_GRAPH

public static final int FONT_GRAPH
An indicator of the graph font (#10). See getFont(int).

See Also:
Constant Field Values

FONT_TINY

public static final int FONT_TINY
An indicator of the tiny font (#11). See getFont(int).

See Also:
Constant Field Values

COLOR_TRANSPARENT

public static Color COLOR_TRANSPARENT
The set of standard UI colors available to the application.


COLOR_BASE

public static Color COLOR_BASE
The set of standard UI colors available to the application.


COLOR_UI

public static Color COLOR_UI
The set of standard UI colors available to the application.


COLOR_UI_TINT

public static Color COLOR_UI_TINT
The set of standard UI colors available to the application.


COLOR_UI_LIGHT

public static Color COLOR_UI_LIGHT
The set of standard UI colors available to the application.


COLOR_UI_DIM

public static Color COLOR_UI_DIM
The set of standard UI colors available to the application.


COLOR_UI_DARK

public static Color COLOR_UI_DARK
The set of standard UI colors available to the application.


COLOR_UI_GRAY

public static Color COLOR_UI_GRAY
The set of standard UI colors available to the application.


COLOR_UI_LIGHTGRAY

public static Color COLOR_UI_LIGHTGRAY
The set of standard UI colors available to the application.


COLOR_UI_DARKGRAY

public static Color COLOR_UI_DARKGRAY
The set of standard UI colors available to the application.


COLOR_MESSAGE_FORE

public static Color COLOR_MESSAGE_FORE
The set of standard UI colors available to the application.


COLOR_MESSAGE_BACK

public static Color COLOR_MESSAGE_BACK
The set of standard UI colors available to the application.


COLOR_DIM

public static Color COLOR_DIM
The set of standard UI colors available to the application.


COLOR_DIMMER

public static Color COLOR_DIMMER
The set of standard UI colors available to the application.


COLOR_STATUS

public static Color COLOR_STATUS
The set of standard UI colors available to the application.


COLOR_STATUS_DIM

public static Color COLOR_STATUS_DIM
The set of standard UI colors available to the application.


COLOR_PROGRESS

public static Color COLOR_PROGRESS
The set of standard UI colors available to the application.


COLOR_PROGRESS_DIM

public static Color COLOR_PROGRESS_DIM
The set of standard UI colors available to the application.


COLOR_NOTICEABLE

public static Color COLOR_NOTICEABLE
The set of standard UI colors available to the application.


COLOR_SKY_BLUE

public static Color COLOR_SKY_BLUE
The set of standard UI colors available to the application.


COLOR_DIFF_ADDED

public static Color COLOR_DIFF_ADDED
The set of standard UI colors available to the application.


COLOR_DIFF_REMOVED

public static Color COLOR_DIFF_REMOVED
The set of standard UI colors available to the application.


COLOR_TEXT_FG

public static Color COLOR_TEXT_FG
The set of standard UI colors available to the application.


COLOR_TEXT_BG

public static Color COLOR_TEXT_BG
The set of standard UI colors available to the application.


COLOR_TEXT_SFG

public static Color COLOR_TEXT_SFG
The set of standard UI colors available to the application.


COLOR_TEXT_SBG

public static Color COLOR_TEXT_SBG
The set of standard UI colors available to the application.


COLOR_TEXT_CARET

public static Color COLOR_TEXT_CARET
The set of standard UI colors available to the application.


COLOR_ED_TEXT_FG

public static Color COLOR_ED_TEXT_FG
The set of standard UI colors available to the application.


COLOR_ED_TEXT_BG

public static Color COLOR_ED_TEXT_BG
The set of standard UI colors available to the application.


COLOR_ED_TEXT_SFG

public static Color COLOR_ED_TEXT_SFG
The set of standard UI colors available to the application.


COLOR_ED_TEXT_SBG

public static Color COLOR_ED_TEXT_SBG
The set of standard UI colors available to the application.


COLOR_ED_TEXT_CARET

public static Color COLOR_ED_TEXT_CARET
The set of standard UI colors available to the application.


COLOR_DASHED

public static Color COLOR_DASHED
The set of standard UI colors available to the application.


PROPERTY_editorFGColor

public static final String PROPERTY_editorFGColor
Ceryle property determining the editor foreground color. The value is "http://purl.org/ceryle/prop/#editorForegroundColor".

See Also:
Constant Field Values

PROPERTY_editorBGColor

public static final String PROPERTY_editorBGColor
Ceryle property determining the editor background color. The value is "http://purl.org/ceryle/prop/#editorBackgroundColor".

See Also:
Constant Field Values

PROPERTY_editorSFGColor

public static final String PROPERTY_editorSFGColor
Ceryle property determining the editor selected text (FG) color. The value is "http://purl.org/ceryle/prop/#editorSelectedTextColor".

See Also:
Constant Field Values

PROPERTY_editorSBGColor

public static final String PROPERTY_editorSBGColor
Ceryle property determining the editor selection (BG) color. The value is "http://purl.org/ceryle/prop/#editorSelectionColor".

See Also:
Constant Field Values

PROPERTY_editorCaretColor

public static final String PROPERTY_editorCaretColor
Ceryle property determining the editor caret color. The value is "http://purl.org/ceryle/prop/#editorCaretColor".

See Also:
Constant Field Values

PROPERTY_pageLayout

public static final String PROPERTY_pageLayout
Ceryle property determining the choice of displaying the eidtor view as a "page layout". The value is "http://purl.org/ceryle/prop/#pageLayout".

See Also:
Constant Field Values

PROPERTY_editorGutter

public static final String PROPERTY_editorGutter
Ceryle property determining the editor gutter. The value is "http://purl.org/ceryle/prop/#editorGutter".

See Also:
Constant Field Values

PROPERTY_editorFontFamily

public static final String PROPERTY_editorFontFamily
Ceryle property determining the editor font family. The value is "http://purl.org/ceryle/prop/#editorFontFamily".

See Also:
Constant Field Values

PROPERTY_editorFontSize

public static final String PROPERTY_editorFontSize
Ceryle property determining the editor font size. The value is "http://purl.org/ceryle/prop/#editorFontSize".

See Also:
Constant Field Values

PROPERTY_editorLineWrap

public static final String PROPERTY_editorLineWrap
Ceryle property determining the editor line wrapping policy. The value is "http://purl.org/ceryle/prop/#editorLineWrap".

See Also:
Constant Field Values

PROPERTY_diffTextAddedColor

public static final String PROPERTY_diffTextAddedColor
Ceryle property determining the diff text added color. The value is "http://purl.org/ceryle/prop/#diffTextAddedColor".

See Also:
Constant Field Values

PROPERTY_diffTextRemovedColor

public static final String PROPERTY_diffTextRemovedColor
Ceryle property determining the diff text removed color. The value is "http://purl.org/ceryle/prop/#diffTextRemovedColor".

See Also:
Constant Field Values

editorLineWrap

public static boolean editorLineWrap
When true, generated editor text areas follow a line-wrapping policy. The default value is true.


useToolTips

protected static boolean useToolTips
When true, use ToolTips. The default value is true.


buttonBordersPainted

public static boolean buttonBordersPainted
When true, paint the borders of toolbar buttons. The default value is true.


initialNotes

public static boolean initialNotes
When true, notes are initially visible upon opening the application. The default value is true.


usePageLayout

public static boolean usePageLayout
When true, add an additional dim border around the editor text area, similar to the "page layout" view of a word processor.


maxGutter

public static int maxGutter
Maximum permitted editor gutter value.


halfVerticalGutter

public static boolean halfVerticalGutter
When true, the editor's vertical gutter is set to half of the horizontal value. The default is true.


DEFAULT_ROW_COUNT

public static int DEFAULT_ROW_COUNT
The default number of rows to show in the text display lists. The default value is 4.


ICON_DEF

public static String ICON_DEF
The extension string for default icons. The default value is "_def.gif"


ICON_DIS

public static final String ICON_DIS
The extension string for disabled icons. The default value is "_dis.gif".

See Also:
Constant Field Values

ICON_SEL

public static final String ICON_SEL
The extension string for selected icons. The default value is "_sel.gif".

See Also:
Constant Field Values

ICON_PRS

public static final String ICON_PRS
The extension string for pressed icons. The default value is "_prs.gif".

See Also:
Constant Field Values

skinDirectory

public static File skinDirectory
The default skin directory ("resource/skin/").


DEFAULT_SKIN_NAME

public static final String DEFAULT_SKIN_NAME
The default UI skin name. The default value is "Default".

See Also:
Constant Field Values
Method Detail

getGutter

public static int getGutter()
Returns the current setting of the gutter (the space between the edge of the "page" and the text in text areas). This is set by the property http://purl.org/ceryle/prop/#editorGutter.


setGutter

public static int setGutter(int value)
Sets the the gutter (the space between the edge of the "page" and the text in text areas). Values outside of the range 0-maxGutter will simply be ignored. The current gutter setting is returned.


getFont

public static Font getFont(int number)
Returns a font, given its number (1-10).

See Also:
Services.getFont(int)

isSkinned

public static boolean isSkinned()
Returns true if the UI is skinned.


setSkinned

public static void setSkinned(boolean state)
Set the skinned state to the provided boolean. This does not actually alter the skin of the current application, only indicate skinning upon next restart (this is to disallow setting editor colors when skinned).


setSkin

public static void setSkin(String name)
Sets the application skin colors to the skin named name (based on an external properties file).


getStyleString

public static String getStyleString(int number,
                                    String source)
Returns the source String, wrapped by a <div> element containing the font style information for the font having number (1-10). This can be used to provide HTML style information for savvy Swing components.

See Also:
Services.getFont(int)

createPanel

public static JPanel createPanel()
Returns a JPanel managed by a BorderLayout with color COLOR_BASE.


createFlowPanel

public static JPanel createFlowPanel()
Returns a JPanel managed by an left-aligned FlowLayout with color COLOR_BASE. Uses default x=8, y=4 gaps.


createXBoxPanel

public static JPanel createXBoxPanel()
Returns a JPanel managed by an X axis BoxLayout with color COLOR_BASE.


createYBoxPanel

public static JPanel createYBoxPanel()
Returns a JPanel managed by a Y axis BoxLayout with color COLOR_BASE.


createLabel

public static JLabel createLabel(String title,
                                 String tooltip)
Returns a label, provided an optional title and optional tooltip text. If the title text starts with a "<" (STAGO) character, it is styled as HTML text.


createDialogButton

public static JButton createDialogButton(String label,
                                         String tooltip,
                                         boolean enabled,
                                         boolean small,
                                         EventListener listener)
Returns a dialog button provided its parameters. label, tooltip, and listener are optional. If small is true, the small font is used instead of a label font.


createRadioButton

public static JRadioButton createRadioButton(String id,
                                             String label,
                                             String toolTip,
                                             EventListener listener,
                                             ButtonGroup group)
Creates a radio button, provided with its properties, IDs, labels, etc. This method will add the created button to the provided group.

Parameters:
id - the optional identifier for the button, also used as the action command.
label - the optional label used in lieu of a button icon.
toolTip - the optional String text used for the tool tip.
listener - the optional ActionListener used to listen for button and mouse events.
group - the button group of which this button is a member.

createRadioButtonMenuItem

public static JRadioButtonMenuItem createRadioButtonMenuItem(String id,
                                                             String label,
                                                             String toolTip,
                                                             int key,
                                                             ActionListener listener,
                                                             ButtonGroup group)
Creates a radio button, provided with its properties, IDs, labels, etc. This method will add the created button to the provided group.

Parameters:
id - the optional identifier for the button, also used as the action command.
label - the label used as the menu item text
toolTip - the optional String text used for the tool tip.
key - the menu item accelerator keystroke
listener - the optional ActionListener used to listen for button and mouse events.
group - the button group of which this button is a member.

createCheckBox

public static JCheckBox createCheckBox(String name,
                                       String tooltip,
                                       boolean checked,
                                       ItemListener listener)
Return a checkbox button provided with its features. If the name string starts with a "<" (STAGO) character, the text will be styled as HTML markup.

Parameters:
name - the menu item mnemonic identifier
tooltip - the optional tool tip text
checked - the initial checked state
listener - the item listener used to respond to activity

createMenuItem

public static JMenuItem createMenuItem(String name,
                                       String labelId,
                                       String descId,
                                       boolean enabled,
                                       int key,
                                       Object o)
Return a menu item provided with its features. If the accelerator (ie., key shortcut) key is less than zero it will be interpreted as its absolute value, though with no Control key (which is the default).

Parameters:
name - the menu item mnemonic identifier
labelId - the i18n label id
descId - the i18n tooltip id
enabled - the initial enabled state
key - the menu item accelerator keystroke
o - either an ActionListener or an Action used to respond to activity

createMenu

public static JMenu createMenu(String name,
                               int mnemonic)
Return a menu provided with an name and optional mnemonic.


createMenuItem

public static JMenuItem createMenuItem(Action action,
                                       String labelId,
                                       String descId,
                                       boolean enabled)
Return a menu item provided with an Action. The Action is expected to already have a name, but an optional accessible description can be added here.

Parameters:
action - the action upon which to base this menu item
labelId - the ID of the menu item text
descId - the ID of the menu item accessible description text
enabled - the initial enabled state

createCheckBoxMenuItem

public static JCheckBoxMenuItem createCheckBoxMenuItem(String name,
                                                       String labelId,
                                                       String descId,
                                                       boolean enabled,
                                                       int key,
                                                       boolean checked,
                                                       EventListener listener)
Return a checkbox menu item provided with its features. Negative numbers for key will use no Control key.

Parameters:
name - the menu item mnemonic identifier
labelId - the i18n label id
descId - the i18n tooltip id
enabled - the initial enabled state
key - the menu item accelerator keystroke
listener - the ItemListener or ActionListener used to respond to activity
checked - the initial checked state

borderize

public static void borderize(JComponent component,
                             String title)
Attaches a titled, line border around the JComponent component, using the String title. This is a convenience method used to gain some GUI consistency.


createBevelBorder

public static Border createBevelBorder()
Returns a Lowered BevelBorder with colors compatible with the rest of the layout.


createEditableField

public static JTextField createEditableField(String content,
                                             int columns,
                                             EventListener listener)
Return an editable text field with width columns and optional String content (provide either an empty string or null if unwanted). This uses default values for font, size, etc. The JTextField returned is editable (this can be set at any time). This will accept either an ActionListener, a KeyListener or KeyAdapter.


createFormattedField

public static JFormattedTextField createFormattedField(String content,
                                                       int columns,
                                                       Format format,
                                                       PropertyChangeListener listener)
Return a editable text field with width columns and optional String content (provide either an empty string or null if unwanted). If format is non-null, it is used as the format for field input. If null, the default formatter will be for integers with no size limits. This uses default values for font, size, etc. The JTextField returned is editable (this can be set at any time).


createScrollableTextArea

public static JScrollPane createScrollableTextArea(JTextArea textArea,
                                                   Document doc)
Provided with a JTextArea, sets up some default attributes and surrounds it with a scrollable pane, returning the scrollPane. This defaults to always providing a vertical scrollbar, with the horizontal one appearing only as needed. The JTextArea is returned uneditable (this can be set at any time).

Parameters:
textArea - the JTextArea to use
doc - optionally, the text area's intended document content

createScrollableTextArea

public static JScrollPane createScrollableTextArea(JTextArea textArea,
                                                   Document doc,
                                                   int vsbPolicy,
                                                   int hsbPolicy)
Provided with a JTextArea, sets up some default attributes and surrounds it with a scrollable pane, returning the scrollPane. The JTextArea is returned uneditable (this can be set at any time).

Parameters:
textArea - the JTextArea to use
doc - optionally, the text area's intended document content
vsbPolicy - the vertical scrollbar policy
hsbPolicy - the horizontal scrollbar policy
See Also:
JScrollPane

decorateEditableTextArea

public static JScrollPane decorateEditableTextArea(JTextArea textarea)
Decorates a JTextArea as an editable field, returning a JScrollPane wrapper around it. This sets all colors and borders.

Parameters:
textarea - the JTextArea to decorate
Returns:
the JScrollPane wrapper

createScrollableTextPane

public static JScrollPane createScrollableTextPane(JTextPane textPane)
This calls createScrollableTextPane(JTextPane,int,int) with defaults for the scrollbars (vertical always, horizontal as needed).

Parameters:
textPane - the JTextPane to use

createScrollableTextPane

public static JScrollPane createScrollableTextPane(JTextPane textPane,
                                                   int vsbPolicy,
                                                   int hsbPolicy)
Provided with a JTextPane, sets up some default attributes and surrounds it with a scrollable pane, returning the scrollPane. The JTextPane is returned uneditable (this can be set at any time). This uses a white background, black default text, and the Note font.

Note that JTextPanes differ from JTextAreas in that the former can handle plaintext, HTML and RTF.

Parameters:
textPane - the JTextPane to use
vsbPolicy - the vertical scrollbar policy
hsbPolicy - the horizontal scrollbar policy
See Also:
JScrollPane

createHelpPanel

public static JPanel createHelpPanel(JEditorPane ep,
                                     String text)
Creates and returns a help panel, optionally supplied with its JEditorPane and help text. The help panel is capable of displaying simple HTML presentational markup.


createComboBoxPanel

public static JPanel createComboBoxPanel(String title,
                                         String tooltipText,
                                         JComboBox combobox,
                                         EventListener listener,
                                         ListCellRenderer renderer)
Returns a labeled combobox provided its label text, etc. The listener and renderer are optional.


createHpad

public static Component createHpad()
A GUI utility that returns a horizontal padding of a default fixed width and no height.


createVpad

public static Component createVpad()
A GUI utility that returns a vertical padding of a default fixed height and no width.


setToolTip

public static void setToolTip(JComponent component,
                              String tip)
If useToolTips is true, sets the tool tip on JComponent component to the String tip.

This property is "http://purl.org/ceryle/prop/#useToolTips".


setLookAndFeel

public static void setLookAndFeel()
Set the Look and Feel of the GUI window according to properties from the PropertyManager. This also reads several other GUI-related properties.


createImageIcon

public static ImageIcon createImageIcon(String basename)
Returns an ImageIcon given its base name basename (to, which "_def.gif" will be suffixed) or null if this should fail.

Returns:
the ImageIcon, or null if this fails.

createImageIcon

public static ImageIcon createImageIcon(String basename,
                                        String ext)
Returns an ImageIcon given its base name basename and extension (which are simply concatenated to form the filename). If the extension is null, the default String ICON_DEF will be used.

Returns:
the ImageIcon, or null if this fails.


The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.