gUpdateViewMessage-class {iSPlot}R Documentation

Class "gUpdateViewMessage": A class to represent an update view message

Description

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.

Objects from the Class

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.

Slots

type:
the type of update to be performed, will be one of the following character strings: "updatePoint" or "replot"
mData:
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

Extends

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

Methods

handleMessage
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
initialize
Creates a gUpdateViewMessage object

Author(s)

Elizabeth Whalen

See Also

gMessage-class, gUpdateMessage-class, gUpdateDataMessage-class

Examples

  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
    vMessage<-new("gAddViewMessage", dataName="USArrests", type="plotView",
                  plotType="sPlotView",  dfRows = 1:nrow(USArrests), 
                  dfColumns = 1:2)    
    handleMessage(vMessage)

    # now set the view mode to Highlight using the ViewMode menu
    # then click on a point in the plot and a gUpdateViewMessage will be 
    # created and handled
    # you can see this by looking at the updated view
  }

[Package iSPlot version 1.2.0 Index]