gWidgetsrJava-package     package:gWidgetsrJava     R Documentation

_T_o_o_l_k_i_t _i_m_p_l_e_m_e_n_t_a_t_i_o_n _o_f _g_W_i_d_g_e_t_s _f_o_r _r_J_a_v_a

_D_e_s_c_r_i_p_t_i_o_n:

     Port of gWidgets API to rJava. The gWidgets API is an abstract,
     lightweight means to interact with GUI toolkits. In this case, the
     JAVA toolkit.

_D_e_t_a_i_l_s:

     This file documents differences between gWidgetsrJava and the
     gWidgets API. Currently, gWidgetsrJava only provides a no-frills
     version of gWidgets, as compared to gWidgetsRGtk2.

     Notes on this implementation:

     First, although the widgets can be constructed from the R
     commandline, they can only be given handlers (or a response to
     mouse events) if the package is run with the 'JGR' environment.
     This is a limitation of the 'rJava' package which provides the
     interface to the Java libraries from within R.  

     *Containers:*

     'gframe()' no markup in title 

     'glayout()' has two additional arguments: 'expand=TRUE' is like
     'expand=' for 'ggroup()', in that the attached widget expands to
     fill the possible space in the container. If this isn't given the
     anchor= argument can be used to adjust the location of the widget
     withing the cell. A value of c(-1,1) is the lower left, c(-1,1)
     the upper left (the default), c(1,-1) the lower right, and c(1,1)
     the upper right. The value 0 for either is also possible. 

     'ggroup()' also has the 'expand=' and 'anchor=' arguments. If
     'expand=TRUE' the widget takes up as much space as possible. The
     'anchor=' argument adjusts a widget left or right, up or down,
     within its space. Only one component works at a time for the
     anchor argument. In a horizontal box, only the y component can be
     used to move a value up or down. In a vertical box, only the x
     component can be used to move a value left or right. The default
     is c(-1,1) so that horizontal layouts are towards the top, and
     vertical layouts towards the left. 

     *Components:* 
      'gcalendar()' is mostly  implemented. It uses a calendar widget
     from <URL:
     http://java.sun.com/developer/JDCTechTips/2005/tt0601.html>, a now
     defunct project. The return value of 'svalue()' is a 'Date'
     object, not a character string, formatted by the 'format=' string. 

     'gcommandline()' is implemented, but could definitely be improved.
     The console in JGR is much better. 

     'gdf()' works, looks bad. It is _slow_ 

     'gdfnotebook()' needs to be changed to run. Not implemented 

     'gedit()', unlike the 'gWidgetsRGtk2' widget, has no type-ahead
     support via drop down boxes. 

     'ggraphics()' uses the one from 'JGR' (via 'JavaGD'). This means
     no graphics notebook and no embedding of graphics devices. 

     'ghelpbrowser()' just uses the one from 'JGR',  its methods are
     not implemented. 

     'gimage()' size argument is ignored. It seems that images get
     cached. If you try something like 'svalue(gimageInstance)<-file;'
     'update(file);' 'svalue(gimageInstance)<-file' then the updated
     file won't be loaded. 

     'gfile()' no filtering is implemented. 

     'gmenu()' adds only to the top window, not any container. This is
     a Java limitation. Use a popupmenu instead.  

     'gradio()' has an extra argument 'coerce.with=', as otherwise it
     would treat everything as a character vector. It tries to guess
     when instantiated, if not explicitly given. 

     'gslider()' in 'rJava' works with integer steps only. If the 'by='
     argument is less than 1 a 'gspinbutton()' is used in place. 

     *Handlers:* 

     There is no support for 'adddropsource()', 'adddroptarget()' and
     'adddropmotion()'. Drag and drop basically works as typical, you
     drag it and it adds where dropped.

_N_o_t_e:

     This package uses Java source code from several GPL projects:
     xnap-common, the Java tutorial, iWidgets, javadesktop.org.

_A_u_t_h_o_r(_s):

     John Verzani, although based on the 'iWidgets' package of Simon
     Urbanek, incorporating some GPL and LGPL software from the eclipse
     project, the javadesktop.org project, the scigraphics project and
     code from the Java Tutorial by SUN.

     Maintainer: John Verzani <gwidgetsrgtk@gmail.com>

_R_e_f_e_r_e_n_c_e_s:

     See JGR's website at <URL: www.rosuda.org>.

_S_e_e _A_l_s_o:

     The 'JGR' package: <URL: www.rosuda.org>

_E_x_a_m_p_l_e_s:

     ## Not run: 
     ##
     options(guiToolkit="rJava")
     ## select CRAN miror example
       win = gwindow("Select a CRAN mirror")
       size(win) = c(600,400)
       tbl = gtable(utils:::getCRANmirrors(), 
       container=win,
       chosencol=4, 
       handler = function(h,...) {
         URL = svalue(h$obj)
         repos = getOption("repos")
         repos["CRAN"] = gsub("/$", "", URL[1])
         options(repos = repos)
         dispose(win)
       })
     ##
     ## End(Not run)

