org.jscience.swing
Class Menus

java.lang.Object
  extended by org.jscience.swing.Menus

public final class Menus
extends java.lang.Object

Menus provides some convenient menus and dialogs that are potentially useful for any Java Swing Application. If available, it takes advantage of com.incors.plaf.kunststoff.KunststoffLookAndFeel.


Field Summary
static java.lang.String aboutString
          DOCUMENT ME!
static javax.swing.ImageIcon antelmannIcon
          DOCUMENT ME!
static java.util.ResourceBundle language
          allows access to the localized language used in this package
static boolean verbose
          DOCUMENT ME!
 
Constructor Summary
Menus()
           
 
Method Summary
static javax.swing.JMenuItem createAboutBoxMenuItem(java.awt.Frame parent)
          returns an 'about' menu capable of displaying an Antelmann.com's info box.
static javax.swing.JMenuItem createAboutDialogMenuItem(java.awt.Frame parent)
          returns an 'about' menu capable of displaying an Antelmann.com's info box.
static javax.swing.JMenuBar createDefaultMenuBar(java.awt.Frame parent)
          returns a convenient standard JMenuBar to be used with any Frame
static javax.swing.JDialog createDialog(java.awt.Component parent, java.lang.String title, boolean modal)
           
static javax.swing.JMenu createLookAndFeelMenu(java.awt.Frame rootComponent)
          createLookAndFeelMenu() generates a JMenu that lets the user select from different look&feel options.
static char[] enterPassword(java.awt.Component parent)
          DOCUMENT ME!
static char[] enterPassword(java.awt.Component parent, java.lang.String title, java.lang.Object message, java.lang.String initialValue)
          DOCUMENT ME!
static char[] enterPassword(java.awt.Component parent, java.lang.String title, java.lang.Object message, java.lang.String initialValue, javax.swing.ImageIcon icon)
          DOCUMENT ME!
static java.awt.Dialog getDialogForComponent(java.awt.Component component)
          DOCUMENT ME!
static void makeCompactSpringGrid(java.awt.Container parent, int rows, int cols, int initialX, int initialY, int xPad, int yPad)
          Aligns the first rowscols components of parent in a grid.
static javax.swing.JTable makePropertiesTable(java.util.Map properties)
          calls makePropertiesTable(properties, "key", "value")
static javax.swing.JTable makePropertiesTable(java.util.Map properties, java.lang.String keyHeader, java.lang.String valueHeader)
          returns a table that orders the entries by the keys of the properties
static void makeSpringGrid(java.awt.Container parent, int rows, int cols, int initialX, int initialY, int xPad, int yPad)
          Aligns the first rowscols components of parent in a grid.
static void showAboutBox(java.awt.Component parent)
          shows a small antelmann.com about dialog
static void showAboutDialog(java.awt.Component parent)
          shows the standard antelmann.com about dialog with license, version and upgrade button
static void showExceptionDialog(java.awt.Component parent, java.lang.Throwable ex)
          DOCUMENT ME!
static void showExceptionDialog(java.awt.Component parent, java.lang.Throwable ex, java.lang.Thread t)
          DOCUMENT ME!
static void showExceptionDialog(java.lang.Throwable ex)
          DOCUMENT ME!
static void showLicenseDialog(java.awt.Component parent)
          DOCUMENT ME!
static void showPropertiesDialog(java.lang.String title, java.util.Map properties, java.awt.Component parent, boolean modal)
          Deprecated. use makePropertiesTable with JOptionPane instead
static void showVersionDialog(java.awt.Component parent)
          DOCUMENT ME!
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

antelmannIcon

public static final javax.swing.ImageIcon antelmannIcon
DOCUMENT ME!


aboutString

public static final java.lang.String aboutString
DOCUMENT ME!


verbose

public static boolean verbose
DOCUMENT ME!


language

public static final java.util.ResourceBundle language
allows access to the localized language used in this package

Constructor Detail

Menus

public Menus()
Method Detail

createDefaultMenuBar

public static javax.swing.JMenuBar createDefaultMenuBar(java.awt.Frame parent)
returns a convenient standard JMenuBar to be used with any Frame

Parameters:
parent - DOCUMENT ME!
Returns:
DOCUMENT ME!

createLookAndFeelMenu

public static javax.swing.JMenu createLookAndFeelMenu(java.awt.Frame rootComponent)
createLookAndFeelMenu() generates a JMenu that lets the user select from different look&feel options.

Parameters:
rootComponent - the top component of the GUI tree that needs to be updated
Returns:
DOCUMENT ME!
Throws:
java.lang.Error - DOCUMENT ME!

createAboutDialogMenuItem

public static javax.swing.JMenuItem createAboutDialogMenuItem(java.awt.Frame parent)
returns an 'about' menu capable of displaying an Antelmann.com's info box.

Parameters:
parent - the component over which the modal dialog is to be placed
Returns:
DOCUMENT ME!

createAboutBoxMenuItem

public static javax.swing.JMenuItem createAboutBoxMenuItem(java.awt.Frame parent)
returns an 'about' menu capable of displaying an Antelmann.com's info box.

Parameters:
parent - the component over which the modal dialog is to be placed
Returns:
DOCUMENT ME!

showAboutBox

public static void showAboutBox(java.awt.Component parent)
shows a small antelmann.com about dialog

Parameters:
parent - DOCUMENT ME!

showAboutDialog

public static void showAboutDialog(java.awt.Component parent)
shows the standard antelmann.com about dialog with license, version and upgrade button

Parameters:
parent - DOCUMENT ME!

showVersionDialog

public static void showVersionDialog(java.awt.Component parent)
DOCUMENT ME!

Parameters:
parent - DOCUMENT ME!

showLicenseDialog

public static void showLicenseDialog(java.awt.Component parent)
DOCUMENT ME!

Parameters:
parent - DOCUMENT ME!

showPropertiesDialog

@Deprecated
public static void showPropertiesDialog(java.lang.String title,
                                                   java.util.Map properties,
                                                   java.awt.Component parent,
                                                   boolean modal)
Deprecated. use makePropertiesTable with JOptionPane instead

shows a JDialog containing a JTable to display the given properties sorted

Parameters:
title - DOCUMENT ME!
properties - DOCUMENT ME!
parent - DOCUMENT ME!
modal - DOCUMENT ME!
See Also:
makePropertiesTable(Map,String,String)

makePropertiesTable

public static javax.swing.JTable makePropertiesTable(java.util.Map properties)
calls makePropertiesTable(properties, "key", "value")

Parameters:
properties - DOCUMENT ME!
Returns:
DOCUMENT ME!

makePropertiesTable

public static javax.swing.JTable makePropertiesTable(java.util.Map properties,
                                                     java.lang.String keyHeader,
                                                     java.lang.String valueHeader)
returns a table that orders the entries by the keys of the properties

Parameters:
properties - DOCUMENT ME!
keyHeader - DOCUMENT ME!
valueHeader - DOCUMENT ME!
Returns:
DOCUMENT ME!

showExceptionDialog

public static void showExceptionDialog(java.lang.Throwable ex)
DOCUMENT ME!

Parameters:
ex - DOCUMENT ME!

showExceptionDialog

public static void showExceptionDialog(java.awt.Component parent,
                                       java.lang.Throwable ex)
DOCUMENT ME!

Parameters:
parent - DOCUMENT ME!
ex - DOCUMENT ME!

showExceptionDialog

public static void showExceptionDialog(java.awt.Component parent,
                                       java.lang.Throwable ex,
                                       java.lang.Thread t)
DOCUMENT ME!

Parameters:
parent - DOCUMENT ME!
ex - DOCUMENT ME!
t - DOCUMENT ME!

enterPassword

public static char[] enterPassword(java.awt.Component parent)
DOCUMENT ME!

Parameters:
parent - DOCUMENT ME!
Returns:
DOCUMENT ME!

enterPassword

public static char[] enterPassword(java.awt.Component parent,
                                   java.lang.String title,
                                   java.lang.Object message,
                                   java.lang.String initialValue)
DOCUMENT ME!

Parameters:
parent - DOCUMENT ME!
title - DOCUMENT ME!
message - DOCUMENT ME!
initialValue - DOCUMENT ME!
Returns:
DOCUMENT ME!

enterPassword

public static char[] enterPassword(java.awt.Component parent,
                                   java.lang.String title,
                                   java.lang.Object message,
                                   java.lang.String initialValue,
                                   javax.swing.ImageIcon icon)
DOCUMENT ME!

Parameters:
parent - DOCUMENT ME!
title - DOCUMENT ME!
message - DOCUMENT ME!
initialValue - DOCUMENT ME!
icon - DOCUMENT ME!
Returns:
DOCUMENT ME!

createDialog

public static javax.swing.JDialog createDialog(java.awt.Component parent,
                                               java.lang.String title,
                                               boolean modal)
See Also:
JOptionPane.createDialog(Component,String)

getDialogForComponent

public static java.awt.Dialog getDialogForComponent(java.awt.Component component)
DOCUMENT ME!

Parameters:
component - DOCUMENT ME!
Returns:
DOCUMENT ME!

makeSpringGrid

public static void makeSpringGrid(java.awt.Container parent,
                                  int rows,
                                  int cols,
                                  int initialX,
                                  int initialY,
                                  int xPad,
                                  int yPad)
Aligns the first rowscols components of parent in a grid. Each component is as big as the maximum preferred width and height of the components. The parent is made just big enough to fit them all. The parent component must be a SpringLayout. The code for this method is based on the turorial from the Sun Java website.

Parameters:
parent - DOCUMENT ME!
rows - number of rows
cols - number of columns
initialX - x location to start the grid at
initialY - y location to start the grid at
xPad - x padding between cells
yPad - y padding between cells

makeCompactSpringGrid

public static void makeCompactSpringGrid(java.awt.Container parent,
                                         int rows,
                                         int cols,
                                         int initialX,
                                         int initialY,
                                         int xPad,
                                         int yPad)
Aligns the first rowscols components of parent in a grid. Each component in a column is as wide as the maximum preferred width of the components in that column; height is similarly determined for each row. The parent is made just big enough to fit them all. The parent component must be a SpringLayout. The code for this method is based on the turorial from the Sun Java website.

Parameters:
parent - DOCUMENT ME!
rows - number of rows
cols - number of columns
initialX - x location to start the grid at
initialY - y location to start the grid at
xPad - x padding between cells
yPad - y padding between cells