public class JTFTools
extends java.lang.Object
Constructor and Description |
---|
JTFTools() |
Modifier and Type | Method and Description |
---|---|
static java.awt.Container |
createEmptyContainer()
Returns an empty lightweight container.
|
static java.awt.Color |
decodeColor(java.lang.String name)
Decodes a color name.
|
static java.awt.Font |
decodeFont(java.lang.String str)
Decodes a font in the style of
Font.decode . |
static java.awt.Font |
decodeFont(java.lang.String str,
java.awt.Font oldFont)
Decodes a font in the style of
Font.decode . |
static java.applet.Applet |
getApplet()
Returns the current applet.
|
static java.awt.Frame |
getEnclosingFrame(java.awt.Component comp)
Returns the frame that encloses the specified component.
|
static java.awt.Font |
getStandardFont(java.awt.Font font)
Returns a font that will approximate the specified font in this environment.
|
static boolean |
isAnonymous(java.lang.Thread t)
Returns
true if the supplied thread is an anonymous
one created automatically by the system. |
static void |
pause(double milliseconds)
Delays the calling thread for the specified time, which is expressed in
milliseconds.
|
static void |
registerApplet(java.applet.Applet applet)
Adds this applet to a table indexed by the current thread.
|
static void |
registerApplet(java.applet.Applet applet,
java.lang.Thread thread)
Adds this applet to a table indexed by the specified thread.
|
static void |
terminateAppletThreads(java.applet.Applet applet)
Terminates all of the threads that are registered as belonging to the
specified applet.
|
public static java.awt.Container createEmptyContainer()
public static java.awt.Frame getEnclosingFrame(java.awt.Component comp)
comp
- The component at which to start the searchFrame
objectpublic static java.awt.Font getStandardFont(java.awt.Font font)
Serif
, SansSerif
, and Monospaced
.font
- The font being checkedpublic static java.awt.Font decodeFont(java.lang.String str)
Font.decode
.str
- The string to decodepublic static java.awt.Font decodeFont(java.lang.String str, java.awt.Font oldFont)
Font.decode
. The only difference
is that this method takes a font parameter that gives default values for
the different parts of the font. If the family, size, or style is specified
as an asterisk, the corresponding value is taken from the supplied font.str
- The string to decodeoldFont
- The font whose properties are used as defaultspublic static java.awt.Color decodeColor(java.lang.String name)
Color.decode
except in that it allows named colors and system colors.name
- The string name of the colorpublic static void registerApplet(java.applet.Applet applet)
applet
- The applet being registeredpublic static void registerApplet(java.applet.Applet applet, java.lang.Thread thread)
applet
- The applet being registeredthread
- The thread used as the keypublic static java.applet.Applet getApplet()
init
method of a program,
which is the only context in which it is applied in the JTF tools.public static void pause(double milliseconds)
Thread.sleep
, this method never throws an
exception.milliseconds
- The sleep time in millisecondspublic static void terminateAppletThreads(java.applet.Applet applet)
applet
- The applet whose threads are being terminatedpublic static boolean isAnonymous(java.lang.Thread t)
true
if the supplied thread is an anonymous
one created automatically by the system.t
- The thread being tested