com.valhalla.gui
Class Standard

java.lang.Object
  extended bycom.valhalla.gui.Standard

public class Standard
extends java.lang.Object

Some common utility functions for UI development

Version:
1.0
Author:
Adam Olsen

Method Summary
static void assure(java.lang.String field, java.lang.String name)
          Throws an error if a field is blank
static void cascadePlacement(java.awt.Container container)
          Places a Frame on window in a cascade fashion.
static javax.swing.ImageIcon getIcon(java.lang.String icon)
          Gets an Icon from the resources (usually the jar or current directory that the app is running from)
static java.awt.Image getImage(java.lang.String icon)
          Gets an Image from the resources (usually the jar or current directory that the app is running from)
static void noticeMessage(java.awt.Container parent, java.lang.String title, java.lang.String message)
          Displays a notice dialog
static void recursivelyApplyFont(java.awt.Component component, java.awt.Font font)
          Aplies a font to a container and all of it's child components
static void setBundle(java.util.ResourceBundle bundle)
          Sets the default resource bundle to be used with the Standard lib
static boolean warningMessage(java.awt.Container parent, java.lang.String title, java.lang.String message)
          Displays a warning dialog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

recursivelyApplyFont

public static void recursivelyApplyFont(java.awt.Component component,
                                        java.awt.Font font)
Aplies a font to a container and all of it's child components

Parameters:
component - the component to apply the font to
font - the font to apply

warningMessage

public static boolean warningMessage(java.awt.Container parent,
                                     java.lang.String title,
                                     java.lang.String message)
Displays a warning dialog

Parameters:
parent - this dialog's parent
title - the dialog title
message - the message
Returns:
Description of the Return Value

noticeMessage

public static void noticeMessage(java.awt.Container parent,
                                 java.lang.String title,
                                 java.lang.String message)
Displays a notice dialog

Parameters:
parent - this dialog's parent
title - the dialog title
message - the message

getImage

public static java.awt.Image getImage(java.lang.String icon)
Gets an Image from the resources (usually the jar or current directory that the app is running from)

Parameters:
icon - the name of the image to get
Returns:
the requested image, or null if it could not be found

getIcon

public static javax.swing.ImageIcon getIcon(java.lang.String icon)
Gets an Icon from the resources (usually the jar or current directory that the app is running from)

Parameters:
icon - the name of the image to get
Returns:
the requested icon, or null if it could not be found

cascadePlacement

public static void cascadePlacement(java.awt.Container container)
Places a Frame on window in a cascade fashion. Tracks the last location of the last window to produce the cascade effect

Parameters:
container - the container to cascade

setBundle

public static void setBundle(java.util.ResourceBundle bundle)
Sets the default resource bundle to be used with the Standard lib

Parameters:
bundle - The new bundle value

assure

public static void assure(java.lang.String field,
                          java.lang.String name)
                   throws java.lang.Exception
Throws an error if a field is blank

Parameters:
field - the value of the field
name - the name of the field
Throws:
java.lang.Exception - to be caught if the field was blank