com.bigzip.plugin.support.ui
Class WindowUtilities

java.lang.Object
  |
  +--com.bigzip.plugin.support.ui.WindowUtilities

public final class WindowUtilities
extends java.lang.Object


Field Summary
static int CROSSHAIR_CURSOR
           
static int DEFAULT_CURSOR
           
static int E_RESIZE_CURSOR
           
static int HAND_CURSOR
           
static int MOVE_CURSOR
           
static int N_RESIZE_CURSOR
           
static int NE_RESIZE_CURSOR
           
static int NW_RESIZE_CURSOR
           
static int S_RESIZE_CURSOR
           
static int SE_RESIZE_CURSOR
           
static int SW_RESIZE_CURSOR
           
static int W_RESIZE_CURSOR
           
static int WAIT_CURSOR
           
 
Constructor Summary
WindowUtilities()
           
 
Method Summary
static void center(java.awt.Window window)
          Centers a Window on the screen
static javax.swing.JDialog createDialog(java.lang.String title, boolean modal)
          Produces a dialog component with the parent (BiGZiP Frame) allocated to it.
static javax.swing.Icon getDefaultDirectoryIcon()
          Returns the standard icon used for files.
static javax.swing.Icon getIconForFile(java.lang.String filename)
          Returns the associated icon for a given file.
static javax.swing.Icon getIconForType(java.lang.String type)
          Returns the associated icon for a given file extension.
static java.awt.Frame getParentFrame()
          Use this method when producing frames or dialogs that require a parent to be set.
static void setCursor(int type)
          Provides access to changing the cursor with respect to the parent frame.
static void setFrame(com.bigzip.ui.BiGZiPFrame frame)
          Used by the BiGZiP GUI to set the parent frame.
static void setLocationRelativeTo(java.awt.Component child)
          Sets the location of the dialog relative to the specified component.
static void setLocationRelativeTo(java.awt.Component parent, java.awt.Component child)
          Sets the location of the child relative to the specified parent.
static void show(java.awt.Window window)
          Displays a window component on screen by packing it, setting it relative to the parent (BiGZiP Frame) and then showing it.
static void showErrorDialog(java.lang.String message, java.lang.String title)
          Displays an error dialog component on the screen.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_CURSOR

public static final int DEFAULT_CURSOR

CROSSHAIR_CURSOR

public static final int CROSSHAIR_CURSOR

WAIT_CURSOR

public static final int WAIT_CURSOR

SW_RESIZE_CURSOR

public static final int SW_RESIZE_CURSOR

SE_RESIZE_CURSOR

public static final int SE_RESIZE_CURSOR

NW_RESIZE_CURSOR

public static final int NW_RESIZE_CURSOR

NE_RESIZE_CURSOR

public static final int NE_RESIZE_CURSOR

N_RESIZE_CURSOR

public static final int N_RESIZE_CURSOR

S_RESIZE_CURSOR

public static final int S_RESIZE_CURSOR

W_RESIZE_CURSOR

public static final int W_RESIZE_CURSOR

E_RESIZE_CURSOR

public static final int E_RESIZE_CURSOR

HAND_CURSOR

public static final int HAND_CURSOR

MOVE_CURSOR

public static final int MOVE_CURSOR
Constructor Detail

WindowUtilities

public WindowUtilities()
Method Detail

setFrame

public static void setFrame(com.bigzip.ui.BiGZiPFrame frame)
Used by the BiGZiP GUI to set the parent frame.
Parameters:
frame - the parent frame.

setLocationRelativeTo

public static void setLocationRelativeTo(java.awt.Component child)
Sets the location of the dialog relative to the specified component. If the component is not currently showing, the dialog is centered on the screen.
Parameters:
child - the component in relation to which the dialog's location is determined.

setLocationRelativeTo

public static void setLocationRelativeTo(java.awt.Component parent,
                                         java.awt.Component child)
Sets the location of the child relative to the specified parent. If the parent is not currently showing, the dialog is centered on the screen.
Parameters:
parent - the reference component.
child - the component to be placed in relation to the parent.

center

public static final void center(java.awt.Window window)
Centers a Window on the screen
Parameters:
window - the window to be centered.

createDialog

public static final javax.swing.JDialog createDialog(java.lang.String title,
                                                     boolean modal)
Produces a dialog component with the parent (BiGZiP Frame) allocated to it. The dialog is also place relative to the BiGZiP Frame.
Parameters:
title - the text to be placed on the top of the dialog window.
modal - whether or not the GUI should pause on this component.
Returns:
the newly created dialog.

getIconForFile

public static final javax.swing.Icon getIconForFile(java.lang.String filename)
Returns the associated icon for a given file.
Parameters:
filename - the file to interigate for an association.
Returns:
Icon the associated image. If none is set for the file's extension, then a default icon is returned.

getIconForType

public static final javax.swing.Icon getIconForType(java.lang.String type)
Returns the associated icon for a given file extension.
Parameters:
type - the file extension to interigate for an association.
Returns:
Icon the associated image. If none is set for the file's extension, then a default icon is returned.

getDefaultDirectoryIcon

public static final javax.swing.Icon getDefaultDirectoryIcon()
Returns the standard icon used for files.
Returns:
Icon the default icon for non-associated files.

getParentFrame

public static java.awt.Frame getParentFrame()
Use this method when producing frames or dialogs that require a parent to be set.
Returns:
the parent frame.

show

public static final void show(java.awt.Window window)
Displays a window component on screen by packing it, setting it relative to the parent (BiGZiP Frame) and then showing it.
Parameters:
window - the window component to be displayed.

showErrorDialog

public static final void showErrorDialog(java.lang.String message,
                                         java.lang.String title)
Displays an error dialog component on the screen.
Parameters:
message - the error message to be displayed.
title - the title shown on the dialog.

setCursor

public static final void setCursor(int type)
Provides access to changing the cursor with respect to the parent frame.
Parameters:
type - the cursor type to change to.