aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache/fop/area/MainReference.java
blob: b1840199575d0cbb0ce9d24525cce45ccb07a475 (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
/*
 * $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.io.Serializable;
import java.util.ArrayList;
import java.util.List;

// the area that contains the flow via the span areas
public class MainReference extends Area implements Serializable {
    List spanAreas = new ArrayList();
    int columnGap;
    int width;

    public void addSpan(Span span) {
        spanAreas.add(span);
	span.setParent(this);
    }

    public List getSpans() {
        return spanAreas;
    }

    public int getColumnGap() {
        return columnGap;
    }

    public int getWidth() {
        return width;
    }

    public MinOptMax getMaxBPD() {
	MinOptMax maxbpd = parent.getMaxBPD();
	BodyRegion body = (BodyRegion)parent;
	Area a =  body.getBeforeFloat();
	if (a != null) {
	    maxbpd = MinOptMax.subtract(maxbpd, a.getContentBPD());
	}
	if ((a=body.getFootnote()) != null) {
	    maxbpd = MinOptMax.subtract(maxbpd, a.getContentBPD());
	}
	return maxbpd;
    }
}