|
JET | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.utep.cs.jet.gui.Util
public abstract class Util
A utility class that provides various static utility methods.
| Field Summary |
|---|
| Method Summary | |
|---|---|
static void |
addHidePopupMenu(JComponent comp,
String title,
AbstractAction action)
Adds a popup menu to the given component. |
static void |
addPopupMenu(JComponent comp,
JPopupMenu menu)
Adds the given popup menu to the given component. |
static void |
centerWindow(Component window)
Centers the given window within the screen. |
static Border |
createBorder(String title,
JComponent comp,
int gap)
Creates a compound boder consisting of a titled border and an empty border. |
static ComponentListener |
createComponentListener(int w,
int h)
Returns a component listener that prohibits the component c from being resized smaller than the width
w and the height h. |
static Box |
createRow(JComponent... comps)
Creates a horizontal box consisting of the given components. |
static JScrollPane |
createScrollPane(Component comp)
Creates a scroll pane for the given component. |
static void |
debug(String msg)
Prints the given message on stdout if the debug
flag Constants.DEBUG is true; otherwise, do nothing. |
static String |
getBaseName(File file)
Returns the base name of the give file. |
static ImageIcon |
getIcon(String name)
Returns an image icon whose image is read from the file named name. |
static void |
invokeAndWait(Runnable job)
Runs the given job in a thread-safe way. |
static void |
invokeLater(Runnable job)
Runs the given job in a thread-safe way. |
static boolean |
isClassFile(File file)
Returns true if the given file is a Java class file. |
static boolean |
isClassFile(String name)
Returns true if the given name ends with .class. |
static boolean |
isJavaFile(File file)
Returns true if the given file is a Java source file. |
static boolean |
isJavaFile(String name)
Returns true if the argument names a Java source file. |
static JScrollPane |
makeScrollable(JComponent comp)
Adds to the given component horizontal and vertical scroll bars. |
static void |
run(Runnable job)
Runs the given job in a new thread. |
static void |
setSize(JComponent c,
int width,
int height)
Sets the minimum, maximum, and preferred size of the given component. |
static boolean |
synthesized(String name)
Returns true if the given name is synthesized. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void addPopupMenu(JComponent comp,
JPopupMenu menu)
public static void addHidePopupMenu(JComponent comp,
String title,
AbstractAction action)
public static JScrollPane createScrollPane(Component comp)
public static void invokeAndWait(Runnable job)
public static void invokeLater(Runnable job)
public static void run(Runnable job)
public static void centerWindow(Component window)
window - The window to center.
requires window != null;
public static ImageIcon getIcon(String name)
name. A null is returned if reading the file fails.
public static void debug(String msg)
stdout if the debug
flag Constants.DEBUG is true; otherwise, do nothing.
public static boolean isJavaFile(String name)
public static boolean isJavaFile(File file)
public static boolean isClassFile(File file)
public static boolean isClassFile(String name)
.class.
public static String getBaseName(File file)
public static boolean synthesized(String name)
public static void setSize(JComponent c,
int width,
int height)
public static ComponentListener createComponentListener(int w,
int h)
c from being resized smaller than the width
w and the height h.
public static JScrollPane makeScrollable(JComponent comp)
public static Border createBorder(String title,
JComponent comp,
int gap)
public static Box createRow(JComponent... comps)
|
JET | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||