|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.metamatrix.console.util.StaticUtilities
public class StaticUtilities
Class containing miscellaneous useful static utility methods.
Field Summary | |
---|---|
static int |
MAX_MODAL_DIALOG_TEXT_WIDTH
|
static int |
PREFERRED_MODAL_DIALOG_TEXT_WIDTH
|
Constructor Summary | |
---|---|
StaticUtilities()
|
Method Summary | |
---|---|
static java.util.Vector |
arrayToVector(java.lang.Object[] array)
|
static java.awt.Color |
averageRGBVals(java.awt.Color[] colors)
Return the average color of an array of colors. |
static java.awt.Point |
centerFrame(java.awt.Dimension frameSize)
Version of centerFrame() (above) to get the screen size itself. |
static java.awt.Point |
centerFrame(java.awt.Dimension frameSize,
java.awt.Dimension screenSize)
Return a Point at which a frame should be located to center it on the screen, given the frame size and the screen size. |
static java.lang.String |
deleteChar(java.lang.String sSource,
char charToRemove)
Drop any occurrences of the indicated character from the String provided, and return the resulting String. |
static java.util.List |
descendantsOfComponent(java.awt.Component startComp)
Return a List, not necessarily in any particular order, of all descendant Components of a Component. |
static void |
disableComponents(java.awt.Container ct)
|
static void |
displayModalDialogWithOK(java.awt.Component parent,
java.lang.String header,
java.lang.String msg)
Display a modal dialog with an 'OK' button. |
static void |
displayModalDialogWithOK(java.awt.Component parent,
java.lang.String header,
java.lang.String msg,
int messageType)
Display a modal dialog with an 'OK' button. |
static void |
displayModalDialogWithOK(java.lang.String hdr,
java.lang.String msg)
Display a modal dialog with an 'OK' button. |
static void |
displayModalDialogWithOK(java.lang.String hdr,
java.lang.String msg,
int messageType)
Display a modal dialog with an 'OK' button. |
static java.util.Vector |
doubleArrayToVector(java.lang.Object[][] array)
|
static void |
endWait()
|
static void |
endWait(java.awt.Component childComponent)
Clear the wait cursor on the frame that contains the specified childComponent |
static java.text.SimpleDateFormat |
getDefaultDateFormat()
|
static java.lang.String |
getDirectoryName(java.lang.String fullFileName)
|
static java.lang.String |
getFileName(java.lang.String fullFileName)
|
static java.lang.String[] |
getLineBreakSubstrings(java.lang.String str)
Return the segments of a string that are between linebreaks in the input string. |
static int |
greatestCommonDivisor(int[] array)
Return the greatest common divisor of an array of positive integers. |
static java.lang.String |
insertLineBreaks(java.lang.String str,
int preferredMaxLineLen,
int maxMaxLineLen)
Insert linefeed characters into an input string such that the resulting string has no segments more than maxLineLen characters in length, and strings are never broken within a word (unless this is unavoidable because a word occupies more than a whole line). |
static java.util.Collection |
intersectionOf(java.util.Collection collections)
Return a Collection representing the intersection of given Collections. |
static void |
invokeAndWaitSafe(java.lang.Runnable runnable)
Invoke the specified operation in the Swing thread, and wait until it completes. |
static void |
invokeLaterSafe(java.lang.Runnable runnable)
Invoke the specified operation in the Swing thread, and don't necessarily wait until it completes. |
static boolean |
isShowingWaitCursor()
|
static void |
jiggleSplitter(javax.swing.JSplitPane splitPane)
Attempt to force a repaint on a split pane by moving the splitter by one pixel and then back again. |
static int |
leastCommonMultiple(int[] array)
Return the least common multiple of an array of integers. |
static int |
longestNonBlankStringSegment(java.lang.String str)
Return the longest segment between blanks within a String. |
static java.lang.String |
parseDelimitedStringGetRight(java.lang.String sTheString,
java.lang.String sDelim)
|
static int[] |
primeFactors(int num)
Return the prime factors of a number. |
static java.lang.String |
roundToNumDecimalPlaces(double inputVal,
int numDecPlaces)
/ Returns a string representing a value rounded to a given number of decimal places. |
static void |
setDateFormat(java.lang.String format)
|
static void |
startWait()
|
static void |
startWait(java.awt.Component childComponent)
Start the wait cursor on the frame that contains the specified childComponent |
static java.lang.String[] |
tokenize(java.lang.String str)
Return an array of tokens in a String. |
static java.util.Collection |
unionOf(java.util.Collection collections)
Return a Collection representing the union of given Collections. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int PREFERRED_MODAL_DIALOG_TEXT_WIDTH
public static final int MAX_MODAL_DIALOG_TEXT_WIDTH
Constructor Detail |
---|
public StaticUtilities()
Method Detail |
---|
public static java.lang.String roundToNumDecimalPlaces(double inputVal, int numDecPlaces)
public static java.awt.Point centerFrame(java.awt.Dimension frameSize, java.awt.Dimension screenSize)
public static java.awt.Point centerFrame(java.awt.Dimension frameSize)
public static java.lang.String insertLineBreaks(java.lang.String str, int preferredMaxLineLen, int maxMaxLineLen)
str
- input Stringint
- preferredMaxLineLen preferred maximum allowable length of any segment in the string without inserting linebreaksint
- maxMaxLineLen absolute maximum allowable length of any segment in the string without inserting linebreeaks
public static java.lang.String[] getLineBreakSubstrings(java.lang.String str)
public static void displayModalDialogWithOK(java.awt.Component parent, java.lang.String header, java.lang.String msg, int messageType)
public static void displayModalDialogWithOK(java.awt.Component parent, java.lang.String header, java.lang.String msg)
public static void displayModalDialogWithOK(java.lang.String hdr, java.lang.String msg, int messageType)
public static void displayModalDialogWithOK(java.lang.String hdr, java.lang.String msg)
public static void setDateFormat(java.lang.String format)
public static java.text.SimpleDateFormat getDefaultDateFormat()
public static int longestNonBlankStringSegment(java.lang.String str)
public static java.lang.String[] tokenize(java.lang.String str)
public static java.lang.String deleteChar(java.lang.String sSource, char charToRemove)
public static java.util.List descendantsOfComponent(java.awt.Component startComp)
public static int[] primeFactors(int num)
public static java.util.Collection intersectionOf(java.util.Collection collections)
public static java.util.Collection unionOf(java.util.Collection collections)
public static int greatestCommonDivisor(int[] array)
public static int leastCommonMultiple(int[] array)
public static void jiggleSplitter(javax.swing.JSplitPane splitPane)
public static void startWait(java.awt.Component childComponent)
public static void startWait()
public static void endWait(java.awt.Component childComponent)
public static void endWait()
public static boolean isShowingWaitCursor()
public static java.awt.Color averageRGBVals(java.awt.Color[] colors)
public static void disableComponents(java.awt.Container ct)
public static java.lang.String getFileName(java.lang.String fullFileName)
public static java.lang.String getDirectoryName(java.lang.String fullFileName)
public static java.lang.String parseDelimitedStringGetRight(java.lang.String sTheString, java.lang.String sDelim)
public static java.util.Vector arrayToVector(java.lang.Object[] array)
public static java.util.Vector doubleArrayToVector(java.lang.Object[][] array)
public static void invokeAndWaitSafe(java.lang.Runnable runnable) throws java.lang.Throwable
runnable
-
Execption
java.lang.Throwable
public static void invokeLaterSafe(java.lang.Runnable runnable)
runnable
-
Execption
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |