KickJava   Java API By Example, From Geeks To Geeks.

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


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: CommonMarginInline.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 margin properties for inlines.
29  * See Sec. 7.11 of the XSL-FO Standard.
30  * Public "structure" allows direct member access.
31  */

32 public class CommonMarginInline {
33
34     /**
35      * The "margin-top" property.
36      */

37     public Length marginTop;
38
39     /**
40      * The "margin-bottom" property.
41      */

42     public Length marginBottom;
43
44     /**
45      * The "margin-left" property.
46      */

47     public Length marginLeft;
48
49     /**
50      * The "margin-right" property.
51      */

52     public Length marginRight;
53
54     /**
55      * The "space-start" property.
56      */

57     public SpaceProperty spaceStart;
58
59     /**
60      * The "space-end" property.
61      */

62     public SpaceProperty spaceEnd;
63
64     /**
65      * Create a CommonMarginInline object.
66      * @param pList The PropertyList with propery values.
67      */

68     public CommonMarginInline(PropertyList pList) throws PropertyException {
69         marginTop = pList.get(Constants.PR_MARGIN_TOP).getLength();
70         marginBottom = pList.get(Constants.PR_MARGIN_BOTTOM).getLength();
71         marginLeft = pList.get(Constants.PR_MARGIN_LEFT).getLength();
72         marginRight = pList.get(Constants.PR_MARGIN_RIGHT).getLength();
73
74         spaceStart = pList.get(Constants.PR_SPACE_START).getSpace();
75         spaceEnd = pList.get(Constants.PR_SPACE_END).getSpace();
76     }
77 }
78
Popular Tags