gUpdateMessage-class {iSPlot} | R Documentation

## Class "gUpdateMessage": A class to represent an update message

### Description

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.

### Objects from the Class

Objects can be created by calls of the form `new("gUpdateMessage", ...)`.

### Slots

`type`:
  the type of update to be performed, will be a character string
`mData`:
  the data needed to perform the update, will be a list

### Extends

Class `"gMessage"`, directly.

### Methods

mData
  Returns the `mData` slot
mData<-
  Sets the `mData` slot
type
  Returns the `type` slot
type<-
  Sets the `type` slot

### Author(s)

Elizabeth Whalen

### See Also

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

[Package iSPlot version 1.0.7 Index]