gUpdateMessage-class         package:iSPlot         R Documentation

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

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

     gUpdateMessage is a class to represent an update message.  When
     one of the components in the model-view-controller paradigm needs
     to tell  another component to be updated, an update message is
     created.  For example, when the data changes, it needs to tell the
     views to be updated and thus, a gUpdateViewMessage object is
     created.  Both gUpdateViewMessage and  gUpdateDataMessage classes
     are inherited from gUpdateMessage.   Although, gUpdateMessage is
     not a virtual class, currently no objects of class gUpdateMessage
     are created in package, iSPlot.

_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("gUpdateMessage",
     ...)'.

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

     '_t_y_p_e': the type of update to be performed, will be a character
          string

     '_m_D_a_t_a': the data needed to perform the update, will be a list 

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

     Class '"gMessage"', directly.

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

     _m_D_a_t_a Returns the 'mData' slot

     _m_D_a_t_a<- Sets the 'mData' slot 

     _t_y_p_e Returns the 'type' slot 

     _t_y_p_e<- Sets the 'type' slot 

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

     Elizabeth Whalen

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

     'gMessage-class', 'gUpdateViewMessage-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,"gUpdateMessage")
       }

