KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > wings > plaf > css > BoxLayoutCG


1 /*
2  * $Id: BoxLayoutCG.java,v 1.8 2005/06/03 13:16:16 blueshift Exp $
3  * Copyright 2000,2005 wingS development team.
4  *
5  * This file is part of wingS (http://www.j-wings.org).
6  *
7  * wingS is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU Lesser General Public License
9  * as published by the Free Software Foundation; either version 2.1
10  * of the License, or (at your option) any later version.
11  *
12  * Please see COPYING for the complete licence.
13  */

14 package org.wings.plaf.css;
15
16 import org.wings.SBoxLayout;
17 import org.wings.SLayoutManager;
18 import org.wings.io.Device;
19
20 import java.io.IOException JavaDoc;
21 import java.util.List JavaDoc;
22
23 public class BoxLayoutCG extends AbstractLayoutCG {
24     /**
25      * @param d the device to write the code to
26      * @param l the layout manager
27      * @throws IOException
28      */

29     public void write(Device d, SLayoutManager l)
30             throws IOException JavaDoc {
31
32         final SBoxLayout layout = (SBoxLayout) l;
33         final List JavaDoc components = layout.getComponents();
34         final int cols = layout.getOrientation() == SBoxLayout.HORIZONTAL ? components.size() : 1;
35         final int border = layout.getBorder();
36
37         printLayouterTableHeader(d, "SBoxLayout", layout.getHgap(), layout.getVgap(), border, layout);
38
39         printLayouterTableBody(d, cols, false, layout.getHgap(), layout.getVgap(), border, components);
40
41         printLayouterTableFooter(d, "SBoxLayout", layout);
42
43     }
44 }
45
46
47
Popular Tags