KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > joshy > html > box > InlineBox


1 package org.joshy.html.box;
2
3 import org.w3c.dom.Node JavaDoc;
4 import java.awt.Font JavaDoc;
5
6 public class InlineBox extends Box{
7     // if we are an inline block, then this is
8
// the reference to the real block inside
9
public BlockBox sub_block = null;
10     public boolean replaced = false;
11     
12     // line breaking stuff
13
public boolean break_after = false;
14     public boolean break_before = false;
15     
16     // decoration stuff
17
public boolean underline = false;
18     public boolean strikethrough = false;
19     public boolean overline = false;
20     
21     // vertical alignment stuff
22
public int baseline;
23     public int lineheight;
24     public boolean vset = false;
25     public boolean top_align = false;
26     public boolean bottom_align = false;
27     public boolean is_break = false;
28     
29     // text stuff
30
public int start_index = -1;
31     public int end_index = -1;
32     public String JavaDoc text;
33     
34     public String JavaDoc getSubstring() {
35         String JavaDoc txt = text.substring(start_index,end_index);
36         return txt;
37     }
38     
39     private Font JavaDoc font;
40     public void setFont(Font JavaDoc font) {
41         this.font = font;
42     }
43     public Font JavaDoc getFont() {
44         return font;
45     }
46
47     public String JavaDoc getText() {
48         return this.text;
49     }
50     public void setText(String JavaDoc text) {
51         this.text = text;
52     }
53     
54     public String JavaDoc toString() {
55         return "InlineBox text = \"" + getText() +
56             "\" bnds = " + x + "," + y + " - " + width + "x"+height +
57             " start = " + this.start_index + " end = " + this.end_index +
58             " baseline = " + this.baseline + " vset = " + this.vset;
59     }
60 }
61
62
Popular Tags