Class RGraphicsPlugin

java.lang.Object
  |
  +--netscape.plugin.Plugin
        |
        +--RNetscape
              |
              +--RGraphicsPlugin

public class RGraphicsPlugin
extends RNetscape

A LiveConnect plugin class for an S graphics device that is embeddable within an Netscape page and that allows JavaScript and other plugins to communicate with that device.


Fields inherited from class RNetscape
debug, DefaultDebug
 
Constructor Summary
RGraphicsPlugin()
          Default constructor.
 
Method Summary
 java.lang.Object eval(java.lang.String cmd)
          Intercepts the inherited eval() method to ensure that the associated device is active.
 int getActive()
          Get the number of the currently active R graphics device.
 int getDeviceNumber()
          Get the number of the graphics device associated with this plugin.
 void hist(double[] var)
          Create a histogram displaying the given numbers.
 void hist(double[] var, java.lang.String xlab)
           
 void hist(java.lang.String varName)
          Create a histogram of the specified variable found in the R global environment.
 void image()
          A call to the image() function.
 void init()
          Basic init() method.
 java.lang.Object par()
          This returns a JavaScript object containing the settings of all the graphics parameters for this device.
 java.lang.Object par(java.lang.String which)
          This returns the setting for the specified parameter for this device.
 void par(java.lang.String which, java.lang.Object value)
          Sets the specified element of the graphics parameter list for this device to the given value.
 void plot(double[] x)
          Plot the values of the array against the values 1, 2, 3, ..., x.length
 void plot(double[] x, double[] y)
          Create a scatterplot of the two arrays against each other.
 void plot(java.lang.Object x)
           
 void plot(java.lang.Object x, java.lang.Object y)
           
 void plot(java.lang.Object x, java.lang.String xlab)
           
 void plot(java.lang.String x)
          Plot a single variable in the R global environment, producing a scatterplot of the values 1:length(x) and x itself.
 void plot(java.lang.String x, java.lang.String y)
          Plot two variables in the R global environment.
 void setActive()
          Set the associated R graphics device to be the active one to which graphics commands will be sent and displayed.
 void setActiveDevice(int which)
          Change the currently active R graphics device to the one identified by the specified number.
 
Methods inherited from class RNetscape
call, call, call, call, call, call, call, call, call, call, call, call1ArgStringFunction, call1ArgStringFunction, convertArray, eval, evalPrint, exists, get, getDebug, getDummyJSObject, library, namedArgCall, namedArgCall, namedArgCall, remove, setDebug, source
 
Methods inherited from class netscape.plugin.Plugin
destroy, getPeer, getWindow, isActive
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RGraphicsPlugin

public RGraphicsPlugin()
Default constructor.
Method Detail

init

public void init()
Basic init() method.
Overrides:
init in class RNetscape

hist

public void hist(java.lang.String varName)
Create a histogram of the specified variable found in the R global environment.

hist

public void hist(double[] var)
Create a histogram displaying the given numbers.

hist

public void hist(double[] var,
                 java.lang.String xlab)

plot

public void plot(double[] x)
Plot the values of the array against the values 1, 2, 3, ..., x.length

plot

public void plot(java.lang.Object x)

plot

public void plot(java.lang.Object x,
                 java.lang.String xlab)

plot

public void plot(java.lang.Object x,
                 java.lang.Object y)

plot

public void plot(double[] x,
                 double[] y)
Create a scatterplot of the two arrays against each other.

plot

public void plot(java.lang.String x)
Plot a single variable in the R global environment, producing a scatterplot of the values 1:length(x) and x itself.

plot

public void plot(java.lang.String x,
                 java.lang.String y)
Plot two variables in the R global environment.

image

public void image()
A call to the image() function.

par

public java.lang.Object par()
This returns a JavaScript object containing the settings of all the graphics parameters for this device.
Returns:
a JavaScript object whose members are the elements returned by calling the S function par().

par

public java.lang.Object par(java.lang.String which)
This returns the setting for the specified parameter for this device. The valid values for {@code which which} are the names of the elements returned from a call to par().
Parameters:
which - the name of the field in the graphics parameters being queried.
Returns:
a JavaScript object containing the value of the setting.

par

public void par(java.lang.String which,
                java.lang.Object value)
Sets the specified element of the graphics parameter list for this device to the given value.

eval

public java.lang.Object eval(java.lang.String cmd)
Intercepts the inherited eval() method to ensure that the associated device is active.
Overrides:
eval in class RNetscape
Tags copied from class: RNetscape
Parameters:
cmd - the S expression to be evaluated.
Returns:
the result of evaluating the S expression, converted to the corresponding JavaScript type.

setActiveDevice

public void setActiveDevice(int which)
Change the currently active R graphics device to the one identified by the specified number. We currently add one to this before calling the low-level setDevice C routine.

getActive

public int getActive()
Get the number of the currently active R graphics device.

setActive

public void setActive()
Set the associated R graphics device to be the active one to which graphics commands will be sent and displayed.

getDeviceNumber

public int getDeviceNumber()
Get the number of the graphics device associated with this plugin.