blob: c97f858555ee9632d7dc7cca3f2e627952b850de (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
/*
* $Id$
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
*/
package org.apache.fop.layoutmgr;
import org.apache.fop.fo.FObj;
import org.apache.fop.area.Area;
import org.apache.fop.area.inline.InlineArea;
/**
* Base LayoutManager for leaf-node FObj, ie: ones which have no children.
* These are all inline objects. Most of them cannot be split (Text is
* an exception to this rule.)
*/
public class LeafNodeLayoutManager extends AbstractLayoutManager {
private InlineArea curArea = null;
public LeafNodeLayoutManager(FObj fobj) {
super(fobj);
}
public int size() {
return 1;
}
public InlineArea get(int index) {
if(index > 0)
return null;
return curArea;
}
public boolean generatesInlineAreas() {
return true;
}
public boolean resolved() {
return false;
}
public void setCurrentArea(InlineArea ia) {
curArea = ia;
}
public boolean generateAreas() {
return flush();
}
protected boolean flush() {
return false;
}
/**
* This is a leaf-node, so this method is never called.
*/
public boolean addChild(Area childArea) {return false;}
/**
* This is a leaf-node, so this method is never called.
*/
public Area getParentArea(Area childArea) {
return null;
}
}
|