aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache/fop/area/Page.java
blob: e8b1bfd62b412eb0ffe1ca28fd633608bd82b55a (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;

public class Page implements Serializable {
    // contains before, start, body, end and after regions
    RegionViewport regionBefore = null;
    RegionViewport regionStart = null;
    RegionViewport regionBody = null;
    RegionViewport regionEnd = null;
    RegionViewport regionAfter = null;

    public void setRegion(int areaclass, RegionViewport port) {
        if (areaclass == Region.BEFORE) {
            regionBefore = port;
        } else if (areaclass == Region.START) {
            regionStart = port;
        } else if (areaclass == Region.BODY) {
            regionBody = port;
        } else if (areaclass == Region.END) {
            regionEnd = port;
        } else if (areaclass == Region.AFTER) {
            regionAfter = port;
        }
    }

    public RegionViewport getRegion(int areaclass) {
        if (areaclass == Region.BEFORE) {
            return regionBefore;
        } else if (areaclass == Region.START) {
            return regionStart;
        } else if (areaclass == Region.BODY) {
            return regionBody;
        } else if (areaclass == Region.END) {
            return regionEnd;
        } else if (areaclass == Region.AFTER) {
            return regionAfter;
        }
        return null;
    }

}