KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > console > table > ColumnMetaData


1 package org.sapia.console.table;
2
3
4 /**
5  * @author Yanick Duchesne
6  * 2002-03-05
7  *
8  */

9 public class ColumnMetaData {
10   private int _width;
11   private int _cellPadding = 1;
12   private TableMetaData _meta;
13
14   /**
15    * Constructor for ColumnMetaData.
16    */

17   ColumnMetaData(TableMetaData meta, int width) {
18     _meta = meta;
19     _width = width;
20   }
21
22   public void setWidth(int width) {
23     _width = width;
24     _meta.calcWidth();
25   }
26
27   public int getWidth() {
28     return _width;
29   }
30
31   public int getCellPadding() {
32     return _cellPadding;
33   }
34
35   public void setCellPadding(int spacing) {
36     if (spacing <= 0) {
37       _cellPadding = 1;
38     } else {
39       _cellPadding = spacing;
40     }
41
42     _meta.calcWidth();
43   }
44 }
45
Popular Tags