1 30 31 package swingwtx.swing.table; 32 33 public class TableColumn { 34 35 protected TableCellRenderer cellRenderer = null; 36 protected TableCellRenderer headerRenderer = null; 37 private int idx = 0; 38 private int width = 0; 39 private int maxWidth = 0; 40 private int minWidth = 0; 41 private int preferredWidth = 0; 42 private boolean resizable = true; 43 private Object headerValue = ""; 44 private Object identifier = ""; 45 private TableCellEditor tableCellEditor = null; 46 47 public TableColumn() {} 48 public TableColumn(int index) { idx = index; } 49 public TableColumn(int index, int width) { idx = index; this.width = width; } 50 public TableColumn(int index, int width, TableCellRenderer renderer, TableCellEditor editor) { idx = index; this.width = width; cellRenderer = renderer; tableCellEditor = editor;} 51 52 53 public void setCellRenderer(TableCellRenderer newrenderer) { 54 cellRenderer = newrenderer; 55 } 56 57 public TableCellRenderer getCellRenderer() { 58 return cellRenderer; 59 } 60 61 62 public void setHeaderRenderer(TableCellRenderer headerRenderer) { 63 this.headerRenderer = headerRenderer; 64 } 65 66 public TableCellRenderer getHeaderRenderer() { 67 return headerRenderer; 68 } 69 70 public int getModelIndex() { 71 return idx; 72 } 73 74 public void setModelIndex(int index) { 75 idx = index; 76 } 77 78 public java.lang.Object getHeaderValue() { 79 return headerValue; 80 } 81 public void setHeaderValue(java.lang.Object headerValue) { 82 this.headerValue = headerValue; 83 } 84 85 public java.lang.Object getIdentifier() { 86 return identifier; 87 } 88 public void setIdentifier(java.lang.Object identifier) { 89 this.identifier = identifier; 90 } 91 92 public int getMaxWidth() { 93 return maxWidth; 94 } 95 96 100 public void setMaxWidth(int maxWidth) { 101 this.maxWidth = maxWidth; 102 } 103 104 public int getMinWidth() { 105 return minWidth; 106 } 107 108 public void setMinWidth(int minWidth) { 109 this.minWidth = minWidth; 110 } 111 112 public int getPreferredWidth() { 113 return preferredWidth; 114 } 115 116 public void setPreferredWidth(int preferredWidth) { 117 this.preferredWidth = preferredWidth; 118 } 119 120 public boolean isResizable() { 121 return resizable; 122 } 123 124 public void setResizable(boolean resizable) { 125 this.resizable = resizable; 126 } 127 128 public TableCellEditor getCellEditor() { 129 return tableCellEditor; 130 } 131 132 public void setCellEditor(TableCellEditor tableCellEditor) { 133 this.tableCellEditor = tableCellEditor; 134 } 135 136 public int getWidth() { 137 return width; 138 } 139 140 public void setWidth(int width) { 141 this.width = width; 142 } 143 144 } 145 | Popular Tags |