1 14 package org.wings; 15 16 import java.util.ArrayList ; 17 import java.util.List ; 18 19 25 public class SFlowLayout 26 extends SAbstractLayoutManager { 27 30 protected final List components; 31 32 35 protected int orientation; 36 37 40 protected int align; 41 42 46 public SFlowLayout() { 47 components = new ArrayList (2); 48 setOrientation(SConstants.HORIZONTAL); 49 setAlignment(SConstants.LEFT_ALIGN); 50 } 51 52 57 public SFlowLayout(int alignment) { 58 this(); 59 setAlignment(alignment); 60 } 61 62 69 public void addComponent(SComponent c, Object constraint, int index) { 70 components.add(index, c); 71 } 72 73 public void removeComponent(SComponent c) { 74 components.remove(c); 75 } 76 77 82 public List getComponents() { 83 return components; 84 } 85 86 92 public SComponent getComponentAt(int i) { 93 return (SComponent) components.get(i); 94 } 95 96 105 public void setOrientation(int o) { 106 orientation = o; 107 } 108 109 114 public int getOrientation() { return orientation; } 115 116 126 public void setAlignment(int a) { 127 align = a; 128 } 129 130 135 public int getAlignment() { return align; } 136 } 137 138 139 | Popular Tags |