DataHubTable Cell Classes — assign identical arguments to many table cells.
A cell class is a means to assign the same rendering arguments to many different cells. The cell class specifies all of the arguments for a cell except for row, column, label and point name. Consequently, to add a cell that has the same arguments as an existing class, you must only specify those arguments along with the name of the class (see Member of Class - Type 3). A cell class is very convenient if you plan to have many cells using the same rendering. If you decide to change the rendering arguments for those cells, they can all be changed at once by changing the definition of the class. A cell class is also required to provide the rendering arguments for a cell when that cell has a value map. The value map refers to a different cell class for each of the ranges in the value map.
Cell classes are specified similarly to cells. They consist of up to three definitions for rendering, font and value map. If a class contains a value map, then the point value will be used to select a class through the value map. If that class also has a value map, the point value will be used again to select a class from the value map of the referred class. This class reference chain will resolve to an indefinite depth. Be sure not to create classes that refer to one another directly or indirectly through chained value maps. Cell class font specifications are identical to cell font specifications, except that the parameter name is cfont instead of font.
Cell class value map specifications are identical to cell value map specifications, except that the parameter name is cvmap instead of vmap.
A cell class has a type, much like a cell. The cell class can be of type 0 (label), 1 (point) or 4 (image). Label and image types are static. That is, the resulting contents of the cell do not change. In order to modify the contents of a label or image type, you must modify the class of the cell through a value map.
A label specifies a text string that does not change.
Argument | Type | Default | Description |
---|---|---|---|
name | string | required | The name of this cell class. |
type | number | required | 0 for a label cell. |
xalignment | string | left | left, center or right horizontal alignment of the text in the cell. |
yalignment | string | center | top, center, or bottom vertical alignment of the text in the cell. |
fgcolor | color | table default | The color used to render the text. If not specified, uses the table's fgcolor parameter. |
bgcolor | color | table default | The color used to render the cell background. If not specified, uses the table's bgcolor parameter. |
<PARAM NAME="class1" VALUE="myclass;0;left;center;#ffff00;#0000ff"> <PARAM NAME="cell1" VALUE="2;3;3;Hello World;myclass">
Will render the words Hello World with left/center justification in yellow text on a blue background.
This cell will display the value of an DataHub point. If the point value is a number you can specify the decimal format with which it is displayed.
Argument | Type | Default | Description |
---|---|---|---|
name | string | required | The name of this cell class. |
type | number | required | 1 for DataHub point value. |
xalignment | string | left | left, center or right horizontal alignment of the text in the cell. |
yalignment | string | center | top, center or bottom vertical alignment of the text in the cell. |
fgcolor | color | table default | The color used to render the text. If not specified, uses the table's fgcolor parameter. |
bgcolor | color | table default | The color used to render the cell background. If not specified, uses the table's bgcolor parameter. |
format | string | table default | The decimal format to use when the value of the point is a number |
<PARAM NAME="class1" VALUE="myclass;1;left;center;#ffff00;#0000ff"> <PARAM NAME="cell1" VALUE="2;3;3;Sine;myclass">
Will render the value of the point Sine in cell (2, 3) with left/center justification in yellow text on a blue background, with 1 to 3 decimal places of accuracy.
An image cell renders an image into the cell, clipping the image at the borders of the cell. The image is obtained from a URL.
Argument | Type | Default | Description |
---|---|---|---|
name | string | required | The name of this cell class. |
type | number | required | 4 for Image. |
xalignment | string | left | left, center or right horizontal alignment of the text in the cell. |
yalignment | string | center | top, center or bottom vertical alignment of the text in the cell. |
fgcolor | color | table default | The color used to render the cell foreground. If not specified, uses the table's fgcolor parameter. Foreground color is unused for image type cells. |
bgcolor | color | table default | The color used to render the cell background. If not specified, uses the table's bgcolor parameter. |
imageurl | string | required | The URL from which to obtain the image. This may be either an absolute URL of the form http://domain/path/image, or a relative URL of the form /path/image or path/image. |
alpha | number | 1.0 | An alpha blend value from 0.0 to 1.0 where 0.0 is transparent and 1.0 is opaque. |
<PARAM NAME="class1" VALUE="checkmark;4;center;center;#0;#00000000;checkmark.gif;0.5"> <PARAM NAME="cell1" VALUE="2;3;3;null;checkmark">
Will render the image from the URL checkmark.gif centered in the cell at (2, 3). The image will be semi-transparent. The background of the cell will be transparent.
Copyright © 1995-2010 by Cogent Real-Time Systems, Inc. All rights reserved.