next up previous contents index
Next: 8. Tree Editing Up: Toolkit for Conceptual Modeling Previous: 6. Architectural View Editors

Subsections

   
7. Table Editing

All TCM table editors are very similar. With each table editor you can create and manipulate textual tables, i.e. tables in which the cells are filled with a multi-line text string. The table editors offer a lot of layout facilities and TCM has special purpose table editors that have constraints built-in for a specific modeling technique. Furthermore, the tables that are made by TCM are kept graphically consistent and TCM keeps track of the contents of the tables, which is important when you have to do a lot of updates.

7.1 Editing Tables

When you start up a table editor, or issue the New command in a table editor, a new table is created having N x M empty cells (by default, N = 7 and M = 7). New rows and columns of empty cells can be created with the Add Row and Add Column commands. Selected rows and columns can be deleted with the Delete Rows and Delete Columns commands. These commands can be issued from the Edit menu.

If you start up a table editor from the tcm start-up tool, before the main window of the editor is displayed, a dialog window with a list of text fields is presented. This dialog has four fields: number of rows, number of columns, default row height and default column width. In these fields the default values are already filled in. You can change these values for the editor that will be launched.

By default, the table is positioned on the drawing area having its top-left corner a little right below the top-left corner of the drawing area. You can reposition the entire table by means of the four arrow buttons in the bottom-left corner of the main window. Like the diagram editors, the page boundaries are displayed. If you print the table or save it as plain PostScript, the table is positioned on the printed page exactly as it is positioned on the drawing area (what you see is what you print).

Each row and each column has a sequence number label. These labels are used to select an entire row or column or to move an entire row or column to a new position. These labels cannot be edited. In the View menu there is an option to hide the labels. In the Printer Options submenu of the Print menu you can choose to print these labels or not. See figure 7.1 for a snap-shot of the table editor.


  
Figure 7.1: Snap-shot of a table being edited.
\includegraphics[width=5.5in]{p/table_snapshot.ps}

7.1.1 Definitions

We first give some definitions of the terms that are used in the rest of this chapter.

The document that you edit is called a table.  A table contains a number of cells  which are invisible rectangles. The table has a number of rows  and a number of columns . Each cell is part of one row and of one column. All rows in the table have the same number of cells and all columns of a table have the same number of cells. All cells in a row have the same height and all cells in a column have the same width. All cells in a row have the same center y-coordinate and all cells in a column have the same center x-coordinate. All rows and columns are packed, i.e. rows and columns cannot overlap and the distance between two rows or two columns is zero when there are no other rows between them.

Each row has a row label  which is an uneditable label containing the row sequence number (rows are ordered according to their y-coordinates), positioned both near the left edge of the first cell of the row and near the right edge of the last cell of the row. Each column has a column label  which is an uneditable label containing the column sequence number (columns are ordered according to their x-coordinates), both positioned above the first cell of the column and below the last cell of the column.

Each border line between two cells is called a line piece . A line piece has a certain line style: solid, dashed, invisible and so on. So, line pieces are the items of a table that can be made visible and make the table appear like a grid. Line pieces are either horizontal or vertical. Horizontal line pieces are part of the same column as the neighboring cells and vertical line pieces are part of the same row as the neighboring cells.

A cell itself is invisible, only its four border lines are possibly visible. A cell can contain some piece of cell text . Cell text is an editable multi-line text string. The cell text is positioned in the cell according to the column alignment, row alignment, text margin width and text margin height (which are all explained in the next sections). A cell can be selected. A selected cell has a rectangle drawn inside its four border lines.

7.1.2 Selection Commands

A selected cell is highlighted by an extra black rectangle inside the cell boundaries (see figure 7.1). The distance between the selection rectangle and the line pieces is a pixel or two. Here is a list of all the table editor selection commands:

    
7.1.3 Editing Text

Text editing works the same for all document editors. See section 2.5.1 for the different edit commands and the two different edit modes, in-line editing and out-line editing.

For going into edit mode in a table editor, you have to be sure that only a single cell is selected. When a single cell is selected and you type in characters or you click with button-1 on the cell then you enter edit mode. You leave edit mode when you either click Button-2 with the mouse pointer in any position or you click button-1 outside the cell that is being edited.

When a cell text has been edited and the autoresizing  toggle is on, the cell sizes automatically adapt to the new text size. I.e. if the text is too high to fit into the cell, the cell, and consequently the entire row is made higher, and if the text is too wide to fit into the cell, the cell, and consequently the entire column, is made wider. If the cell text becomes less wide or high, and the autoresize toggle is on, then the row will be made less high, respectively, the column will be made less wide, down to the size that the other texts in that row or column still fit. The default row height and default column width is the cell height and cell width when the table is initialized. The default row height and column width of the table can be modified in the Default Properties submenu of the Properties menu.

7.1.4 Copying and Moving Text

To move a single cell text  from one cell to another, drag and drop it with button-1 from an unselected source cell to a destination cell (just like dragging an edge label in a diagram editor). The old text of the destination cell will be overwritten. If the text is dropped somewhere outside a cell or you click button-2 while dragging, the command will be aborted.

Copying a single cell text  from one cell to another works in the same manner as moving a text. The difference is that the source cell should be selected.

When the autoresizing toggle is on, cell sizes automatically adapt to the new situation when text is copied or moved.

7.1.5 Cutting and Pasting Text

The above method for moving or copying cell texts works only for one cell at the time. To perform this on a whole group of cell texts there are the Cut, Copy and Paste commands. To cut cell texts to the cell text buffer, use the  Cut Texts <Ctrl+X> command in the Edit menu. It clears the texts of the selected cells and copies them into the buffer. Cut can also be a helpful command when you want to clear some part of the table. You can copy cell texts to the buffer via the Copy Texts <Ctrl+C> command in the Edit menu. It copies the text into the buffer, but, unlike Cut, it does not clear the cells.   

The cell texts in the buffer can be pasted into the table. The Paste Texts <Ctrl+Y> command in the Edit menu makes a paste box, that is attached to the mouse pointer.  The size of the paste box is about the size of the cell texts in the buffer. You can move the paste box with the mouse and click button-1 somewhere into the table to release it. The cell in which the mouse cursor (and the top-left of the paste box) was at the time you clicked button-1 becomes the top-left cell of the cell area in which the texts are pasted. Which cell is pasted by which cell text is determined by the relative row and column position (not of the actual size of the texts) when the original texts were cut or copied into the paste buffer. When you paste, the texts from the buffer are copied from the buffer into the table. The old cell texts are overwritten. If the box is released with the mouse pointer somewhere out of the table, the paste command is aborted. If the paste box is released (partly) outside the table, only the part that covers the table is modified.

7.1.6 Adding Rows and Columns


  
Figure 7.2: Add Row dialog window.
\includegraphics[width=2.5in]{p/addrowdialog.ps}

To add rows, use the Add Rows    command in the Edit menu. A prompt dialog is popped up asking for the number of rows to be added (default is 1). In the dialog there is a toggle to choose between adding the new rows above the selection or appending them to the bottom of the table. ``Above the selection'' means one row above the highest selected cell in the current selection, or when the selection is empty, to the bottom of the table.

Adding columns, via the Add Columns    command, is like adding rows. There is a choice between adding the new columns to the left of the current selection or appending to the right of the table.

After adding rows or columns the table is redrawn including the new rows and columns in such a way that the top-left corner of the table remains at the same position.

7.1.7 Deleting Rows and Columns

To delete rows, use the Delete Rows command in the Edit menu.   This command deletes every row in which one or more cells are selected.

To delete columns, use the Delete Columns command in the Edit menu.   This command deletes every column in which one or more cells are selected.

To delete all cells, use the Delete All command. This results into an empty table 7.1. Before everything is deleted, a question dialog asks if you are sure about what you are doing.

To remove all unused rows and columns, use the Purge   command. This command deletes all rows and columns in which all cells have empty cell texts.

When you delete rows and/or columns, the table is redrawn in such a way that the top-left corner stays at the same position.

7.1.8 Moving Rows and Columns

Moving a row is possible via dragging a row label from the    source row to the desired destination row. If the dragged label is released in one of the cells of the destination row, the source row, where the label came from, is moved to the position of the destination row and the destination row and the rows between the source and destination row are all shifted one row up (when the source row was above the destination row) or one row down (when the source row was beneath the destination row) 7.2.

Moving a column works in a similar way.   If you drop a column label into a cell of another column, the source column moves to that position and the destination column and the columns between those two are all shifted one column left or right.

Note that when you move a row or column, the row and column labels are not moved with. They stay in the same consecutive order, of course.

After either command, the resulting table has the same position and has the same size.

7.1.9 Sorting Rows and Columns

With the Sort Rows command in the Edit menu you can sort rows alphabetically.    When the selection is empty, the table is sorted according to the contents of the first column. If there are selected cells, sorting is according to the column of the left-most selected cell. With the Sort Columns command in the Edit menu you can sort columns   alphabetically. When the selection is empty, the table is sorted according to the contents of the first row. If there are selected cells, sorting is according to the row of the top-most selected cell.

After either command, the resulting table has the same position and the same size.

      
7.1.10 Resizing Rows and Columns

Resizing rows and columns can be done by hand but only when the autoresizing toggle is off. To resize a row or column, drag a line piece between two rows or columns: if you enter a line piece between two rows or between two columns, the mouse pointer turns into a pair of vertical respectively horizontal arrows. To resize a row you can drag the line piece with button-1 up or down. If you drop the line at a new position, the row above the dragged line, is resized. The part of the table below the row that is resized, will be repositioned (but not resized).

To resize a column you can drag a line piece with button-1 left or right. If you drop the line at a new position, the column to the left of the line that is dragged, is resized. The part of the table to the right of the column that is resized, will be repositioned (but not resized).

7.1.11 Undo and Redo

The table editors have a multiple-level undo for their commands. A command which is undone, can be redone again.   All table edit commands listed in the Edit and Properties menu can be undone. Furthermore, the table edit commands issued by the mouse can also be undone. In table 7.3 all undo-able table editor commands are listed together with how they can be called.


  
Figure 7.3: All atomic table edit commands.
\includegraphics[height=7.5in]{p/tablecommands.eps}

7.1.12 Changing Properties of a Table

The Properties menu  contains certain commands that change properties of cells and/or their texts.

The following default table properties can be set via the Default Properties submenu of the Properties menu:

7.1.13 Miscellaneous Commands

     
7.2 The Generic Table Editor (TGT)

This editor has exactly the features described in the previous section. The contents of the cells are unrestricted. In the remaining sections the specific table editors are described. These work almost the same as the generic editor. The table editors are able to read in each others tables (although a warning message is given when you do this).

       
7.3 The Transaction Decomposition Table Editor (TTDT)

According to this modeling technique, the entries in row 0 contain transaction names. The entries in column 0 contain object class (or entity type) names. The other entries contain zero or more action names. To graphically separate row 0 and column 0 from the rest of the table, the initial table separates them by default by a dual line. The editor does not check for that layout, however. For an example see figure 7.7. Currently, the editor checks the constraints in figure 7.6.


  
Figure 7.6: Immediately checked and soft constraints on TDTs.
\includegraphics{p/TDconstraints.eps}


  
Figure 7.7: Example transaction decomposition table.
\includegraphics{p/tdt_example.eps}

       
7.4 The Transaction-Use Table Editor (TTUT)

According to this modeling technique, this table has five columns. The entries in row 0 are initialized with the labels Create, Read, Update and Delete. The entries in column 0 contain transaction names. The other entries contain zero or more object class (or entity type) names. To graphically separate row 0 and column 0 from the rest of the table, the initial table separates them by a dual line. The editor does not check for that layout, however. For an example see figure 7.8. The editor checks the immediately and soft constraints of figure 7.9.


  
Figure 7.8: Example transaction-use table.
\includegraphics[width=5.5in]{p/tut_example.eps}


  
Figure 7.9: Immediately checked and soft constraints on TUTs.
\includegraphics{p/TUconstraints.eps}

       
7.5 The Function-Entity type Table Editor (TFET)

This kind of the table is also called Function-Entity Matrix in [22]. According to this modeling technique, the entries in row 0 contain transaction names. The entries in column 0 contain object class (or entity type) names. The other entries contain CRUD strings:  a string containing zero or one occurrences of the characters C, R, U and D, and that does not contain any other character. To separate row 0 and column 0 from the rest, the initial table separates them from the rest by a dual line. The editor does not check for that layout, however.

In [22] it is shown how you can define business areas  in a function-entity type table. To draw business areas in TFET you could use the Update Line Width from the Properties menu. See figure 7.11 for an example table. Currently, the editor checks the constraints in figure 7.10.


  
Figure 7.10: Immediately checked and soft constraints on FETs.
\includegraphics{p/FEconstraints.eps}


  
Figure 7.11: Example function-entity type table partitioned into business areas.
\includegraphics{p/fet_example.eps}



Footnotes

... table 7.1
Contrary the common belief an empty table is still a table.
... row) 7.2
This sounds more complicated than it actually is, experiment with this.

next up previous contents index
Next: 8. Tree Editing Up: Toolkit for Conceptual Modeling Previous: 6. Architectural View Editors
Henk van de Zandschulp
2003-01-20