com.lamatek.swingextras
Class IconFactory

java.lang.Object
  extended by com.lamatek.swingextras.IconFactory

public class IconFactory
extends java.lang.Object

This class provides methods to retrieve L&F specific graphics and icons for common IDE functions. Useful for constructing toolbars and buttons.


Field Summary
static java.lang.String ABOUT
           
static java.lang.String ADD
           
static java.lang.String ALIGN_BOTTOM
           
static java.lang.String ALIGN_CENTER
           
static java.lang.String ALIGN_JUSTIFY_HORIZONTAL
           
static java.lang.String ALIGN_JUSTIFY_VERTICAL
           
static java.lang.String ALIGN_LEFT
           
static java.lang.String ALIGN_RIGHT
           
static java.lang.String ALIGN_TOP
           
static java.lang.String APPLET
           
static java.lang.String APPLICATION
           
static java.lang.String APPLICATION_DEPLOY
           
static java.lang.String BACK
           
static java.lang.String BEAN
           
static java.lang.String BEAN_ADD
           
static java.lang.String BOLD
           
static java.lang.String BOOKMARKS
           
static java.lang.String COLUMN_DELETE
           
static java.lang.String COLUMN_INSERT_AFTER
           
static java.lang.String COLUMN_INSERT_BEFORE
           
static java.lang.String COMPOSE_MAIL
           
static java.lang.String CONTEXTUAL_HELP
           
static java.lang.String COPY
           
static java.lang.String CUT
           
static java.lang.String DELETE
           
static java.lang.String DOWN
           
static java.lang.String EDIT
           
static java.lang.String ENTERPRISE_JAVABEAN
           
static java.lang.String ENTERPRISE_JAVABEAN_JAR
           
static java.lang.String EXPORT
           
static java.lang.String FAST_FORWARD
           
static java.lang.String FIND
           
static java.lang.String FIND_AGAIN
           
static java.lang.String FORWARD
           
static java.lang.String HELP
           
static java.lang.String HISTORY
           
static java.lang.String HOME
           
static java.lang.String HOST
           
static java.lang.String IMPORT
           
static java.lang.String INFORMATION
           
static java.lang.String ITALIC
           
static java.lang.String J2EE_APPLICATION
           
static java.lang.String J2EE_APPLICATION_CLIENT
           
static java.lang.String J2EE_APPLICATION_CLIENT_ADD
           
static java.lang.String J2EE_SERVER
           
static java.lang.String JAR
           
static java.lang.String JAR_ADD
           
static java.lang.String MEDIA_STOP
           
static java.lang.String MOVIE
           
static java.lang.String NEW
           
static java.lang.String NORMAL
           
static java.lang.String OPEN
           
static java.lang.String PAGE_SETUP
           
static java.lang.String PASTE
           
static java.lang.String PAUSE
           
static java.lang.String PLAY
           
static java.lang.String PREFERENCES
           
static java.lang.String PRINT_PREVIEW
           
static java.lang.String PROPERTIES
           
static java.lang.String REDO
           
static java.lang.String REFRESH
           
static java.lang.String REMOVE
           
static java.lang.String REPLACE
           
static java.lang.String REWIND
           
static java.lang.String ROW_DELETE
           
static java.lang.String ROW_INSERT_AFTER
           
static java.lang.String ROW_INSERT_BEFORE
           
static java.lang.String SAVE
           
static java.lang.String SAVE_ALL
           
static java.lang.String SAVE_AS
           
static java.lang.String SEARCH
           
static java.lang.String SEND_MAIL
           
static java.lang.String SERVER
           
static java.lang.String STEP_BACK
           
static java.lang.String STEP_FORWARD
           
static java.lang.String STOP
           
static java.lang.String TEXT_ALIGN_CENTER
           
static java.lang.String TEXT_ALIGN_JUSTIFY
           
static java.lang.String TEXT_ALIGN_LEFT
           
static java.lang.String TEXT_ALIGN_RIGHT
           
static java.lang.String TIP_OF_THE_DAY
           
static java.lang.String UNDERLINE
           
static java.lang.String UNDO
           
static java.lang.String UP
           
static java.lang.String VOLUME
           
static java.lang.String WAR
           
static java.lang.String WAR_ADD
           
static java.lang.String WEB_COMPONENT
           
static java.lang.String WEB_COMPONENT_ADD
           
static java.lang.String ZOOM
           
static java.lang.String ZOOM_IN
           
static java.lang.String ZOOM_OUT
           
 
Constructor Summary
IconFactory()
          Creates new instance of IconFactory.
 
Method Summary
 javax.swing.Icon getIcon(java.lang.String type)
          Returns the requested icon as an instance of Icon.
 java.awt.Image getImage(java.lang.String type)
          Returns the desired icon as an instance of Image.
 javax.swing.Icon getScaledIcon(java.lang.String type, java.awt.Dimension size)
          Returns a scaled instance of the requested image as an instance of Icon for use in Swing applications.
 javax.swing.Icon getScaledIcon(java.lang.String type, int width, int height)
          Returns a scaled instance of the requested image as an instance of Icon for use in Swing applications.
 java.awt.Image getScaledImage(java.lang.String type, java.awt.Dimension size)
          Returns a scaled instance of the desired Image.
 java.awt.Image getScaledImage(java.lang.String type, int width, int height)
          Returns a scaled instance of the desired Image.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

APPLET

public static final java.lang.String APPLET
See Also:
Constant Field Values

APPLICATION

public static final java.lang.String APPLICATION
See Also:
Constant Field Values

APPLICATION_DEPLOY

public static final java.lang.String APPLICATION_DEPLOY
See Also:
Constant Field Values

BEAN

public static final java.lang.String BEAN
See Also:
Constant Field Values

BEAN_ADD

public static final java.lang.String BEAN_ADD
See Also:
Constant Field Values

ENTERPRISE_JAVABEAN

public static final java.lang.String ENTERPRISE_JAVABEAN
See Also:
Constant Field Values

ENTERPRISE_JAVABEAN_JAR

public static final java.lang.String ENTERPRISE_JAVABEAN_JAR
See Also:
Constant Field Values

HOST

public static final java.lang.String HOST
See Also:
Constant Field Values

J2EE_APPLICATION

public static final java.lang.String J2EE_APPLICATION
See Also:
Constant Field Values

J2EE_APPLICATION_CLIENT

public static final java.lang.String J2EE_APPLICATION_CLIENT
See Also:
Constant Field Values

J2EE_APPLICATION_CLIENT_ADD

public static final java.lang.String J2EE_APPLICATION_CLIENT_ADD
See Also:
Constant Field Values

J2EE_SERVER

public static final java.lang.String J2EE_SERVER
See Also:
Constant Field Values

JAR

public static final java.lang.String JAR
See Also:
Constant Field Values

JAR_ADD

public static final java.lang.String JAR_ADD
See Also:
Constant Field Values

SERVER

public static final java.lang.String SERVER
See Also:
Constant Field Values

WAR

public static final java.lang.String WAR
See Also:
Constant Field Values

WAR_ADD

public static final java.lang.String WAR_ADD
See Also:
Constant Field Values

WEB_COMPONENT

public static final java.lang.String WEB_COMPONENT
See Also:
Constant Field Values

WEB_COMPONENT_ADD

public static final java.lang.String WEB_COMPONENT_ADD
See Also:
Constant Field Values

ABOUT

public static final java.lang.String ABOUT
See Also:
Constant Field Values

ADD

public static final java.lang.String ADD
See Also:
Constant Field Values

ALIGN_BOTTOM

public static final java.lang.String ALIGN_BOTTOM
See Also:
Constant Field Values

ALIGN_CENTER

public static final java.lang.String ALIGN_CENTER
See Also:
Constant Field Values

ALIGN_JUSTIFY_HORIZONTAL

public static final java.lang.String ALIGN_JUSTIFY_HORIZONTAL
See Also:
Constant Field Values

ALIGN_JUSTIFY_VERTICAL

public static final java.lang.String ALIGN_JUSTIFY_VERTICAL
See Also:
Constant Field Values

ALIGN_LEFT

public static final java.lang.String ALIGN_LEFT
See Also:
Constant Field Values

ALIGN_RIGHT

public static final java.lang.String ALIGN_RIGHT
See Also:
Constant Field Values

ALIGN_TOP

public static final java.lang.String ALIGN_TOP
See Also:
Constant Field Values

BOOKMARKS

public static final java.lang.String BOOKMARKS
See Also:
Constant Field Values

COMPOSE_MAIL

public static final java.lang.String COMPOSE_MAIL
See Also:
Constant Field Values

CONTEXTUAL_HELP

public static final java.lang.String CONTEXTUAL_HELP
See Also:
Constant Field Values

COPY

public static final java.lang.String COPY
See Also:
Constant Field Values

CUT

public static final java.lang.String CUT
See Also:
Constant Field Values

DELETE

public static final java.lang.String DELETE
See Also:
Constant Field Values

EDIT

public static final java.lang.String EDIT
See Also:
Constant Field Values

EXPORT

public static final java.lang.String EXPORT
See Also:
Constant Field Values

FIND

public static final java.lang.String FIND
See Also:
Constant Field Values

FIND_AGAIN

public static final java.lang.String FIND_AGAIN
See Also:
Constant Field Values

HELP

public static final java.lang.String HELP
See Also:
Constant Field Values

HISTORY

public static final java.lang.String HISTORY
See Also:
Constant Field Values

IMPORT

public static final java.lang.String IMPORT
See Also:
Constant Field Values

INFORMATION

public static final java.lang.String INFORMATION
See Also:
Constant Field Values

NEW

public static final java.lang.String NEW
See Also:
Constant Field Values

OPEN

public static final java.lang.String OPEN
See Also:
Constant Field Values

PAGE_SETUP

public static final java.lang.String PAGE_SETUP
See Also:
Constant Field Values

PASTE

public static final java.lang.String PASTE
See Also:
Constant Field Values

PREFERENCES

public static final java.lang.String PREFERENCES
See Also:
Constant Field Values

PRINT_PREVIEW

public static final java.lang.String PRINT_PREVIEW
See Also:
Constant Field Values

PROPERTIES

public static final java.lang.String PROPERTIES
See Also:
Constant Field Values

REDO

public static final java.lang.String REDO
See Also:
Constant Field Values

REFRESH

public static final java.lang.String REFRESH
See Also:
Constant Field Values

REPLACE

public static final java.lang.String REPLACE
See Also:
Constant Field Values

REMOVE

public static final java.lang.String REMOVE
See Also:
Constant Field Values

SAVE

public static final java.lang.String SAVE
See Also:
Constant Field Values

SAVE_ALL

public static final java.lang.String SAVE_ALL
See Also:
Constant Field Values

SAVE_AS

public static final java.lang.String SAVE_AS
See Also:
Constant Field Values

SEARCH

public static final java.lang.String SEARCH
See Also:
Constant Field Values

SEND_MAIL

public static final java.lang.String SEND_MAIL
See Also:
Constant Field Values

STOP

public static final java.lang.String STOP
See Also:
Constant Field Values

TIP_OF_THE_DAY

public static final java.lang.String TIP_OF_THE_DAY
See Also:
Constant Field Values

UNDO

public static final java.lang.String UNDO
See Also:
Constant Field Values

ZOOM

public static final java.lang.String ZOOM
See Also:
Constant Field Values

ZOOM_IN

public static final java.lang.String ZOOM_IN
See Also:
Constant Field Values

ZOOM_OUT

public static final java.lang.String ZOOM_OUT
See Also:
Constant Field Values

FAST_FORWARD

public static final java.lang.String FAST_FORWARD
See Also:
Constant Field Values

MOVIE

public static final java.lang.String MOVIE
See Also:
Constant Field Values

PAUSE

public static final java.lang.String PAUSE
See Also:
Constant Field Values

PLAY

public static final java.lang.String PLAY
See Also:
Constant Field Values

REWIND

public static final java.lang.String REWIND
See Also:
Constant Field Values

STEP_BACK

public static final java.lang.String STEP_BACK
See Also:
Constant Field Values

STEP_FORWARD

public static final java.lang.String STEP_FORWARD
See Also:
Constant Field Values

MEDIA_STOP

public static final java.lang.String MEDIA_STOP
See Also:
Constant Field Values

VOLUME

public static final java.lang.String VOLUME
See Also:
Constant Field Values

BACK

public static final java.lang.String BACK
See Also:
Constant Field Values

DOWN

public static final java.lang.String DOWN
See Also:
Constant Field Values

FORWARD

public static final java.lang.String FORWARD
See Also:
Constant Field Values

HOME

public static final java.lang.String HOME
See Also:
Constant Field Values

UP

public static final java.lang.String UP
See Also:
Constant Field Values

COLUMN_DELETE

public static final java.lang.String COLUMN_DELETE
See Also:
Constant Field Values

COLUMN_INSERT_AFTER

public static final java.lang.String COLUMN_INSERT_AFTER
See Also:
Constant Field Values

COLUMN_INSERT_BEFORE

public static final java.lang.String COLUMN_INSERT_BEFORE
See Also:
Constant Field Values

ROW_DELETE

public static final java.lang.String ROW_DELETE
See Also:
Constant Field Values

ROW_INSERT_AFTER

public static final java.lang.String ROW_INSERT_AFTER
See Also:
Constant Field Values

ROW_INSERT_BEFORE

public static final java.lang.String ROW_INSERT_BEFORE
See Also:
Constant Field Values

TEXT_ALIGN_CENTER

public static final java.lang.String TEXT_ALIGN_CENTER
See Also:
Constant Field Values

TEXT_ALIGN_JUSTIFY

public static final java.lang.String TEXT_ALIGN_JUSTIFY
See Also:
Constant Field Values

TEXT_ALIGN_LEFT

public static final java.lang.String TEXT_ALIGN_LEFT
See Also:
Constant Field Values

TEXT_ALIGN_RIGHT

public static final java.lang.String TEXT_ALIGN_RIGHT
See Also:
Constant Field Values

BOLD

public static final java.lang.String BOLD
See Also:
Constant Field Values

ITALIC

public static final java.lang.String ITALIC
See Also:
Constant Field Values

NORMAL

public static final java.lang.String NORMAL
See Also:
Constant Field Values

UNDERLINE

public static final java.lang.String UNDERLINE
See Also:
Constant Field Values
Constructor Detail

IconFactory

public IconFactory()
Creates new instance of IconFactory.

Method Detail

getImage

public java.awt.Image getImage(java.lang.String type)
                        throws java.lang.InterruptedException,
                               java.io.IOException
Returns the desired icon as an instance of Image. Useful for AWT applications. Images are retrieved as resources to accomodate a wide variety of possible packaging/distribution methods.

Parameters:
type - Equates to one of the IconFactory static variables to denote image/icon type to load.

Returns:
The requested image as an instance of Image.

Throws:
java.lang.InterruptedException - If the execution thread is interrupted during image loading.

java.io.IOException - If the requested image cannot be located.

getScaledImage

public java.awt.Image getScaledImage(java.lang.String type,
                                     java.awt.Dimension size)
                              throws java.lang.InterruptedException,
                                     java.io.IOException
Returns a scaled instance of the desired Image. The image is resized to the requested Dimension using Image.SCALE_SMOOTH.

Parameters:
type - Equates to one of the IconFactory static variables to denote image/icon type to load.

size - An instance of Dimension denoting the requested image size.

Returns:
The requested image as an instance of Image.

Throws:
java.lang.InterruptedException - If the execution thread is interrupted during image loading.

java.io.IOException - If the requested image cannot be located.

getScaledImage

public java.awt.Image getScaledImage(java.lang.String type,
                                     int width,
                                     int height)
                              throws java.lang.InterruptedException,
                                     java.io.IOException
Returns a scaled instance of the desired Image. The image is resized to the requested width and height using Image.SCALE_SMOOTH.

Parameters:
type - Equates to one of the IconFactory static variables to denote image/icon type to load.

width - An int denoting desired image width in pixels.

height - An int denoting desired image height in pixels.

Returns:
The requested image as an instance of Image.

Throws:
java.lang.InterruptedException - If the execution thread is interrupted during image loading.

java.io.IOException - If the requested image cannot be located.

getIcon

public javax.swing.Icon getIcon(java.lang.String type)
                         throws java.lang.InterruptedException,
                                java.io.IOException
Returns the requested icon as an instance of Icon. For use in Swing applications.

Parameters:
type - Equates to one of the IconFactory static variables to denote image/icon type to load.

Returns:
The requested image as an instance of Icon.

Throws:
java.lang.InterruptedException - If the execution thread is interrupted during image loading.

java.io.IOException - If the requested image cannot be located.

getScaledIcon

public javax.swing.Icon getScaledIcon(java.lang.String type,
                                      java.awt.Dimension size)
                               throws java.lang.InterruptedException,
                                      java.io.IOException
Returns a scaled instance of the requested image as an instance of Icon for use in Swing applications. Icon is resized to the requested Dimension using Image.SCALE_SMOOTH.

Parameters:
type - Equates to one of the IconFactory static variables to denote image/icon type to load.

size - An instance of Dimension denoting the requested image size.

Returns:
The requested image as an instance of Icon.

Throws:
java.lang.InterruptedException - If the execution thread is interrupted during image loading.

java.io.IOException - If the requested image cannot be located.

getScaledIcon

public javax.swing.Icon getScaledIcon(java.lang.String type,
                                      int width,
                                      int height)
                               throws java.lang.InterruptedException,
                                      java.io.IOException
Returns a scaled instance of the requested image as an instance of Icon for use in Swing applications. Icon is resized to the requested width and height using Image.SCALE_SMOOTH.

Parameters:
type - Equates to one of the IconFactory static variables to denote image/icon type to load.

width - An int denoting desired image width in pixels.

height - An int denoting desired image height in pixels.

Returns:
The requested image as an instance of Icon.

Throws:
java.lang.InterruptedException - If the execution thread is interrupted during image loading.

java.io.IOException - If the requested image cannot be located.