gUpdateDataMessage-class {iSPlot}R Documentation

Class "gUpdateDataMessage": A class to represent an update data message

Description

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.

Objects from the Class

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.

Slots

to:
which data set is to be updated; a character string
type:
the type of update to be performed; one of the following strings: "add", "reset", "modify", or "delete"
mData:
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

Extends

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

Methods

handleMessage
Updates the named data and then if views are present, calls the function, updateViews, to update any views that depend on the changed data
initialize
Creates a gUpdateDataMessage object
to
Returns the to slot

Author(s)

Elizabeth Whalen

See Also

gMessage-class, gUpdateMessage-class, gUpdateViewMessage-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 gUpdateDataMessage will be 
    # created and handled
    # you can see this by looking at the data after you click on a point
    x<-getData(type="dataframe", name="USArrests")
  }

[Package iSPlot version 1.2.0 Index]