aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache/fop/area/BodyRegion.java
blob: f6f292683820d4524346c30a92b53f454c67867c (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
73
74
75
76
77
78
/*
 * $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.area;

import java.awt.geom.Rectangle2D;

public class BodyRegion extends RegionReference {
    BeforeFloat beforeFloat;
    MainReference mainReference;
    Footnote footnote;
    private int columnGap;
    private int columnCount;

    /** Maximum block progression dimension. Note: min=opt=max */
    private MinOptMax maxBPD;

    /** Referenc inline progression dimension for the body. */
    private int refIPD;

    public BodyRegion() {
        super(BODY);
    }

    // Number of columns when not spanning
    public void setColumnCount(int colCount) {
	this.columnCount = colCount;
    }

    // A length (mpoints)
    public void setColumnGap(int colGap) {
	this.columnGap = colGap;
    }

    public void setParent(Area area) {
	super.setParent(area);
	// Only if not scrolling or overflow !!!
	Rectangle2D refRect = ((RegionViewport)area).getViewArea();
	maxBPD = new MinOptMax((int)refRect.getHeight());
	refIPD = (int)refRect.getWidth();
    }

    public void setBeforeFloat(BeforeFloat bf) {
        beforeFloat = bf;
	beforeFloat.setParent(this);
    }

    public void setMainReference(MainReference mr) {
        mainReference = mr;
	mainReference.setParent(this);
    }

    public void setFootnote(Footnote foot) {
        footnote = foot;
	footnote.setParent(this);
    }


    public BeforeFloat getBeforeFloat() {
        return beforeFloat;
    }

    public MainReference getMainReference() {
        return mainReference;
    }

    public Footnote getFootnote() {
        return footnote;
    }

    public MinOptMax getMaxBPD() {
	return maxBPD;
    }
}