DroidDiagram Programmer's Guide
TableNode Class
Remarks See Also
 






Tables are diagram nodes that can contain multiple cells and can be related to other nodes through their rows.

Namespace: com.mindfusion.diagramming
Package: com.mindfusion.diagramming

 Syntax

Java  Copy Code

public class TableNode extends DiagramNode implements RenderTextCallback, InplaceEditable

 Remarks

Links can connect either to table rows or to the table as an integral node. Use the setConnectionStyle method to specify whether links drawn by the user should be connected to the table rows or to the table itself.

Tables consist of Cell instances distributed across rows and columns. The number of rows and columns can be set via the setRowCount and setColumnCount methods. The default width of the table columns is specified through setColumnWidth and the default height of the rows through setRowHeight. Cells can be made to span several rows and columns via their Cell.setRowSpan and Cell.setColumnSpan methods.

Rows can be assigned to distinct sections of the table. Each section can be collapsed or expanded, hiding or showing all rows in the section except the header one. To define a section, call the Row.setHeader method. A section consists of all rows after a header row and spans to the next header. Each header row displays a +/- button that allows expanding or collapsing the section interactively. The button appears either on the left of the first cell of a header row or in a separate column, as specified through the setOffsetHeaderRows method. Sections can be collapsed or expanded programmatically using the Row.setExpanded method of their header rows.

The structure of a table can be changed dynamically by adding and deleting rows and columns. This can be done with the addColumn and addRow methods as well with the insertColumn, insertRow and redimTable methods. Use the deleteRow and deleteColumn methods to delete existing rows and columns.

Tables have a caption text, which is set via the setCaption method. The height of the caption and the alignment of the text are specified via the setCaptionHeight and setCaptionFormat methods. To get even richer text formatting, call setEnableStyledText and embed HTML-like formatting tags in the caption.

In order to set an image as tables background, call the setImage method. The alignment of the image in relation to the tables rectangle is set via the setImageAlign method. The table can be resized to fit the size of its image by calling the resizeToFitImage method.

The rows and columns of a table can be accessed through the getRows and getColumns methods. The getCell method lets you access individual table cells.

 Inheritance Hierarchy

java.lang.Object
    com.mindfusion.diagramming.DiagramItem
        com.mindfusion.diagramming.DiagramNode
            com.mindfusion.diagramming.TableNode

 See Also

TableNode Members
com.mindfusion.diagramming Namespace