|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container java.awt.Window java.awt.Frame javax.swing.JFrame org.rosuda.ibase.toolkit.TJFrame org.rosuda.JGR.JGRConsole
public class JGRConsole
JGRConsole Console Frame, the main window of JGR.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JFrame |
---|
javax.swing.JFrame.AccessibleJFrame |
Nested classes/interfaces inherited from class java.awt.Frame |
---|
java.awt.Frame.AccessibleAWTFrame |
Nested classes/interfaces inherited from class java.awt.Window |
---|
java.awt.Window.AccessibleAWTWindow |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
int |
currentHistPosition
|
int |
end
Position where the R splash ends (need for clearing the console |
static java.lang.String |
guiEnv
|
SyntaxInput |
input
Console command input area |
javax.swing.text.Document |
inputDoc
|
static java.lang.String |
lastRPrompt
|
static int |
MENUMODIFIER
|
ConsoleOutput |
output
Console output text panel |
javax.swing.text.Document |
outputDoc
|
Fields inherited from class javax.swing.JFrame |
---|
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled |
Fields inherited from class java.awt.Frame |
---|
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface org.rosuda.ibase.toolkit.FrameDevice |
---|
clsAbout, clsBar, clsBox, clsCustom, clsDevPlot, clsEditor, clsFD, clsHelp, clsHist, clsJavaGD, clsLine, clsMain, clsMap, clsMCP, clsObjBrowser, clsPackageUtil, clsPCP, clsPlot, clsPrefs, clsScatter, clsSplash, clsTable, clsTree, clsTreeMap, clsUser, clsVars |
Fields inherited from interface javax.swing.WindowConstants |
---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
JGRConsole()
|
|
JGRConsole(java.io.File workSpace)
Create a new Console window. |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
actionPerformed: handle action event: menus. |
void |
clearconsole()
Clear the console's content, if it's too full. |
void |
dispose()
Close Console, but not before we asked the user if he wants to save opened Editors. |
void |
execute(java.lang.String cmd)
Execute a coomand and add it to history |
void |
execute(java.lang.String cmd,
boolean addToHist)
Execute a command and add it into history. |
void |
exit()
Close Console, but not before we asked the user if he wants to save opened Editors. |
void |
focusGained(java.awt.event.FocusEvent e)
focusGained: handle focus event, enable and disable cut and paste button. |
void |
focusLost(java.awt.event.FocusEvent e)
focusLost: handle focus event. |
int |
getFontWidth()
Get the font's width form current settings using FontMetrics . |
java.io.PrintStream |
getStdErrPrintStream()
|
java.io.PrintStream |
getStdOutPrintStream()
|
java.lang.String |
getUniqueName(java.lang.String var)
Gets a unique name based on a starting string |
java.lang.String |
getUniqueName(java.lang.String var,
java.lang.String envName)
Gets a unique name based on a starting string |
void |
keyPressed(java.awt.event.KeyEvent ke)
keyPressed: handle key event, like: adding a new line, history .... |
void |
keyReleased(java.awt.event.KeyEvent ke)
keyReleased: handle key event, sending the command. |
void |
keyTyped(java.awt.event.KeyEvent ke)
keyTyped: handle key event. |
void |
loadWorkSpace()
Load a workspace, R-command: load(...). |
void |
rBusy(Rengine re,
int which)
Invoke the busy cursor (R callback). |
java.lang.String |
rChooseFile(Rengine re,
int newFile)
Choose a file invoked be file.choose() (R callback). |
void |
rFlushConsole(Rengine re)
Flush the console (R callback). !! |
void |
rLoadHistory(Rengine re,
java.lang.String filename)
Load history from a file (R callback). |
java.lang.String |
rReadConsole(Rengine re,
java.lang.String prompt,
int addToHistory)
Read the commands from input area (R callback). |
void |
rSaveHistory(Rengine re,
java.lang.String filename)
Save history to a file (R callback). |
void |
rShowMessage(Rengine re,
java.lang.String message)
Showing a message from the rengine (R callback). |
void |
rWriteConsole(Rengine re,
java.lang.String text)
Write output from R into console (old R callback). |
void |
rWriteConsole(Rengine re,
java.lang.String text,
int oType)
Write output from R into console (new R callback). |
void |
saveWorkSpace(java.lang.String file)
Save workspace with specified filename, R-command: save.image(...). |
void |
saveWorkSpaceAs()
Save workspace to a different file then .RData. |
Methods inherited from class org.rosuda.ibase.toolkit.TJFrame |
---|
add, finalize, getFrame, initPlacement, setWorking |
Methods inherited from class javax.swing.JFrame |
---|
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update |
Methods inherited from class java.awt.Frame |
---|
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
Methods inherited from class java.awt.Window |
---|
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setVisible, show, toBack, toFront |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, 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, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.rosuda.ibase.toolkit.FrameDevice |
---|
addWindowListener, pack, setSize, setVisible |
Methods inherited from interface java.awt.MenuContainer |
---|
getFont, postEvent |
Field Detail |
---|
public ConsoleOutput output
public SyntaxInput input
public javax.swing.text.Document inputDoc
public javax.swing.text.Document outputDoc
public static final int MENUMODIFIER
public int currentHistPosition
public int end
public static java.lang.String guiEnv
public static java.lang.String lastRPrompt
Constructor Detail |
---|
public JGRConsole()
public JGRConsole(java.io.File workSpace)
workSpace
- workspace which should be loaded when starting JGRMethod Detail |
---|
public void exit()
public void dispose()
dispose
in class TJFrame
public void execute(java.lang.String cmd)
cmd
- command for executionpublic void execute(java.lang.String cmd, boolean addToHist)
cmd
- command for executionaddToHist
- indicates wether the command should be added to history or notpublic java.lang.String getUniqueName(java.lang.String var)
var
-
public java.lang.String getUniqueName(java.lang.String var, java.lang.String envName)
var
- envName
- The name of the enviroment in which to look
public void clearconsole()
public void loadWorkSpace()
public void saveWorkSpace(java.lang.String file)
file
- filenamepublic void saveWorkSpaceAs()
public int getFontWidth()
FontMetrics
.
public void rWriteConsole(Rengine re, java.lang.String text, int oType)
rWriteConsole
in interface RMainLoopCallbacks
re
- used Renginetext
- outputoType
- output type (0=regular, 1=warning/error)public void rWriteConsole(Rengine re, java.lang.String text)
re
- used Renginetext
- outputpublic void rBusy(Rengine re, int which)
rBusy
in interface RMainLoopCallbacks
re
- used Renginewhich
- busy (1) or not (0)public java.lang.String rReadConsole(Rengine re, java.lang.String prompt, int addToHistory)
rReadConsole
in interface RMainLoopCallbacks
re
- used Rengineprompt
- prompt from RaddToHistory
- is it an command which to add to the history
public void rShowMessage(Rengine re, java.lang.String message)
rShowMessage
in interface RMainLoopCallbacks
re
- used Renginemessage
- message from Rpublic java.lang.String rChooseFile(Rengine re, int newFile)
rChooseFile
in interface RMainLoopCallbacks
re
- used RenginenewFile
- if it's a new file
public void rFlushConsole(Rengine re)
rFlushConsole
in interface RMainLoopCallbacks
re
- used Renginepublic void rLoadHistory(Rengine re, java.lang.String filename)
rLoadHistory
in interface RMainLoopCallbacks
re
- used Renginefilename
- history filepublic void rSaveHistory(Rengine re, java.lang.String filename)
rSaveHistory
in interface RMainLoopCallbacks
re
- used Renginefilename
- history filepublic void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
public void keyTyped(java.awt.event.KeyEvent ke)
keyTyped
in interface java.awt.event.KeyListener
public void keyPressed(java.awt.event.KeyEvent ke)
keyPressed
in interface java.awt.event.KeyListener
public void keyReleased(java.awt.event.KeyEvent ke)
keyReleased
in interface java.awt.event.KeyListener
public void focusGained(java.awt.event.FocusEvent e)
focusGained
in interface java.awt.event.FocusListener
public void focusLost(java.awt.event.FocusEvent e)
focusLost
in interface java.awt.event.FocusListener
public java.io.PrintStream getStdOutPrintStream()
public java.io.PrintStream getStdErrPrintStream()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |