gUpdateViewMessage-class       package:iSPlot       R Documentation

_C_l_a_s_s "_g_U_p_d_a_t_e_V_i_e_w_M_e_s_s_a_g_e": _A _c_l_a_s_s _t_o _r_e_p_r_e_s_e_n_t _a_n _u_p_d_a_t_e _v_i_e_w _m_e_s_s_a_g_e

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

     gUpdateViewMessage is a class to represent an update view message.
      Thus, when either the controller or the model (i.e. the control
     window or the data) want to update the view(s), a
     gUpdateViewMessage object is created. gUpdateViewMessage is
     inherited from the class, gUpdateMessage, which inherits from the
     virtual class, gMessage.  Whenever a gUpdateViewMessage is created
     (initialized), the next step is to call the handleMessage method 
     to act upon that message and update the views.

_O_b_j_e_c_t_s _f_r_o_m _t_h_e _C_l_a_s_s:

     Objects can be created by calls of the form
     'new("gUpdateViewMessage", type, ...)'. When creating a
     gUpdateViewMessage, the type parameter can be one of the  four
     following options: "add", "reset", "modify", or "delete".  This 
     parameter shows what type of update occurred on the data.  If the
     type is "modify" or "delete", then an extra parameter is needed
     and this extra parameter is Rname to indicate which row names or
     indices have changed in the data.

_S_l_o_t_s:

     '_t_y_p_e': the type of update to be performed, will be one of the
          following character strings: "updatePoint" or "replot" 

     '_m_D_a_t_a': the data needed to perform the update; if the type is
          "replot", then mData will be an empty list, if the type is
          "updatePoints", then mData will be a list with one element,
          Rname, to indicate which rows have changed 

_E_x_t_e_n_d_s:

     Class '"gUpdateMessage"', directly. Class '"gMessage"', by class
     '"gUpdateMessage"'.

_M_e_t_h_o_d_s:

     _h_a_n_d_l_e_M_e_s_s_a_g_e Depending on which data set was changed, it updates
          any views (plots or spreadsheets) that depend on that data by
          calling the functions, updatePlots and updateSpread 

     _i_n_i_t_i_a_l_i_z_e Creates a gUpdateViewMessage object 

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

     Elizabeth Whalen

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

     'updatePlots',  'updateSpread', 'gMessage-class',
     'gUpdateMessage-class', 'gUpdateDataMessage-class'

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

       if (interactive())
       {
         createControlWindow()
         # should load data through Open Data or Open File under the File menu
         data(USArrests)
         loadDFData(USArrests,"USArrests")
         # plotting the data should occur through Plot Data under the 
         # Display menu
         createView(type = "plotView", dataName = "USArrests", 
                    plotType = "sPlotView", dfRows = 1:nrow(USArrests), 
                    dfColumns = 1:2)    
         # should modify using the control window (by choosing the view mode and
         # then clicking on a plot)
         # by interacting with a plot when the view mode is color, these 
         # functions will be called automatically
         modify("USArrests", Rname=c("Massachusetts","Ohio"), 
                Cname=c("color","color"), data=c("red","green")) 
         # create an update view message and then dispatch it so the points
         # that have changed will be replot
         plMessage<-new("gUpdateViewMessage",type="modify",Rname=c("Massachusetts",
                        "Ohio"))
         handleMessage(plMessage,dataName="USArrests")

         # now see if the message is inherited from gMessage
         is(plMessage,"gUpdateViewMessage")
       }

