1 14 package org.wings; 15 16 import java.util.ArrayList ; 17 import java.util.List ; 18 19 30 public class SBoxLayout 31 extends SAbstractLayoutManager { 32 33 public static final int X_AXIS = SConstants.HORIZONTAL; 35 public static final int Y_AXIS = SConstants.VERTICAL; 36 37 protected ArrayList components = new ArrayList (2); 38 39 protected int orientation = SConstants.HORIZONTAL; 40 protected int align = SConstants.LEFT_ALIGN; 41 protected int borderThickness = 0; 42 43 48 protected int hgap = 0; 49 50 55 protected int vgap = 0; 56 57 62 public SBoxLayout(int orientation) { 63 setOrientation(orientation); 64 } 65 66 public void addComponent(SComponent c, Object constraint, int index) { 67 components.add(index, c); 68 } 69 70 public void removeComponent(SComponent c) { 71 components.remove(c); 72 } 73 74 79 public List getComponents() { 80 return components; 81 } 82 83 89 public SComponent getComponentAt(int i) { 90 return (SComponent) components.get(i); 91 } 92 93 100 public void setOrientation(int o) { 101 orientation = o; 102 } 103 104 109 public int getOrientation() { 110 return orientation; 111 } 112 113 114 118 public void setBorder(int borderThickness) { 119 this.borderThickness = borderThickness; 120 } 121 122 126 public int getBorder() { 127 return borderThickness; 128 } 129 130 136 public int getHgap() { 137 return hgap; 138 } 139 140 146 public void setHgap(int hgap) { 147 this.hgap = hgap; 148 } 149 150 156 public int getVgap() { 157 return vgap; 158 } 159 160 166 public void setVgap(int vgap) { 167 this.vgap = vgap; 168 } 169 } 170 171 172 | Popular Tags |