KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > fop > fo > flow > InlineLevel


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: InlineLevel.java 474225 2006-11-13 10:08:19Z jeremias $ */
19
20 package org.apache.fop.fo.flow;
21
22 import java.awt.Color JavaDoc;
23
24 import org.apache.fop.apps.FOPException;
25 import org.apache.fop.fo.FONode;
26 import org.apache.fop.fo.FObjMixed;
27 import org.apache.fop.fo.PropertyList;
28 import org.apache.fop.fo.properties.CommonAccessibility;
29 import org.apache.fop.fo.properties.CommonAural;
30 import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
31 import org.apache.fop.fo.properties.CommonFont;
32 import org.apache.fop.fo.properties.CommonMarginInline;
33 import org.apache.fop.fo.properties.SpaceProperty;
34
35 /**
36  * Class modelling the commonalities of several inline-level
37  * formatting objects.
38  */

39 public abstract class InlineLevel extends FObjMixed {
40     
41     // The value of properties relevant for inline-level FOs.
42
protected CommonBorderPaddingBackground commonBorderPaddingBackground;
43     protected CommonAccessibility commonAccessibility;
44     protected CommonMarginInline commonMarginInline;
45     protected CommonAural commonAural;
46     protected CommonFont commonFont;
47     protected Color JavaDoc color;
48     protected SpaceProperty lineHeight;
49     protected int visibility;
50     // End of property values
51

52     /**
53      * @param parent FONode that is the parent of this object
54      */

55     protected InlineLevel(FONode parent) {
56         super(parent);
57     }
58
59     /**
60      * @see org.apache.fop.fo.FObj#bind(PropertyList)
61      */

62     public void bind(PropertyList pList) throws FOPException {
63         commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps();
64         commonAccessibility = pList.getAccessibilityProps();
65         commonMarginInline = pList.getMarginInlineProps();
66         commonAural = pList.getAuralProps();
67         commonFont = pList.getFontProps();
68         color = pList.get(PR_COLOR).getColor(getUserAgent());
69         lineHeight = pList.get(PR_LINE_HEIGHT).getSpace();
70         visibility = pList.get(PR_VISIBILITY).getEnum();
71     }
72
73     /**
74      * @return the Common Margin Properties-Inline.
75      */

76     public CommonMarginInline getCommonMarginInline() {
77         return commonMarginInline;
78     }
79
80     /**
81      * @return the Common Border, Padding, and Background Properties.
82      */

83     public CommonBorderPaddingBackground getCommonBorderPaddingBackground() {
84         return commonBorderPaddingBackground;
85     }
86
87     /**
88      * @return the Common Font Properties.
89      */

90     public CommonFont getCommonFont() {
91         return commonFont;
92     }
93
94     /**
95      * @return the "color" property.
96      */

97     public Color JavaDoc getColor() {
98         return color;
99     }
100
101     /**
102      * @return the "line-height" property
103      */

104     public SpaceProperty getLineHeight() {
105         return lineHeight;
106     }
107     
108 }
109
110
Popular Tags