|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectkiwi.util.KiwiUtils
This class consists of several convenience routines and constants, all of which are static.
Field Summary | |
private static AboutFrame |
aboutFrame
|
static int |
blockSize
The data transfer block size. |
static java.awt.Font |
boldFont
A default bold font. |
private static java.awt.datatransfer.Clipboard |
clipboard
|
static javax.swing.border.EmptyBorder |
defaultBorder
A default Kiwi border (empty, 5 pixels on all sides). |
static javax.swing.border.EmptyBorder |
emptyBorder
A default Kiwi border (empty, 0 pixels on all sides). |
static java.awt.Insets |
emptyInsets
Empty insets (zero pixels on all sides). |
static java.io.File |
filesystemRoot
The root of the filesystem. |
static java.awt.Insets |
firstBottomInsets
Predefined insets for first component on last line. |
static java.awt.Insets |
firstInsets
Predefined insets for first component on first or subsequent lines. |
static java.awt.Font |
italicFont
A default italic font. |
static java.awt.Insets |
lastBottomInsets
Predefined insets for last component on last line. |
private static java.awt.Cursor |
lastCursor
|
static java.awt.Insets |
lastInsets
Predefined insets for last component on first or subsequent lines. |
static java.awt.Point |
origin
An origin point: (0,0) |
private static java.awt.Frame |
phantomFrame
A phantom Frame. |
static java.awt.Font |
plainFont
A default plain font. |
private static ResourceManager |
resmgr
|
Constructor Summary | |
private |
KiwiUtils()
|
Method Summary | |
private static void |
_cascadeWindow(java.awt.Window parent,
java.awt.Window w,
int offsetx,
int offsety)
|
private static void |
_positionWindow(java.awt.Window w,
int x,
int y)
|
static void |
busyOff(java.awt.Component c)
Turn off the busy cursor. |
static void |
busyOn(java.awt.Component c)
Turn on a busy cursor. |
static void |
cascadeWindow(java.awt.Component c,
java.awt.Window w)
Cascade a window off of a component's parent window. |
static void |
cascadeWindow(java.awt.Window parent,
java.awt.Window w)
Cascade a window off of a parent window. |
static void |
cascadeWindow(java.awt.Window parent,
java.awt.Window w,
int offset)
Cascade a window off of a parent window. |
static void |
cascadeWindow(java.awt.Window parent,
java.awt.Window w,
int offsetx,
int offsety)
Cascade a window off of a parent window. |
static void |
centerWindow(java.awt.Component c,
java.awt.Window w)
Center a window within the bounds of a component's parent window. |
static void |
centerWindow(java.awt.Window w)
Center a window on the screen. |
static void |
centerWindow(java.awt.Window parent,
java.awt.Window w)
Center a window within the bounds of another window. |
static int |
deleteTree(java.io.File parent)
Recursively delete files in a directory. |
static java.awt.datatransfer.Clipboard |
getClipboard()
Get a reference to the system clipboard. |
static java.lang.String |
getClipboardText()
Copy text from the system clipboard. |
static java.awt.Frame |
getFrameForComponent(java.awt.Component c)
Get the Frame parent of a component. |
static AboutFrame |
getKiwiAboutFrame()
Get an instance to a prebuilt about window that describes the Kiwi Toolkit itself. |
static java.awt.Frame |
getPhantomFrame()
Get a reference to a phantom frame. |
static ResourceManager |
getResourceManager()
Get a reference to the internal resource manager singleton. |
static void |
paintImmediately(java.awt.Component c)
Paint a component immediately. |
static boolean |
printWindow(java.awt.Window window,
java.lang.String title)
Print a hardcopy of the contents of a window. |
static byte[] |
readStreamToByteArray(java.io.InputStream input)
Deprecated. This method has been moved to the StreamUtils class. |
static java.io.OutputStream |
readStreamToStream(java.io.InputStream input,
java.io.OutputStream output)
Deprecated. This method has been moved to the StreamUtils class. |
static java.lang.String |
readStreamToString(java.io.InputStream input)
Deprecated. This method has been moved to the StreamUtils class. |
static void |
setClipboardText(java.lang.String text)
Copy text to the system clipboard. |
static void |
setDefaultLookAndFeel()
Set the default cross-platform Look and Feel |
static void |
setFonts(java.awt.Container container,
java.awt.Font font)
Recursively set the font on a container and all of its descendant components. |
static void |
setNativeLookAndFeel()
Set the native (system) Look and Feel |
static void |
sleep(int sec)
Suspend the calling thread. |
static void |
writeStringToStream(java.lang.String s,
java.io.OutputStream output)
Deprecated. This method has been moved to the StreamUtils class. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int blockSize
private static java.awt.Frame phantomFrame
public static final java.awt.Insets emptyInsets
public static final javax.swing.border.EmptyBorder defaultBorder
public static final javax.swing.border.EmptyBorder emptyBorder
public static final java.awt.Insets firstInsets
public static final java.awt.Insets lastInsets
public static final java.awt.Insets firstBottomInsets
public static final java.awt.Insets lastBottomInsets
public static final java.io.File filesystemRoot
public static final java.awt.Font boldFont
public static final java.awt.Font plainFont
public static final java.awt.Font italicFont
public static final java.awt.Point origin
private static java.awt.Cursor lastCursor
private static java.awt.datatransfer.Clipboard clipboard
private static ResourceManager resmgr
private static AboutFrame aboutFrame
Constructor Detail |
private KiwiUtils()
Method Detail |
public static final void paintImmediately(java.awt.Component c)
c
- The component to repaint.public static final void cascadeWindow(java.awt.Window parent, java.awt.Window w, int offset)
parent
- The parent window.w
- The window to cascade.offset
- The number of pixels to offset the window by
vertically and horizontally.public static final void cascadeWindow(java.awt.Window parent, java.awt.Window w, int offsetx, int offsety)
parent
- The parent window.w
- The window to cascade.offsetx
- The number of pixels to offset the window by horizontally.offsety
- The number of pixels to offset the window by vertically.public static final void cascadeWindow(java.awt.Window parent, java.awt.Window w)
parent
- The parent window.w
- The window to cascade.public static final void cascadeWindow(java.awt.Component c, java.awt.Window w)
w
- The window to cascade.c
- The component off whose parent window this window should be
cascaded. If a window cannot be found in the component hierarchy above
c
, the window is centered on the screen.private static void _cascadeWindow(java.awt.Window parent, java.awt.Window w, int offsetx, int offsety)
public static final void centerWindow(java.awt.Window w)
w
- The window to center.private static final void _positionWindow(java.awt.Window w, int x, int y)
public static final void centerWindow(java.awt.Window parent, java.awt.Window w)
w
- The window to center.parent
- The window to center within.public static final void centerWindow(java.awt.Component c, java.awt.Window w)
w
- The window to center.c
- The component within whose parent window this window should be
centered. If a window cannot be found in the component hierarchy above
c
, the window is centered on the screen.public static final void busyOn(java.awt.Component c)
c
- The component whose cursor will be changed.public static final void busyOff(java.awt.Component c)
c
- The component whose cursor will be changed.public static final java.awt.Frame getFrameForComponent(java.awt.Component c)
public static final boolean printWindow(java.awt.Window window, java.lang.String title)
window
- The window to print.title
- A title for the print job.
true
if the print job was started, or
false
if the user cancelled the print dialog.public static final java.awt.datatransfer.Clipboard getClipboard()
public static final void setClipboardText(java.lang.String text)
text
- The text to copy to the clipboard.public static final java.lang.String getClipboardText()
null
if the
clipboard is empty or does not contain plain text.public static final ResourceManager getResourceManager()
public static final void sleep(int sec)
sec
- The number of seconds to sleep.public static final java.io.OutputStream readStreamToStream(java.io.InputStream input, java.io.OutputStream output) throws java.io.IOException
input
- The input stream.output
- The output stream.
java.io.IOException
- If an error occurred while reading from
the stream.public static final java.lang.String readStreamToString(java.io.InputStream input) throws java.io.IOException
String
. Note that this method is not unicode-aware.
input
- The stream to read from.
String
.
java.io.IOException
- If an error occurred while reading from
the stream.public static final void writeStringToStream(java.lang.String s, java.io.OutputStream output) throws java.io.IOException
s
- The string to write.output
- The stream to write it to.
java.io.IOException
- If an error occurred while writing to the
stream.public static final byte[] readStreamToByteArray(java.io.InputStream input) throws java.io.IOException
byte
array.
input
- The stream to read from.
byte
array.
java.io.IOException
- If an error occurred while reading from
the stream.public static final java.awt.Frame getPhantomFrame()
public static final AboutFrame getKiwiAboutFrame()
public static final int deleteTree(java.io.File parent)
parent
- The parent (presumed to be a directory) of the files to
be deleted. The parent is not deleted.
public static void setFonts(java.awt.Container container, java.awt.Font font)
container
- The container.font
- The new font.public static void setDefaultLookAndFeel()
public static void setNativeLookAndFeel()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |