aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache/fop/area/BlockParent.java
blob: 90f494e2722159c62a59164432487447ea151cb1 (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
/*
 * $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;
import java.awt.geom.Rectangle2D;

/**
 * A BlockParent holds block-level areas.
 */
public class BlockParent extends Area implements Serializable {

    // this position is used for absolute position
    // or as an indent
    // this has the size in the block progression dimension
    protected int xOffset = 0;
    protected int yOffset = 0;
    protected int width = 0;
    protected int height = 0;

    ArrayList children = null;

    // orientation if reference area
    int orientation = ORIENT_0;

    public void addBlock(Block block) {
        if (children == null) {
            children = new ArrayList();
        }
        children.add(block);
    }

    public List getChildAreas() {
        return children;
    }

    public void setXOffset(int off) {
        xOffset = off;
    }

    public void setYOffset(int off) {
        yOffset = off;
    }

    public void setWidth(int w) {
        width = w;
    }

    public void setHeight(int h) {
        height = h;
    }

    public int getXOffset() {
        return xOffset;
    }

    public int getYOffset() {
        return yOffset;
    }

    public int getWidth() {
        return width;
    }

    public int getHeight() {
        return height;
    }

}