|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--MJAbase | +--MJAutil
MAExplorer Open Java API class to access MJAutil methods and data structures. This class contains common utility functions used by the rest of MAExplorer. These include, several string-numeric converters, access to the three message lines in the top page as well as special string array parsing, font string name to int size, ratio color setting, zoom toggle mapping, etc.
List of methods available to Plugin-writers
maeRepaint() - repaint MAExplorer main window. showMsg() - display string in text field 1 in main window. showMsg1() - display string in text field 1 in main window. showMsg2() - display string in text field 2 in main window. showMsg3() - display string in text field 3 in main window. logDRYROTerr() - notify MAExplorer of a fatal dryrot message popupAlertMsgLine() - popup alert message window. popupAlertMsg() - popup alert message in a scrollable text area. popupDryrotMsgsAndQuit() - test if fatal dryrot messages, do Dryrot exit displayURL() - popup web browser on current URL. popupViewer() - popup web browser on current URL. displayPDF() - popup adobe Acrobat for PDF file. checkImagesDirExists() - return true if images directory exists. createMontageTableOfCurGene() - create montage table of current gene. cvtBackslash2Fwdslash() - convert '\\' to '/' in the string addQuotesIfSpace() - add "..." around string if it contains a space cvf2s() - convert float to string with precision # of digits cvd2s() - convert double to string with precision # of digits cvs2d() - convert String to double cvs2f() - convert String to float cvs2d() - convert String to double cvs2f() - convert String to float cvs2i() - convert String to int cvs2iArray() - convert String arg list "1,4,3,6,..." to int[] cvs2Array() - convert String arg list "1,4,3,6,..." to String[] cvtValueToStars() - cvt val in[0:valMax] to "****"+" " string getRatioStr() - get "F1/F2", "Cy3/Cy5" or "Cy5/Cy3", etc. string. createMontageTableOfGene() - create montage sample table of gene data sleepMsec() - sleep nMsec where nMsec must be >= 0 milliseconds. rmvRtnChars() - return String with '\r' characters remove and map \r\n to \n. cvtSpacesToUnderscores() - replace spaces and other illegal file name chars copyFile() - binary copy of one file or URL toa local file deleteLocalFile() - delete local file. cvtEnvPaths2Properties() - get all system ENV variables as separate Java properties getListOfMenuStubNames() - get list of menu stub names
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. This notice must be included with the code. The MAExplorer Mozilla and Legal files are available on http://maexplorer.sourceforge.net/.
Method Summary | |
boolean |
checkImagesDirExists()
checkImagesDirExists() - return true if images directory exists.< |
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 SimpleTable |
createMontageTableOfCurGene(boolean addImgPath)
createMontageTableOfCurGene() - create montage table of current gene. |
static SimpleTable |
createMontageTableOfGene(int gid,
boolean addFullImagePathFlag)
createMontageTableOfGene() - create montage table of gene data across the HP-E sample conditions. |
java.lang.String |
cvd2s(double v,
int precision)
cvd2s() - convert double to string with precision # of digits |
java.lang.String |
cvf2s(float v,
int precision)
cvf2s() - convert float to string with precision # of digits |
static java.lang.String |
cvFileNameWithMod(java.lang.String fileName,
java.lang.String mod)
cvFileNameWithMod() - insert modifier string before file extension |
java.lang.String[] |
cvs2Array(java.lang.String str,
int maxExpected,
java.lang.String delimChr)
cvs2Array() - convert String arg list "1,4,3,6,..." to String[] If there are more than maxExpected number of args in string, ignore them and just return what has been parsed so far. |
double |
cvs2d(java.lang.String str)
cvs2d() - convert String to double |
double |
cvs2d(java.lang.String str,
double defaultValue)
cvs2d() - convert String to double |
float |
cvs2f(java.lang.String str)
cvs2f() - convert String to float |
float |
cvs2f(java.lang.String str,
float defaultValue)
cvs2f() - convert String to float |
int |
cvs2i(java.lang.String str)
cvs2i() - convert String to int |
int |
cvs2i(java.lang.String str,
int defaultValue)
cvs2i() - convert String to int |
int[] |
cvs2iArray(java.lang.String str,
int maxExpected,
java.lang.String delimChr)
cvs2iArray() - convert String arg list "1,4,3,6,..." to int[] If there are more than maxExpected number of args in string, ignore them and just return what has been parsed so far. |
java.lang.String |
cvtBackslash2Fwdslash(java.lang.String sInput)
cvtBackslash2Fwdslash() - convert '\\' to '/' in the string |
static boolean |
cvtEnvPaths2Properties()
cvtEnvPaths2Properties() - get all system ENV variables and set them as separate Java properties so we can get them individually from System.getProperty(var) calls. |
java.lang.String |
cvtSpacesToUnderscores(java.lang.String str)
cvtSpacesToUnderscores() - replace spaces and other illegal file name characters with '_' chars to make file names highly portable. |
java.lang.String |
cvtValueToStars(float val,
float valMax,
int maxStars,
boolean rightFillFlag)
cvtValueToStars() - cvt val in[0:valMax] to "****"+" " string where the maximum # of stars for v==vMax is specified. |
boolean |
deleteLocalFile(java.lang.String fileName)
deleteLocalFile() - delete local file. |
void |
displayPDF(java.lang.String pdfFile)
displayPDF() - popup Adobe Acrobat for PDF file. |
void |
displayURL(java.lang.String urlStr)
displayURL() - popup web browser on current URL. |
int |
et_defaultInt()
get_defaultInt() - default int value for conversions |
float |
get_defaultFloat()
get_defaultFloat() - default float value for conversions |
static java.lang.String[] |
getListOfMenuStubNames()
getListOfMenuStubNames() - get list of menu stub names |
java.lang.String |
getRatioStr()
getRatioStr() - get "F1/F2", "Cy3/Cy5" or "Cy5/Cy3", etc. |
void |
logDRYROTerr(java.lang.String value)
logDRYROTerr() - notify MAExplorer of a fatal dryrot message |
void |
maeRepaint()
maeRepaint() - repaint MAExplorer main window. |
void |
popupAlertMsg(java.lang.String title,
java.lang.String msg,
int nRows,
int nCols)
popupAlertMsg() - popup alert message in a scrollable text area. |
void |
popupAlertMsgLine(java.lang.String msg)
popupAlertMsgLine() - popup alert message line window. |
void |
popupDryrotMsgsAAndQuit()
popupDryrotMsgsAndQuit() - test if fatal dryrot messages, then generate Dryrot exit sequence. |
void |
popupViewer(java.net.URL urlBase,
java.lang.String fileIn,
java.lang.String windowName)
popupViewer() - popup web browser on current URL. |
java.lang.String |
rmvRtnChars(java.lang.String str)
rmvRtnChars() - remove return chars. |
void |
saveCmdHistory(java.lang.String msg)
saveCmdHistory() - print msg to showMsg1() and also save in command history and message logs if logging is enabled. |
static void |
saveCmdHistory(java.lang.String msg,
boolean doShowMsgFlag)
saveCmdHistory() - save msg in command history and message logs if logging is enabled. |
void |
saveMsgHistory(java.lang.String msg,
boolean flag)
saveMsgHistory() - save msg in message logs if logging is enabled. |
void |
showMsg(java.lang.String str)
showMsg() - display string in text field 1 in main window. |
void |
showMsg1(java.lang.String str)
showMsg1() - display string in text field 1 in main window. |
void |
showMsg1(java.lang.String str,
java.awt.Color foregrdColor,
java.awt.Color bkgrdColor)
showMsg1() - display string in text field 1 in main window. |
void |
showMsg2(java.lang.String str)
showMsg2() - display string in text field 2 in main window. |
void |
showMsg2(java.lang.String str,
java.awt.Color foregrdColor,
java.awt.Color bkgrdColor)
showMsg2() - display string in text field 2 in main window. |
void |
showMsg3(java.lang.String str)
showMsg3() - display string in text field 3 in main window. |
void |
showMsg3(java.lang.String str,
java.awt.Color foregrdColor,
java.awt.Color bkgrdColor)
showMsg3() - display string in text field 3 in main window. |
void |
sleepMsec(int sleepMsec)
sleepMsec() - sleep nMsec where nMsec must be >= 0 milliseconds. |
Methods inherited from class MJAbase |
cvtHashtable2SimpleTable, cvtTable2Hashtable |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public final int et_defaultInt()
public final float get_defaultFloat()
public final void maeRepaint()
public final void saveCmdHistory(java.lang.String msg)
msg
- string to displaypublic static final void saveCmdHistory(java.lang.String msg, boolean doShowMsgFlag)
msg
- is the command message to logdoShowMsgFlag
- if set is set, then print msg to showMsg1() as well.public final void saveMsgHistory(java.lang.String msg, boolean flag)
isVisibleFlag
- makes the message logging window visible.msg
- string to displaypublic final void showMsg(java.lang.String str)
str
- string to displaypublic final void showMsg1(java.lang.String str)
str
- string to displaypublic final void showMsg2(java.lang.String str)
str
- string to displaypublic final void showMsg3(java.lang.String str)
str
- string to displaypublic final void showMsg1(java.lang.String str, java.awt.Color foregrdColor, java.awt.Color bkgrdColor)
str
- string to displayforegrdColor
- foreground color if not null else blackbkgrdColor
- background color if not null else whitepublic final void showMsg2(java.lang.String str, java.awt.Color foregrdColor, java.awt.Color bkgrdColor)
str
- string to displayforegrdColor
- foreground color if not null else blackbkgrdColor
- background color if not null else whitepublic final void showMsg3(java.lang.String str, java.awt.Color foregrdColor, java.awt.Color bkgrdColor)
str
- string to displayforegrdColor
- foreground color if not null else blackbkgrdColor
- background color if not null else whitepublic final void logDRYROTerr(java.lang.String value)
errMsg
- error message for dryrotpublic final void popupAlertMsgLine(java.lang.String msg)
msg
- message to put into popuppublic void popupAlertMsg(java.lang.String title, java.lang.String msg, int nRows, int nCols)
title
- is the optional title for the popup windowmsg
- is the message for the popup windownRows
- is the # of rows for the popup window, 20 if specify 0nCols
- is the # of columns for the popup window, 80 if specify 0ShowStringPopup
,
ShowStringPopup#updateText
,
sleepMsec(int)
public java.lang.String rmvRtnChars(java.lang.String str)
String
- str to processpublic final void popupDryrotMsgsAAndQuit()
public final void displayURL(java.lang.String urlStr)
urlStr
- to use when popup a Web brower.public final void popupViewer(java.net.URL urlBase, java.lang.String fileIn, java.lang.String windowName)
urlBase
- is the base URLfileIn
- is the file to displaywindowName
- is the window to use if not nullpublic final void displayPDF(java.lang.String pdfFile)
pdfFile
- pdf file namepublic final boolean checkImagesDirExists()
public static final SimpleTable createMontageTableOfCurGene(boolean addImgPath)
Verify that the data exists before process: 1) has gene to make montage on 2) make sure have .quant (X,Y) data 3) has Database_ID data corresponding to xxxx in images 4) has maeDir/Images/xxxx.jpg.
addFullImagePathFlag
- causes the full image path to be generated
in the table.public final java.lang.String cvtBackslash2Fwdslash(java.lang.String sInput)
sInput
- is input stringreturn
- converted stringpublic final java.lang.String cvf2s(float v, int precision)
v
- is value to cvt.
If abs(v) < pow(10.0,-p) then return "+0" or "-0"precision
- of conversion.
If precision > 0 then limit # of digits in fractionpublic final java.lang.String cvd2s(double v, int precision)
v
- is value to cvt.
If abs(v) < pow(10.0,-p) then return "+0" or "-0"precision
- of conversion.
If precision > 0 then limit # of digits in fractionpublic final double cvs2d(java.lang.String str)
str
- numeric string to convertpublic final double cvs2d(java.lang.String str, double defaultValue)
str
- numeric string to convertdefaultValue
- is value to use if bad numeric stringpublic final float cvs2f(java.lang.String str)
str
- numeric string to convertpublic final float cvs2f(java.lang.String str, float defaultValue)
str
- numeric string to convertdefaultValue
- is value to use if bad numeric stringpublic final int cvs2i(java.lang.String str)
str
- numeric string to convertpublic final int cvs2i(java.lang.String str, int defaultValue)
str
- numeric string to convertdefaultValue
- is value to use if bad numeric stringpublic final int[] cvs2iArray(java.lang.String str, int maxExpected, java.lang.String delimChr)
str
- string containt a list of integersmaxExpected
- # of numbers to be parseddelimChr
- delimiter to be usedpublic final java.lang.String[] cvs2Array(java.lang.String str, int maxExpected, java.lang.String delimChr)
str
- string containt a list of StringsmaxExpected
- # of numbers to be parseddelimChr
- delimiter to be usedpublic final java.lang.String cvtValueToStars(float val, float valMax, int maxStars, boolean rightFillFlag)
val
- is value to be converted to startsvalMax
- is maximum value expectedmaxStars
- is max # of stars to use for largest valuerightFillFlag
- if true will right fill the string with spacespublic final java.lang.String getRatioStr()
public static final SimpleTable createMontageTableOfGene(int gid, boolean addFullImagePathFlag)
Verify that the data exists before process: 1) has gene to make montage on 2) make sure have .quant (X,Y) data 3) has Database_ID data corresponding to xxxx in images 4) has maeDir/Images/xxxx.jpg. Table fields include: "Sample#", "X", "Y", "SampleName", "ImagePath", "DatabaseID", "HP-set", "ratioData", "intensData1", "intensData2", "ClassName", "f1Lbl", "f2Lbl", "database", "dbSubset", "GeneName", "MasterID", "dataType"
gid
- Grid Index (GID). If -1, use the current Gene if defined.addFullImagePathFlag
- is set then output full path of image files.public final void sleepMsec(int sleepMsec)
sleepMsec
- is the number of milliseconds to sleeppublic final java.lang.String cvtSpacesToUnderscores(java.lang.String str)
: space ( ) ; " { } < > = , ? \ / % * ! @ & | ' ` \t
str
- to convertpublic final 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 final boolean deleteLocalFile(java.lang.String fileName)
fileName
- to be deleted on the local file system.public static final boolean cvtEnvPaths2Properties()
public static final java.lang.String cvFileNameWithMod(java.lang.String fileName, java.lang.String mod)
fileName
- (with file extension)mod
- to insert before file extensionpublic static final java.lang.String[] getListOfMenuStubNames()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |