KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > fop > fo > properties > CommonAbsolutePosition


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * 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) throws PropertyException {
63         absolutePosition = pList.get(Constants.PR_ABSOLUTE_POSITION).getEnum();
64         top = pList.get(Constants.PR_TOP).getLength();
65         bottom = pList.get(Constants.PR_BOTTOM).getLength();
66         left = pList.get(Constants.PR_LEFT).getLength();
67         right = pList.get(Constants.PR_RIGHT).getLength();
68     }
69     
70     public String JavaDoc toString() {
71         StringBuffer JavaDoc sb = new StringBuffer JavaDoc("CommonAbsolutePosition{");
72         sb.append(" absPos=");
73         sb.append(absolutePosition);
74         sb.append(" top=");
75         sb.append(top);
76         sb.append(" bottom=");
77         sb.append(bottom);
78         sb.append(" left=");
79         sb.append(left);
80         sb.append(" right=");
81         sb.append(right);
82         sb.append("}");
83         return sb.toString();
84     }
85 }
86
Popular Tags