gAddViewMessage-class         package:iSPlot         R Documentation

_C_l_a_s_s "_g_A_d_d_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 _a_d_d _v_i_e_w _m_e_s_s_a_g_e

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

     gAddViewMessage is a class to represent an add view message. 
     Whenever a view needs to be added, a gAddViewMessage object is
     created and the handleMessage method is called to act on the
     message.  Currently, the  two places where views can be added are
     the View Data and Plot  Data menu options under the File menu.  A
     gAddViewMessage object can add either a scatterplot or spreadsheet
     view, though new views may be added in the future. 
     gAddViewMessage inherits from the class, gAddMessage, which
     inherits from the virtual class, gMessage.

_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("gAddViewMessage", dataName, type, ...)'. When creating a
     gAddViewMessage, the dataName parameter will fill the  dataName
     slot, the type parameter will fill the type slot, and any 
     parameters in the ... parameter will fill the mData slot. 
     dataName will be the name of the data that the view will show. 
     type indicates whether the view will be "plotView" or
     "spreadView".  mData is any extra information the view may need.

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

     '_t_y_p_e': a character string representing the type of view, will be
          either "plotView" or "spreadView" 

     '_d_a_t_a_N_a_m_e': the name of the data that the view will show

     '_m_D_a_t_a': any extra information the view may need, will be a list 

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

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

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

     _h_a_n_d_l_e_M_e_s_s_a_g_e Creates a view by calling the function, createView

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

     _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:

     'createView',  'gAddMessage-class', 'gAddDataMessage-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")
         dMessage<-new("gAddDataMessage", data="USArrests")
         handleMessage(dMessage)
         # plotting the data should occur through Plot Dataframe under 
         # the Display menu
         vMessage<-new("gAddViewMessage", dataName="USArrests", type="plotView",
                       plotType="sPlotView",  dfRows = 1:nrow(USArrests), 
                       dfColumns = 1:2)    
         handleMessage(vMessage)
         # check the class
         class(vMessage)
       }

