KickJava   Java API By Example, From Geeks To Geeks.

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


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: CommonRelativePosition.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 relative position properties.
29  * See Sec 7.12 of the XSL-FO Standard.
30  * Public "structure" allows direct member access.
31  */

32 public class CommonRelativePosition {
33     /**
34      * The "relative-position" property.
35      */

36     public int relativePosition;
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 CommonRelativePosition object.
60      * @param pList The PropertyList with propery values.
61      */

62     public CommonRelativePosition(PropertyList pList) throws PropertyException {
63         relativePosition = pList.get(Constants.PR_RELATIVE_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 }
71
Popular Tags