|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--UtilCM
Collection of utility functions used by various other classes.
This work was produced by Peter Lemkin of the National Cancer Institute, an agency of the United States Government. As a work of the United States Government there is no associated copyright. It is offered as open source software under the Mozilla Public License (version 1.1) subject to the limitations noted in the accompanying LEGAL file.
| Field Summary | |
static boolean |
dbugFlag
Local debugging flag. |
TextFrame |
err
error msg text frame |
TextFrame |
out
output and error text frames |
java.awt.TextField |
status2Text
|
java.awt.TextField |
status3Text
|
java.awt.TextField |
statusText
Contents of last status messages |
| Constructor Summary | |
UtilCM(boolean dbugFlag)
UtilCM() - constructor for setup utility pkg |
|
| Method Summary | |
boolean |
copyFile(java.lang.String srcName,
java.lang.String dstName,
java.lang.String optUpdateMsg,
int optEstInputFileLth)
copyFile() - binary copy of one file or URL toa local file |
static java.lang.String |
cvb2s(boolean b)
cvb2s() - convert boolean String |
static boolean |
cvs2b(java.lang.String str,
boolean defaultBool)
cvs2b() - convert String to boolean |
static float |
cvs2f(java.lang.String str,
float defaultFloat)
cvs2f() - convert String to float |
static int |
cvs2i(java.lang.String str,
int defaultInt)
cvs2i() - convert String to int |
static long |
cvs2l(java.lang.String str,
long defaultLong)
cvs2l() - convert String to long |
static java.lang.String |
dateStr()
dateStr() - return a new Date string of the current day and time |
boolean |
deleteLocalFile(java.lang.String fileName)
deleteLocalFile() - delete local file. |
boolean |
delFile(java.lang.String fullFileName)
delFile() - Delete specifile file specified with full path. |
void |
logMsg(java.lang.String msg)
logMsg() - log the message in statusText and log file window drawing it in Color.black. |
void |
logMsg(java.lang.String msg,
boolean isVisibleFlag,
java.awt.Color color)
logMsg() - log the message in statusText and log file window |
void |
logMsg(java.lang.String msg,
java.awt.Color color)
logMsg() - log the message in statusText and log file window |
void |
logMsg2(java.lang.String msg,
boolean isVisibleFlag,
java.awt.Color color)
logMsg2() - log the message in status2Text and log file window |
void |
logMsg2(java.lang.String msg,
java.awt.Color color)
logMsg2() - log the message in status2Text and log file window |
void |
logMsg3(java.lang.String msg,
boolean isVisibleFlag,
java.awt.Color color)
logMsg3() - log the message in status3Text and log file window |
void |
logMsg3(java.lang.String msg,
java.awt.Color color)
logMsg3() - log the message in status3Text and log file window |
static java.lang.String |
mapComma2Tab(java.lang.String s)
mapComma2Tab() - map "," to "\t" in the string |
(package private) static java.lang.String |
mapIllegalChars(java.lang.String str)
mapIllegalChars() - map characters to '_' i.e. |
static java.lang.String |
mapSpaceToMinus(java.lang.String str)
mapSpaceToMinus() - map " " to "-" |
static java.lang.String |
removeQuotes(java.lang.String line)
removeQuotes() - remove '\"' characters from line |
void |
setOutErrTextFrames(TextFrame out,
TextFrame err)
setOutErrTextFrames() - set out and err text frames |
void |
setStatusTextFrames(java.awt.TextField statusText,
java.awt.TextField status2Text,
java.awt.TextField status3Text)
setStatusTextFrames() - set status text frames |
static java.lang.String |
timeStr()
timeStr() - return a new daytime HH:MM:SS string of the current time |
(package private) boolean |
updateCvt2MaeJarFile()
updateCvt2MaeJarFile() - update MAExplorer.jar into program install area. |
(package private) boolean |
updateCvt2MaeProgram()
updateCvt2MaeProgram() - verify that want to update the Cvt2Mae.jar file from the maexplorer.sourceforge.net server. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
public java.awt.TextField statusText
public java.awt.TextField status2Text
public java.awt.TextField status3Text
public TextFrame out
public TextFrame err
public static boolean dbugFlag
| Constructor Detail |
public UtilCM(boolean dbugFlag)
dbugFlag - | Method Detail |
public void setStatusTextFrames(java.awt.TextField statusText,
java.awt.TextField status2Text,
java.awt.TextField status3Text)
statusText - is text field 1statusText - is text field 2statusText - is text field 3
public void setOutErrTextFrames(TextFrame out,
TextFrame err)
out - is text output fielderr - is text error output field
public void logMsg(java.lang.String msg,
java.awt.Color color)
msg - is message to logcolor - to draw the messagepublic void logMsg(java.lang.String msg)
msg - is message to log
public void logMsg(java.lang.String msg,
boolean isVisibleFlag,
java.awt.Color color)
msg - is message to logisVisibleFlag - to make log popup visible/invisiblecolor - to draw the messageTextFrame.appendLog(java.lang.String)
public void logMsg2(java.lang.String msg,
java.awt.Color color)
msg - is message to logcolor - to draw the message
public void logMsg2(java.lang.String msg,
boolean isVisibleFlag,
java.awt.Color color)
msg - is message to logisVisibleFlag - to make log popup visible/invisiblecolor - to draw the messageTextFrame.appendLog(java.lang.String)
public void logMsg3(java.lang.String msg,
java.awt.Color color)
msg - is message to logcolor - to draw the message
public void logMsg3(java.lang.String msg,
boolean isVisibleFlag,
java.awt.Color color)
msg - is message to logisVisibleFlag - to make log popup visible/invisiblecolor - to draw the messageTextFrame.appendLog(java.lang.String)public static java.lang.String dateStr()
public static java.lang.String timeStr()
public static java.lang.String mapComma2Tab(java.lang.String s)
s - input string to mappublic static java.lang.String cvb2s(boolean b)
b - is boolean input to convert
public static float cvs2f(java.lang.String str,
float defaultFloat)
str - containing floating point number to convert to float
public static long cvs2l(java.lang.String str,
long defaultLong)
str - containing integer to convert to long
public static int cvs2i(java.lang.String str,
int defaultInt)
str - containing integer to convert to int
public static boolean cvs2b(java.lang.String str,
boolean defaultBool)
str - containing either "true" or "false"static java.lang.String mapIllegalChars(java.lang.String str)
str - to mappublic static java.lang.String mapSpaceToMinus(java.lang.String str)
str - to mappublic boolean delFile(java.lang.String fullFileName)
fullFileName - of file to deletepublic static java.lang.String removeQuotes(java.lang.String line)
line - to check and edit out quotes
public boolean copyFile(java.lang.String srcName,
java.lang.String dstName,
java.lang.String optUpdateMsg,
int optEstInputFileLth)
srcName - is either a full path local file name or
a http:// prefixed URL string of the source file.dstName - is the full path of the local destination file nameoptUpdateMsg - (opt) will display message in showMsg() and
increasing ... in showMsg2(). One '.' for every 10K bytes read.
This only is used when reading a URL. Set to null if not used.optEstInputFileLth - is the estimate size of the in;ut file if known
else 0. Used in progress bar.public boolean deleteLocalFile(java.lang.String fileName)
final boolean updateCvt2MaeJarFile()
[1] Define directory for MAExplorer.jar path and other file and URL names.
[2] Backup the old MAExplorer.jar as MAExplorer.jar.bkup
[3] Open the url: from maeJarURL. This is hardwired to be
"http://maexplorer.sourceforge.net/MAExplorer/MAExplorer.jar"
and read the file from the Web into local file "MAExplorer.jar.tmp"
[4] Move the "MAExplorer.jar.tmp" file into "MAExplorer.jar" in the program directory
Since changing the MAExplorer.jar file is a potential security risk,
we make this procedure final and hardwire the maeJarURL!
copyFile(java.lang.String, java.lang.String, java.lang.String, int),
deleteLocalFile(java.lang.String)boolean updateCvt2MaeProgram()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||