Documentation Set for Swarm 2.2
Prev | Reference X. Space Library | Next

# Value2dDisplay

## Name

Value2dDisplay -- Value2dDisplay displays 2d arrays of values.

## Description

Value2dDisplay helps display 2d arrays of values. Value2dDisplay goes through a given Discrete2d array, turn states into colours, and draws them into a Raster widget.

## Protocols adopted by Value2dDisplay

SwarmObject CREATABLE

## Methods

### Phase: Creating

- - setDiscrete2dToDisplay: (id <GridData>)c
  Set which array to draw.

- - setDisplayWidget: (id <Raster>)r colormap: (id <Colormap>)c
  Set the display widget and the colourmap to use to draw the value array.

- + create: (id <Zone>)aZone setDisplayWidget: (id <Raster>)r colormap: (id <Colormap>)c setDiscrete2dToDisplay: (id <GridData>)d
  Convenience constructor for Value2dDisplay

### Phase: Using

- - display
  Draw the array on the given widget. Note that you still have to tell the widget to draw itself afterwards. The code for display uses the fast macro access in Discrete2d on the cached return value from getLattice. It also caches the drawPointX:Y: method lookup on the display widget - this is a nice trick that you might want to look at.

- - setDisplayMappingM: (int)m C: (int)c
  Linear transform of states to colours for drawing. color = state / m + c If not set, assume m == 1 and c == 0.

Prev | Home | Next
Object2dDisplay | Up | General