next up previous contents index
Next: C Mini-tutorial on Notation Up: B TCM File format Previous: B.4 Diagram Editor File

Subsections

B.5 Table Editor File Format

  

Like diagrams, the table editor file format starts first with a Storage section and then a Document section. Directly after the Document section follows the Table section:

Table section

 
Table {
    { TopLeft <number> <number> }    # top-left (x,y) of entire table.
    { NumberOfRows <number> }        # number of rows in table (cells per column).
    { NumberOfColumns <number> }     # number of columns in table (cells per row).
    { MarginWidth <number> }         # min. distance between text and column line.
    { MarginHeight <number> }        # min. distance between text and row line.
}
In an earlier version of TCM other attributes where stored as well such as DefaultLineStyle, DefaultRowAlignment, DefaultColumnAlignment etc. but they are now treated as attributes of the table editor not of a table.

Row sections

  After the Table section follow the row sections in consecutive order (they are numbered from 0 to NumberOfRows-1):
Row <number> {
    { Height <number> }         # all cells in row have the same height.
    { Alignment <alignment> }   # all texts in row have the same row alignment.
    { NumberOfCells <number> }  # a row having n cells has n+1 lines
    { LineStyle <linestyle> }   # each line piece can have a different style.
    { Text <string> }           # texts are stored per row.
    { Font <xlfd> }             # XLFD font description.
    { LineStyle <linestyle> }   # alternate: line-text-font-...-text-font-line.
    ...
}
The NumberOfCells of a row has to be equal to the NumberOfColumns field in the table section. This field indicates how many cells follow. The line pieces to the left and to the right of the cells are seen as part of the row. Each line piece has a separate line style. In the row sections the cell text strings and their fonts are stored. The size of the cell is determined by the row and column sizes and the text alignment of a cell is determined by the row and column alignment. In a row section, line style fields and cell text and font fields alternate and it always starts and ends with a line style field.

Column sections

  After the Table section follow the column sections (numbered from 0 to NumberOfColumns-1):
Column <number> {
    { Width <number> }          # all cells in column have the same width.
    { Alignment <alignment> }   # all texts in column have the same column alignment.
    { NumberOfCells <number> }  # a column having n cells has n+1 lines
    { LineStyle <linestyle> }   # each line piece can have a different line style.
    ...
}
The NumberOfCells of a column has to be equal to the NumberOfRows field in the table section. Because the cell texts are already specified in the row sections a column section only needs the line style fields for horizontal line pieces. There are NumberOfCells+1 line style fields in a column.


next up previous contents index
Next: C Mini-tutorial on Notation Up: B TCM File format Previous: B.4 Diagram Editor File
Frank Dehne,Faculty of Mathematics and Computer Science, Vrije Universiteit Amsterdam
11/17/1997