|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.iastate.utils.gui.GUIUtils
Common GUI utilities accessed via static methods.
| Nested Class Summary | |
static class |
GUIUtils.ColumnSorter
This comparator is used to sort vectors of data |
| Constructor Summary | |
GUIUtils()
|
|
| Method Summary | |
private static void |
center(java.awt.Component wind,
java.awt.Rectangle rect)
Centers wind within the passed rectangle. |
static void |
centerWithinDesktop(javax.swing.JInternalFrame frame)
Centers passed internal frame within its desktop area. |
static void |
centerWithinParent(java.awt.Window wind)
Centers wind within its parent. |
static void |
centerWithinScreen(java.awt.Window wind)
Centers wind within the screen. |
static void |
deiconify(java.awt.Frame frame)
|
static javax.swing.JInternalFrame[] |
getNonMinimizedNonToolWindows(javax.swing.JInternalFrame[] frames)
Return an array containing all JInternalFrame objects that were passed in frames that are not tool windows. |
static javax.swing.JInternalFrame[] |
getOpenNonToolWindows(javax.swing.JInternalFrame[] frames)
Return an array containing all JInternalFrame objects that were passed in frames that are not tool windows. |
static javax.swing.JInternalFrame[] |
getOpenToolWindows(javax.swing.JInternalFrame[] frames)
Return an array containing all JInternalFrame objects that were passed in frames that are tool windows. |
static java.awt.Frame |
getOwningFrame(java.awt.Component comp)
Return the owning Frame for the passed component
of null if it doesn't have one. |
static javax.swing.JFrame |
getRootFrame(java.awt.Component control)
Get the root JFrame |
static void |
iconify(java.awt.Frame frame)
|
static boolean |
isToolWindow(javax.swing.JInternalFrame frame)
Return true if frame is a tool window. |
static boolean |
isWithinParent(java.awt.Component wind)
|
static javax.swing.Icon |
loadIcon(java.lang.String filename)
Load an icon from a image file eg: GUIUtils.loadIcon("images/semanticwww.gif"); the image file should be in the same jar file or under relative folder |
static java.awt.Image |
loadImage(java.lang.String filename)
Load an image |
static void |
makeToolWindow(javax.swing.JInternalFrame frame,
boolean isToolWindow)
Make the passed internal frame a Tool Window. |
static void |
maximize(java.awt.Frame frame)
|
static void |
minimize(java.awt.Frame frame)
|
static void |
setJButtonSizesTheSame(javax.swing.JButton[] btns)
Change the sizes of all the passed buttons to be the size of the largest one. |
static void |
showModally(javax.swing.JInternalFrame frame)
|
static void |
sortAllRowsBy(javax.swing.table.DefaultTableModel model,
int colIndex,
boolean ascending)
Regardless of sort order (ascending or descending), null values always appear last. |
static void |
updateComboBox(javax.swing.JComboBox theBox,
java.lang.Object[] newdata)
Update the content of a combo box, keep the old selection if possible |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public GUIUtils()
| Method Detail |
public static void centerWithinParent(java.awt.Window wind)
wind within its parent. If it has no parent then
center within the screen. If centering would cause the title bar to go
above the parent (I.E. cannot see the titlebar and so cannot move the
window) then move the window down.
wind - The Window to be centered.
java.lang.IllegalArgumentException - If wind is null.public static void centerWithinDesktop(javax.swing.JInternalFrame frame)
frame - The internal frame to be centered.
java.lang.IllegalArgumentException - If frame is null.public static void centerWithinScreen(java.awt.Window wind)
wind within the screen. If centering would cause the
title bar to go off the top of the screen then move the window down.
wind - The Window to be centered.
java.lang.IllegalArgumentException - If wind is null.public static java.awt.Frame getOwningFrame(java.awt.Component comp)
Frame for the passed component
of null if it doesn't have one.
java.lang.IllegalArgumentException - If wind is null.public static boolean isToolWindow(javax.swing.JInternalFrame frame)
frame - The JInternalFrame to be checked.
java.lang.IllegalArgumentException - If frame is null.
public static void makeToolWindow(javax.swing.JInternalFrame frame,
boolean isToolWindow)
public static void setJButtonSizesTheSame(javax.swing.JButton[] btns)
btns - Array of buttons to eb resized.
java.lang.IllegalArgumentException - If btns is null.public static javax.swing.JInternalFrame[] getOpenToolWindows(javax.swing.JInternalFrame[] frames)
frames - JInternalFrame objects to be checked.public static javax.swing.JInternalFrame[] getOpenNonToolWindows(javax.swing.JInternalFrame[] frames)
frames - JInternalFrame objects to be checked.public static javax.swing.JInternalFrame[] getNonMinimizedNonToolWindows(javax.swing.JInternalFrame[] frames)
frames - JInternalFrame objects to be checked.public static boolean isWithinParent(java.awt.Component wind)
public static void showModally(javax.swing.JInternalFrame frame)
private static void center(java.awt.Component wind,
java.awt.Rectangle rect)
wind within the passed rectangle.
wind - The Window to be centered.rect - The rectangle (in screen coords) to center
wind within.
java.lang.IllegalArgumentException - If Window or Rectangle is null.
public static void sortAllRowsBy(javax.swing.table.DefaultTableModel model,
int colIndex,
boolean ascending)
public static void updateComboBox(javax.swing.JComboBox theBox,
java.lang.Object[] newdata)
newdata - Object[]public static javax.swing.Icon loadIcon(java.lang.String filename)
filename - String
public static java.awt.Image loadImage(java.lang.String filename)
filename - String
public static void iconify(java.awt.Frame frame)
public static void deiconify(java.awt.Frame frame)
public static void minimize(java.awt.Frame frame)
public static void maximize(java.awt.Frame frame)
public static javax.swing.JFrame getRootFrame(java.awt.Component control)
control - Component
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||