org.rosuda.JGR
Class JGR

java.lang.Object
  extended by org.rosuda.JGR.JGR

public class JGR
extends java.lang.Object

JGR, Java Gui for R JGR is just a new Gui for R http://www.r-project.org , written in Java.
Thus it is (should) be platform-indepent. Currently we have several problems on *nix machines.

JGR uses JRI and rJava for talking with R, and the JavaGD- Device all written by Simon Urbanek.

RoSuDa 2003 - 2005

Author:
Markus Helbig

Field Summary
static java.lang.String[] arguments
          arguments from command line
static java.lang.String AUTHOR1
          Author JGR (used for displaying the splashscreen)
static java.lang.String AUTHOR2
          Author JRI, rJava and JavaGD (used for displaying the splashscreen)
static java.lang.String AUTHOR3
          Author JGR parts since 2009
static java.util.Vector DATA
          Current data-sets (data.frames, matrix, ...)
static java.lang.String DEVELTIME
          Develtime (used for displaying the splashscreen)
static java.util.Vector FUNCTIONS
          Current functions
static java.lang.String INSTITUTION
          Organization (used for displaying the splashscreen)
static java.util.Vector KEYWORDS
          Keywords for syntaxhighlighting
static java.util.Vector KEYWORDS_OBJECTS
          Keywords (objects) for syntaxhighlighting
static JGRConsole MAINRCONSOLE
          Main-console window
static java.util.Vector MODELS
          Current models
static java.util.Vector OBJECTS
          Current objects in workspace
static java.util.Vector OTHERS
          Current data not in DATA DATA
static java.util.Vector RHISTORY
          The history of current session.
static java.lang.String RHOME
          RHOME path of current used R
static ConsoleSync rSync
          ConsoleSnyc org.rosuda.JRG.toolkit.ConsoleSync
static SplashScreen splash
          Splashscreen
static java.lang.String SPLASH
          Filename of the splash-image (used for displaying the splashscreen)
static boolean STARTED
          Indicates wether the Rengine is up or not
static java.lang.String SUBTITLE
          Subtitle (used for displaying the splashscreen)
static java.lang.String TITLE
          Title (used for displaying the splashscreen)
static java.lang.String VERSION
          Version number of JGR
static java.lang.String WEBSITE
          Website of organization (used for displaying the splashscreen)
 
Constructor Summary
JGR()
          Starting the JGR Application (javaside)
 
Method Summary
static void addMenu(java.lang.String name)
          Add new Menu at runtime to Console.
static void addMenuItem(java.lang.String menu, java.lang.String name, java.lang.String cmd)
          Add MenuItem at runtime to ConsoleMenu.
static void addMenuItem(java.lang.String menu, java.lang.String name, java.lang.String cmd, boolean silent)
          Add MenuItem at runtime to ConsoleMenu.
static void addMenuSeparator(java.lang.String menu)
          Add MenuSeparator at runtime.
static void addSubMenu(java.lang.String menuName, java.lang.String subMenuName, java.lang.String[] labels, java.lang.String[] cmds)
           
static REXP eval(java.lang.String cmd)
           
static java.lang.String exit()
          Exits JGR, but not before asked the user if he wants to save his workspace.
static java.lang.String[] getMenuItemNames(java.lang.String menuName)
           
static java.lang.String[] getMenuNames()
           
static REngine getREngine()
           
static REXP idleEval(java.lang.String cmd)
           
static void insertMenu(java.lang.String name, int pos)
          Insert new Menu at runtime to Console.
static void insertMenuItem(java.lang.String menu, java.lang.String name, java.lang.String cmd, boolean silent, int pos)
          Insert a MenuItem at runtime to ConsoleMenu.
static void insertMenuItem(java.lang.String menu, java.lang.String name, java.lang.String cmd, int pos)
          Add MenuItem at runtime to ConsoleMenu.
static void insertMenuSeparator(java.lang.String menu, int pos)
          insert MenuSeparator at runtime.
static void insertSubMenu(java.lang.String menuName, java.lang.String subMenuName, int pos, java.lang.String[] labels, java.lang.String[] cmds)
           
static boolean isJGRmain()
          return the value of the JGRmain flag
static void main(java.lang.String[] args)
          Starts JGR
options:
--debug: enable debug information or any other option supported by R.
static void readHistory()
          If there is a file named .Rhistory in the user's home path we load his commands to current history.
static void refreshObjects()
           
static void removeMenu(int pos)
          Remove a menu
static void removeMenu(java.lang.String name)
          Remove a menu
static void removeMenuItem(java.lang.String menuName, int pos)
          remove a menu item
static void removeMenuItem(java.lang.String menuName, java.lang.String itemName)
          remove a menu item
static void setKeyWords(java.lang.String word)
          Set keywords for highlighting.
static void setKeyWords(java.lang.String[] words)
          Set keywords for highlighting.
static void setObjects(java.lang.String object)
          Set objects for hightlighting.
static void setObjects(java.lang.String[] objects)
          Set objects for hightlighting.
static void setREngine(REngine e)
           
static void setRHome(java.lang.String rhome)
          Set R_HOME (in java app).
static void threadedEval(java.lang.String cmd)
           
static void timedAssign(java.lang.String symbol, REXP value)
           
static void timedAssign(java.lang.String symbol, REXP value, boolean ask)
           
static void timedAssign(java.lang.String symbol, REXP value, int interval, boolean ask)
           
static REXP timedEval(java.lang.String cmd)
           
static REXP timedEval(java.lang.String cmd, boolean ask)
           
static REXP timedEval(java.lang.String cmd, int interval, boolean ask)
           
static void writeHistory()
          Write the commands of current session to .Rhistory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

public static final java.lang.String VERSION
Version number of JGR

See Also:
Constant Field Values

TITLE

public static final java.lang.String TITLE
Title (used for displaying the splashscreen)

See Also:
Constant Field Values

SUBTITLE

public static final java.lang.String SUBTITLE
Subtitle (used for displaying the splashscreen)

See Also:
Constant Field Values

DEVELTIME

public static final java.lang.String DEVELTIME
Develtime (used for displaying the splashscreen)

See Also:
Constant Field Values

INSTITUTION

public static final java.lang.String INSTITUTION
Organization (used for displaying the splashscreen)

See Also:
Constant Field Values

AUTHOR1

public static final java.lang.String AUTHOR1
Author JGR (used for displaying the splashscreen)

See Also:
Constant Field Values

AUTHOR2

public static final java.lang.String AUTHOR2
Author JRI, rJava and JavaGD (used for displaying the splashscreen)

See Also:
Constant Field Values

AUTHOR3

public static final java.lang.String AUTHOR3
Author JGR parts since 2009

See Also:
Constant Field Values

WEBSITE

public static final java.lang.String WEBSITE
Website of organization (used for displaying the splashscreen)

See Also:
Constant Field Values

SPLASH

public static final java.lang.String SPLASH
Filename of the splash-image (used for displaying the splashscreen)

See Also:
Constant Field Values

MAINRCONSOLE

public static JGRConsole MAINRCONSOLE
Main-console window


RHISTORY

public static java.util.Vector RHISTORY
The history of current session. If there was a .Rhistory file, it will be loaded into this vector


RHOME

public static java.lang.String RHOME
RHOME path of current used R


rSync

public static ConsoleSync rSync
ConsoleSnyc org.rosuda.JRG.toolkit.ConsoleSync


DATA

public static java.util.Vector DATA
Current data-sets (data.frames, matrix, ...)


MODELS

public static java.util.Vector MODELS
Current models


OTHERS

public static java.util.Vector OTHERS
Current data not in DATA DATA


FUNCTIONS

public static java.util.Vector FUNCTIONS
Current functions


OBJECTS

public static java.util.Vector OBJECTS
Current objects in workspace


KEYWORDS

public static java.util.Vector KEYWORDS
Keywords for syntaxhighlighting


KEYWORDS_OBJECTS

public static java.util.Vector KEYWORDS_OBJECTS
Keywords (objects) for syntaxhighlighting


STARTED

public static boolean STARTED
Indicates wether the Rengine is up or not


splash

public static SplashScreen splash
Splashscreen


arguments

public static java.lang.String[] arguments
arguments from command line

Constructor Detail

JGR

public JGR()
Starting the JGR Application (javaside)

Method Detail

idleEval

public static REXP idleEval(java.lang.String cmd)
                     throws REngineException,
                            REXPMismatchException
Throws:
REngineException
REXPMismatchException

eval

public static REXP eval(java.lang.String cmd)
                 throws REngineException,
                        REXPMismatchException
Throws:
REngineException
REXPMismatchException

threadedEval

public static void threadedEval(java.lang.String cmd)

timedEval

public static REXP timedEval(java.lang.String cmd)

timedEval

public static REXP timedEval(java.lang.String cmd,
                             boolean ask)

timedEval

public static REXP timedEval(java.lang.String cmd,
                             int interval,
                             boolean ask)

timedAssign

public static void timedAssign(java.lang.String symbol,
                               REXP value)

timedAssign

public static void timedAssign(java.lang.String symbol,
                               REXP value,
                               boolean ask)

timedAssign

public static void timedAssign(java.lang.String symbol,
                               REXP value,
                               int interval,
                               boolean ask)

getREngine

public static REngine getREngine()

setREngine

public static void setREngine(REngine e)

exit

public static java.lang.String exit()
Exits JGR, but not before asked the user if he wants to save his workspace.

Returns:
users's answer (yes/no/cancel)

addMenu

public static void addMenu(java.lang.String name)
Add new Menu at runtime to Console.

Parameters:
name - MenuName

insertMenu

public static void insertMenu(java.lang.String name,
                              int pos)
Insert new Menu at runtime to Console.

Parameters:
name - MenuName
pos - position at which to insert

addMenuItem

public static void addMenuItem(java.lang.String menu,
                               java.lang.String name,
                               java.lang.String cmd,
                               boolean silent)
Add MenuItem at runtime to ConsoleMenu.

Parameters:
menu - MenuName
name - ItemName
cmd - Command
silent - Don't display command

addMenuItem

public static void addMenuItem(java.lang.String menu,
                               java.lang.String name,
                               java.lang.String cmd)
Add MenuItem at runtime to ConsoleMenu.

Parameters:
menu - MenuName
name - ItemName
cmd - Command

addMenuSeparator

public static void addMenuSeparator(java.lang.String menu)
Add MenuSeparator at runtime.

Parameters:
menu - MenuName

insertMenuSeparator

public static void insertMenuSeparator(java.lang.String menu,
                                       int pos)
insert MenuSeparator at runtime.

Parameters:
menu - MenuName
pos - index

insertMenuItem

public static void insertMenuItem(java.lang.String menu,
                                  java.lang.String name,
                                  java.lang.String cmd,
                                  boolean silent,
                                  int pos)
Insert a MenuItem at runtime to ConsoleMenu.

Parameters:
menu - MenuName
name - ItemName
cmd - Command
silent - Don't display command
pos - position

insertMenuItem

public static void insertMenuItem(java.lang.String menu,
                                  java.lang.String name,
                                  java.lang.String cmd,
                                  int pos)
Add MenuItem at runtime to ConsoleMenu.

Parameters:
menu - MenuName
name - ItemName
cmd - Command

getMenuNames

public static java.lang.String[] getMenuNames()
Returns:
the names of the menus

getMenuItemNames

public static java.lang.String[] getMenuItemNames(java.lang.String menuName)
Parameters:
menuName - menu
Returns:
the names of the items

removeMenu

public static void removeMenu(int pos)
Remove a menu

Parameters:
pos - index

removeMenu

public static void removeMenu(java.lang.String name)
Remove a menu

Parameters:
name - menu to remove

removeMenuItem

public static void removeMenuItem(java.lang.String menuName,
                                  int pos)
remove a menu item

Parameters:
menuName - name of menu
pos - index of item

removeMenuItem

public static void removeMenuItem(java.lang.String menuName,
                                  java.lang.String itemName)
remove a menu item

Parameters:
menuName - name of menu
itemName - name of item

insertSubMenu

public static void insertSubMenu(java.lang.String menuName,
                                 java.lang.String subMenuName,
                                 int pos,
                                 java.lang.String[] labels,
                                 java.lang.String[] cmds)

addSubMenu

public static void addSubMenu(java.lang.String menuName,
                              java.lang.String subMenuName,
                              java.lang.String[] labels,
                              java.lang.String[] cmds)

setRHome

public static void setRHome(java.lang.String rhome)
Set R_HOME (in java app).

Parameters:
rhome - RHOME path

setKeyWords

public static void setKeyWords(java.lang.String word)
Set keywords for highlighting.

Parameters:
word - This word will be highlighted

setKeyWords

public static void setKeyWords(java.lang.String[] words)
Set keywords for highlighting.

Parameters:
words - These words will be highlighted

setObjects

public static void setObjects(java.lang.String object)
Set objects for hightlighting.

Parameters:
object - This object will be highlighted

setObjects

public static void setObjects(java.lang.String[] objects)
Set objects for hightlighting.

Parameters:
objects - These words will be highlighted

readHistory

public static void readHistory()
If there is a file named .Rhistory in the user's home path we load his commands to current history.


writeHistory

public static void writeHistory()
Write the commands of current session to .Rhistory.


isJGRmain

public static boolean isJGRmain()
return the value of the JGRmain flag


main

public static void main(java.lang.String[] args)
Starts JGR
options:
  1. --debug: enable debug information
or any other option supported by R.


refreshObjects

public static void refreshObjects()