@@ -3,6 +3,10 @@ package geoscript.carto
33import java.awt.Font
44import java.awt.Color
55
6+ /**
7+ * Add table to a cartographic document
8+ * @author Jared Erickson
9+ */
610class TableItem extends Item {
711
812 List<String > columns = []
@@ -30,20 +34,42 @@ class TableItem extends Item {
3034 strokeColor : Color . BLACK
3135 )
3236
37+ /**
38+ * Create table from the top left with the given width and height.
39+ * @param x The number of pixels from the left
40+ * @param y The number of pixels from the top
41+ * @param width The width in pixels
42+ * @param height The height in pixels
43+ */
3344 TableItem (int x , int y , int width , int height ) {
3445 super (x, y, width, height)
3546 }
3647
48+ /**
49+ * Set the columns of the table
50+ * @param names The column names
51+ * @return The TableItem
52+ */
3753 TableItem columns (List<String > names ) {
3854 this . columns. addAll(names)
3955 this
4056 }
4157
58+ /**
59+ * Add a column to the table
60+ * @param name The column name
61+ * @return The TableItem
62+ */
4263 TableItem column (String name ) {
4364 this . columns. add(name)
4465 this
4566 }
4667
68+ /**
69+ * Add a row to the table
70+ * @param values A Map of values
71+ * @return The TableItem
72+ */
4773 TableItem row (Map values ) {
4874 rows. add(values)
4975 this
0 commit comments