gUpdateDataMessage-class       package:iSPlot       R Documentation

_C_l_a_s_s "_g_U_p_d_a_t_e_D_a_t_a_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 _d_a_t_a _m_e_s_s_a_g_e

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

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

_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("gUpdateDataMessage", from, where, ...)'. When creating a
     gUpdateDataMessage object, the 'from' parameter is the object that
     is telling the data to be updated.  Currently, the 'from'
     parameter will be an object of class sPlotView or spreadView.  The
     where parameter is what  point of the data should be updated (this
     is returned by the function,  identifyPoint).  The initialize
     method for gUpdateDataMessage will call the  method,
     'viewUpdateData', to ensure that the message is properly
     initialized  when it is created.

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

     '_t_o': which data set is to be updated; a character string 

     '_t_y_p_e': the type of update to be performed; one of the following
          strings: "add", "reset", "modify", or "delete" 

     '_m_D_a_t_a': the data needed to perform the update; will be a list
          that may contain the data name, the row name, the column name
          and/or the new data 

_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 Updates the named data and then if views are 
          present, calls the function, updateViews, to update any views
          that depend  on the changed data 

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

     _t_o Returns the 'to' slot 

     _t_o<- Sets the 'to' slot 

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

     Elizabeth Whalen

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

     'updateViews',  'gMessage-class', 'gUpdateMessage-class',
     'gUpdateViewMessage-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 set highlight mode through Highlight under the ViewMode menu
         setHighlightMode() 
         # should create a gUpdateDataMessage object by clicking on the plot
         curpt<-identifyPoint(curplot=getActivePlot(),xyloc=list(x=2.7,y=72))
         dMessage<-new("gUpdateDataMessage",from=getActivePlot(),
                       where=curpt)
         handleMessage(dMessage)    
       }

