01: package org.osbl.client.wings.form.layouter;
02:
03: import org.wings.SContainer;
04: import org.osbl.client.wings.form.ComponentProvider;
05:
06: import java.util.*;
07:
08: /**
09: * Arranges Lines.
10: */
11: public class Column implements Instruction {
12: public String titleCode;
13: public double weight = 0d;
14: public List<Line> lines;
15:
16: /**
17: * Construct a structural description of a Column.
18: * @param lines the lines arrange in the column
19: */
20: public Column(Line... lines) {
21: this .lines = new ArrayList<Line>(Arrays.asList(lines));
22: }
23:
24: /**
25: * Construct a structural description of a Column.
26: * @param titleCode the column title
27: * @param lines the lines arrange in the column
28: */
29: public Column(String titleCode, Line... lines) {
30: this .titleCode = titleCode;
31: this .lines = new ArrayList<Line>(Arrays.asList(lines));
32: }
33:
34: /**
35: * Construct a structural description of a Column.
36: * @param titleCode the column title
37: * @param weight how much of the available horizontal space should the column span
38: * @param lines the lines arrange in the column
39: */
40: public Column(String titleCode, double weight, Line... lines) {
41: this .titleCode = titleCode;
42: this .weight = weight;
43: this .lines = new ArrayList<Line>(Arrays.asList(lines));
44: }
45:
46: /**
47: * Construct a structural description of a Column.
48: * @param weight how much of the available horizontal space should the column span
49: * @param lines the lines arrange in the column
50: */
51: public Column(double weight, Line... lines) {
52: this .weight = weight;
53: this .lines = new ArrayList<Line>(Arrays.asList(lines));
54: }
55:
56: public void build(ComponentProvider componentProvider,
57: SContainer container) {
58: //container.setBackground(Color.yellow);
59: for (Line line : lines)
60: line.build(componentProvider, container);
61: }
62:
63: public void follow(Builder builder) {
64: for (Line line : lines)
65: builder.build(line);
66: }
67: }
|