|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--java.awt.Window | +--java.awt.Frame | +--RtestBase | +--Rtest
Class Rtest - evaluate R scripts with data supplied from MAExplorer via the MJA API. Each R analysis is defined by a R LayOut (RLO). Each RLO is saved in an internal RLO database managed by the mjaReval MJA class. These specify the evaluation environment for the .R script when evaluated by R. The R program is then run as a separate process using a System.exec()
When executed, an R script is allowed to generate multiple output files that may include the following format templateValues: text, tab-delimited text, PDF, JPG, etc. There may be also multiple data input files requested by the R script. These are generated by mjaReval class methods as specified by the RLO database entry. Note: during R execution, all files are read and written from the {project}/Temp directory, the R current working directory. They may be copied to or from this directory from or to other directories as required.
This example is under construction, but can serve as a model of some the Open Java API interface and writing a simple MAEPlugin.
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/.
Reval
,
MJAReval
, Serialized FormInner classes inherited from class java.awt.Frame |
java.awt.Frame.AccessibleAWTFrame |
Inner classes inherited from class java.awt.Window |
java.awt.Window.AccessibleAWTWindow |
Inner classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.AWTTreeLock |
Field Summary | |
(package private) MaeJavaAPI |
mja
|
(package private) MJAproperty |
mjaProperty
|
(package private) MJAreport |
mjaReport
|
(package private) MJAReval |
mjaReval
instance of Reval |
(package private) MJAutil |
mjaUtil
|
(package private) MJAReval |
mr
|
Fields inherited from class java.awt.Frame |
base, CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, frameSerializedDataVersion, HAND_CURSOR, icon, ICONIFIED, mbManagement, menuBar, MOVE_CURSOR, N_RESIZE_CURSOR, nameCounter, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, ownedWindows, resizable, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, serialVersionUID, state, SW_RESIZE_CURSOR, TEXT_CURSOR, title, W_RESIZE_CURSOR, WAIT_CURSOR, weakThis |
Fields inherited from class java.awt.Window |
active, dbg, focusMgr, inputContext, inputContextLock, OPENED, ownedWindowList, showWithParent, warningString, windowListener, windowSerializedDataVersion |
Fields inherited from class java.awt.Container |
component, containerListener, containerSerializedDataVersion, dispatcher, layoutMgr, listeningBoundsChildren, listeningChildren, maxSize, ncomponents, printing, printingThreads |
Fields inherited from class java.awt.Component |
accessibleContext, actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, changeSupport, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, graphicsConfig, hasFocus, height, hierarchyBoundsListener, hierarchyBoundsListenerK, hierarchyListener, hierarchyListenerK, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, metrics, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, privateKey, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowClosingException, windowListenerK, x, y |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
Rtest(MaeJavaAPI mja)
Rtest() - Constructor |
Method Summary | |
(package private) 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. : space( ) ; " { } < > = , ? \ / % * ! @ & | ' ` \t |
(package private) void |
displayPDF(java.lang.String pdfFile)
displayPDF() - Display PDF file in adobe, for use in stand-alone. |
(package private) void |
displayURL(java.lang.String urlStr)
displayURL() - Display URL file in system Web browser, for use in stand-alone mode. |
(package private) java.lang.String[] |
getListOfMenuStubNames()
getListOfMenuStubNames() - get list of menu stub names |
(package private) void |
popupAlertMsg(java.lang.String title,
java.lang.String msg,
int nRows,
int nCols)
popupAlertMsg() - popup alert message in a scrollable text area. |
(package private) java.lang.String |
readTextFromFile(java.lang.String fileName,
java.lang.String loadingMsg)
readTextFromFile() - read text from text file. |
(package private) java.lang.String |
rmvRtnChars(java.lang.String str)
rmvRtnChars() - remove return chars. |
(package private) void |
showMsg(java.lang.String msg)
showMsg() - display message in client GUI |
(package private) boolean |
writeTextToFile(java.lang.String textFileName,
java.lang.String textReport)
writeTextToFile() - save text string as text file. |
Methods inherited from class java.awt.Frame |
|
Methods inherited from class java.awt.Window |
addOwnedWindow, addWindowListener, adjustListeningChildren, applyResourceBundle, applyResourceBundle, connectOwnedWindow, dispatchEventImpl, dispose, eventEnabled, getFocusOwner, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, hide, isActive, isShowing, nextFocus, ownedInit, pack, postEvent, postWindowEvent, preProcessKeyEvent, processEvent, processWindowEvent, removeOwnedWindow, removeWindowListener, resetGC, setCursor, setFocusOwner, setWarningString, show, toBack, toFront, transferFocus |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, applyOrientation, checkGD, countComponents, createChildHierarchyEvents, createHierarchyEvents, deliverEvent, dispatchEventToSelf, doLayout, findComponentAt, findComponentAt, findComponentAt, getAccessibleAt, getAccessibleChild, getAccessibleChildrenCount, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getMouseEventTarget, getWindow, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPaint, lightweightPrint, list, list, locate, minimumSize, numListening, paintComponents, paintHeavyweightComponents, postsOldMouseEvents, preferredSize, print, printComponents, printHeavyweightComponents, processContainerEvent, proxyEnableEvents, proxyRequestFocus, remove, remove, removeAll, removeContainerListener, setFont, setLayout, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkImage, checkImage, checkWindowClosingException, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAccessibleIndexInParent, getAccessibleStateSet, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen_NoTreeLock, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getSize, getToolkitImpl, getTreeLock, getWidth, getWindowForObject, getX, getY, gotFocus, hasFocus, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isRecursivelyVisible, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait |
Methods inherited from interface java.awt.MenuContainer |
getFont, postEvent |
Field Detail |
MaeJavaAPI mja
MJAproperty mjaProperty
MJAreport mjaReport
MJAutil mjaUtil
MJAReval mjaReval
MJAReval mr
Constructor Detail |
public Rtest(MaeJavaAPI mja)
MJAproperty.getMaeCurProjectPath()
,
MJAproperty.getMaeBrowserTitle()
,
MJAproperty.getMaeDatabaseTitle()
,
MJAproperty.getMaeDbSubsetTitle()
,
RtestBase.initializeDataAndGUI()
,
RtestBase.showData(java.lang.String, java.awt.Color, java.awt.Color)
,
RtestBase.showGuiMsg(java.lang.String, java.awt.Color, java.awt.Color)
Method Detail |
void showMsg(java.lang.String msg)
msg
- message to displayjava.lang.String readTextFromFile(java.lang.String fileName, java.lang.String loadingMsg)
readTextFromFile
in class RtestBase
fileName
- full path name of text fileloadingMsg
- to display while loading, null if no messageboolean writeTextToFile(java.lang.String textFileName, java.lang.String textReport)
writeTextToFile
in class RtestBase
textFileName
- full path name of text filetextReport
- text to save in filevoid popupAlertMsg(java.lang.String title, java.lang.String msg, int nRows, int nCols)
popupAlertMsg
in class RtestBase
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 0void displayURL(java.lang.String urlStr)
Examples: displayURL("http://www.javaworld.com") displayURL("file://c:\\docs\\index.html") displayURL("file:///user/joe/index.html"); displayURL("file:///user/joe/image.xml"); displayURL("file:///user/joe/iimage.svg");Under Unix, the system browser is hard-coded to be 'netscape'. Netscape must be in your PATH for this to work.
displayURL
in class RtestBase
url
- to display in popup browservoid displayPDF(java.lang.String pdfFile)
displayPDF
in class RtestBase
pdfFile
- file to display in Adobe Acrobatjava.lang.String cvtSpacesToUnderscores(java.lang.String str)
cvtSpacesToUnderscores
in class RtestBase
str
- to be convertedjava.lang.String rmvRtnChars(java.lang.String str)
rmvRtnChars
in class RtestBase
String
- str to processjava.lang.String[] getListOfMenuStubNames()
getListOfMenuStubNames
in class RtestBase
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |