01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: /* $Id: CommonAbsolutePosition.java 426576 2006-07-28 15:44:37Z jeremias $ */
19:
20: package org.apache.fop.fo.properties;
21:
22: import org.apache.fop.datatypes.Length;
23: import org.apache.fop.fo.Constants;
24: import org.apache.fop.fo.PropertyList;
25: import org.apache.fop.fo.expr.PropertyException;
26:
27: /**
28: * Store all common absolute position properties.
29: * See Sec. 7.5 of the XSL-FO Standard.
30: * Public "structure" allows direct member access.
31: */
32: public class CommonAbsolutePosition {
33: /**
34: * The "absolute-position" property.
35: */
36: public int absolutePosition;
37:
38: /**
39: * The "top" property.
40: */
41: public Length top;
42:
43: /**
44: * The "right" property.
45: */
46: public Length right;
47:
48: /**
49: * The "bottom" property.
50: */
51: public Length bottom;
52:
53: /**
54: * The "left" property.
55: */
56: public Length left;
57:
58: /**
59: * Create a CommonAbsolutePosition object.
60: * @param pList The PropertyList with propery values.
61: */
62: public CommonAbsolutePosition(PropertyList pList)
63: throws PropertyException {
64: absolutePosition = pList.get(Constants.PR_ABSOLUTE_POSITION)
65: .getEnum();
66: top = pList.get(Constants.PR_TOP).getLength();
67: bottom = pList.get(Constants.PR_BOTTOM).getLength();
68: left = pList.get(Constants.PR_LEFT).getLength();
69: right = pList.get(Constants.PR_RIGHT).getLength();
70: }
71:
72: public String toString() {
73: StringBuffer sb = new StringBuffer("CommonAbsolutePosition{");
74: sb.append(" absPos=");
75: sb.append(absolutePosition);
76: sb.append(" top=");
77: sb.append(top);
78: sb.append(" bottom=");
79: sb.append(bottom);
80: sb.append(" left=");
81: sb.append(left);
82: sb.append(" right=");
83: sb.append(right);
84: sb.append("}");
85: return sb.toString();
86: }
87: }
|