Ultra Light Client Guide and Reference

Implementing the faceless half in Smalltalk

The Smalltalk implementation of ULCPieChart is conceptually identical to the Java one. The saveState: method packs the widget data into the Smalltalk version of Anythings.

saveState: aStcAnything
 
 super saveState: aStcAnything.
 aStcAnything
   at: 'w' put: self width;
   at: 'h' put: self height;
   at: 'data' put: (self
                     fillData: self values
                     colors: self colors
                     labels: self labels);
 yourself

The Smalltalk implementation of the setData: method follows:

setData: aValuesCollection colors: aColorsCollection labels: aLabelsCollection
    | data |
 
    data := self
              fillData: aValuesCollection
              colors: aColorsCollection
              labels: aLabelsCollection.
    self sendToUI: 'setData' with: data

In Smalltalk, the type name used to request the creation of UI half objects is defined by overriding the typeString method:

typeString
    ^'com.ibm.ulc.examples.pieExtension.PieChart'


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]