All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sics.agentbase.html.HtmlTable

java.lang.Object
   |
   +----sics.agentbase.html.HtmlContent
           |
           +----sics.agentbase.html.HtmlTable

public class HtmlTable
extends HtmlContent
The HtmlTable class implements a HTML table and methods to generate HTML code representation of it. Objects at a specified position in the table can be added, removed or changed.


Constructor Index

 o HtmlTable(int, int)
Creates a HtmlTable with the specified size.
 o HtmlTable(Object[][])
Creates a HtmlTable with the specified size and values.

Method Index

 o clrElementAt(int, int)
Removes the element at the specified position in this table.
 o getPattern(int, int)
 o setBorder(String)
Sets the border of this table.
 o setCaption(String)
Sets the caption of this table.
 o setCaption(String, String)
Sets the caption of this table with the specified alignment.
 o setElementAt(int, int, Object)
Sets the element at the specified position in this table.
 o setPattern(int)
Sets the pattern type of this table.
 o setRow(int, Object[])
Sets the row at the specified position in this table.
 o toString()
Returns a string representation of this HTML table.

Constructors

 o HtmlTable
 public HtmlTable(int rows,
                  int cols)
Creates a HtmlTable with the specified size.

Parameters:
rows - the number of rows in the table.
cols - the number of columns in the table.
 o HtmlTable
 public HtmlTable(Object o[][])
Creates a HtmlTable with the specified size and values. The specified array is used as a representation of the table with the same number of rows and columns as the array.

Parameters:
o - a matris of values representing the table.

Methods

 o setBorder
 public void setBorder(String border)
Sets the border of this table.

Parameters:
border - the size of the border as a string or null if no border should be used (default).
 o setPattern
 public void setPattern(int pat)
Sets the pattern type of this table.

 o setCaption
 public void setCaption(String caption)
Sets the caption of this table.

Parameters:
caption - the caption of this table or null if no caption should be used (default).
 o setCaption
 public void setCaption(String caption,
                        String align)
Sets the caption of this table with the specified alignment.

Parameters:
caption - the caption of this table or null if no caption should be used (default).
align - the alignment of the caption.
 o setElementAt
 public void setElementAt(int row,
                          int col,
                          Object o)
Sets the element at the specified position in this table.

Parameters:
row - the row to set the element at.
col - the column to set the element at.
o - the element to set in this table.
Throws: ArrayIndexOutOfBoundsException
if an invalid position was given.
 o clrElementAt
 public void clrElementAt(int row,
                          int col)
Removes the element at the specified position in this table.

Parameters:
row - the row to remove the element at.
col - the column to remove the element at.
o - the element to remove from this table.
Throws: ArrayIndexOutOfBoundsException
if an invalid position was given.
 o setRow
 public void setRow(int row,
                    Object o[])
Sets the row at the specified position in this table.

Parameters:
row - the row to set the elements.
o - an array with elements to set at the specified row in this table.
Throws: ArrayIndexOutOfBoundsException
if an invalid row was given.
 o toString
 public String toString()
Returns a string representation of this HTML table.

Returns:
a string representation of this HTML table.
Overrides:
toString in class HtmlContent
 o getPattern
 public String getPattern(int y,
                          int x)

All Packages  Class Hierarchy  This Package  Previous  Next  Index