1 14 package org.wings; 15 16 import java.util.ArrayList ; 17 import java.util.List ; 18 19 25 public class SGridLayout extends SAbstractLayoutManager { 26 protected ArrayList components = new ArrayList (2); 27 protected int rows = 1; 28 protected int cols = 1; 29 protected int border = 0; 30 protected boolean renderFirstLineAsHeader = false; 31 32 37 protected int hgap = 0; 38 39 44 protected int vgap = 0; 45 46 49 public SGridLayout() { 50 this.setPreferredSize(new SDimension("100%", "100%")); 51 } 52 53 58 public SGridLayout(int cols) { 59 this(); 60 setColumns(cols); 61 } 62 63 69 public SGridLayout(int rows, int cols) { 70 this(cols); 71 setRows(rows); 72 } 73 74 79 public void setColumns(int c) { 80 cols = c; 81 } 82 83 88 public int getColumns() { 89 return cols; 90 } 91 92 97 public void setRows(int r) { 98 rows = r; 99 } 100 101 106 public int getRows() { 107 return rows; 108 } 109 110 public void addComponent(SComponent c, Object constraint, int index) { 111 components.add(index, c); 112 } 113 114 public void removeComponent(SComponent c) { 115 components.remove(c); 116 } 117 118 123 public List getComponents() { 124 return components; 125 } 126 127 133 public int getHgap() { 134 return hgap; 135 } 136 137 143 public void setHgap(int hgap) { 144 this.hgap = hgap; 145 } 146 147 153 public int getVgap() { 154 return vgap; 155 } 156 157 163 public void setVgap(int vgap) { 164 this.vgap = vgap; 165 } 166 167 199 200 205 public void setBorder(int borderWidth) { 206 border = borderWidth; 207 } 208 209 214 public int getBorder() { 215 return border; 216 } 217 218 223 public void setRenderFirstLineAsHeader(boolean renderAsTH) { 224 renderFirstLineAsHeader = renderAsTH; 225 } 226 227 230 public boolean getRenderFirstLineAsHeader() { 231 return renderFirstLineAsHeader; 232 } 233 } 234 235 236 | Popular Tags |