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. Thus, 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 function, updateDF, to ensure that the message is properly initialized when it is created.

Slots

to:
which data set is to be updated, will be a character string
type:
the type of update to be performed, will be one of the following character 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 correct 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
to<-
Sets the to slot

Author(s)

Elizabeth Whalen

See Also

updateDF, updateViews, 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
    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)    
  }

[Package iSPlot version 1.0.3 Index]