/* Project: Email Chess Author: Matti Kantola maza@ee.oulu.fi http://www.angelfire.com/nd/maza Description: Vertical layout manager. History: 27.7.2000 wrote it */ import java.awt.*; import java.util.*; public class VerLayout implements LayoutManager { int num=0; int hoff,vgap,hsize,vsize; int maxy=0; Hashtable h; public VerLayout(int hoff,int hsize,int vgap,int vsize) { this.hoff=hoff; this.hsize=hsize; this.vgap=vgap; this.vsize=vsize; h=new Hashtable(); } public void setSize(Component comp,int w,int h) { this.h.put(comp,new Rectangle(w,h)); maxy-=vgap; maxy+=h+(vsize-vgap); } public void addLayoutComponent(String name, Component comp) { num++; maxy+=vgap; } public void layoutContainer(Container parent) { int cy=0; Component[] comps=parent.getComponents(); for(int i=0;i