KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > joshy > html > AnonymousBoxLayout


1 package org.joshy.html;
2
3 import org.joshy.html.box.*;
4 import org.joshy.u;
5 import org.w3c.dom.*;
6
7 public class AnonymousBoxLayout extends InlineLayout {
8     public AnonymousBoxLayout() {
9     }
10     private Element parent;
11     private Node text;
12
13     // use the passed in 'text' since that's what we are
14
// really laying out instead of the 'node', which is really the
15
// parent element.
16
public Box createBox(Context c, Node node) {
17         AnonymousBlockBox block = new AnonymousBlockBox(text,c);
18         return block;
19     }
20     public void prepareBox(Box box, Context c) {
21
22         box.border = new Border();
23         box.padding = new Border();
24         box.margin = new Border();
25
26     }
27
28     public Box layout(Context c, Element parent, Node text) {
29         this.parent = parent;
30         this.text = text;
31         //Box box = new AnonymousBlockBox(text);
32
Box box = super.layout(c,parent);
33         //u.p("AnonymousBoxLayout.layout: returning: " + box);
34
return box;
35     }
36     public Box layoutChildren(Context c, Box box) {
37         //u.p("AnonymousBoxLayout.layoutChildren() noop" + box);
38
return super.layoutChildren(c,box);
39         //return box;
40
}
41
42 }
43
Popular Tags