001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017:
018: /* $Id: InlineLevel.java 554094 2007-07-07 00:04:25Z adelmelle $ */
019:
020: package org.apache.fop.fo.flow;
021:
022: import java.awt.Color;
023:
024: import org.apache.fop.apps.FOPException;
025: import org.apache.fop.fo.FONode;
026: import org.apache.fop.fo.FObjMixed;
027: import org.apache.fop.fo.PropertyList;
028: import org.apache.fop.fo.properties.CommonAccessibility;
029: import org.apache.fop.fo.properties.CommonAural;
030: import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
031: import org.apache.fop.fo.properties.CommonFont;
032: import org.apache.fop.fo.properties.CommonMarginInline;
033: import org.apache.fop.fo.properties.SpaceProperty;
034:
035: /**
036: * Class modelling the commonalities of several inline-level
037: * formatting objects.
038: */
039: public abstract class InlineLevel extends FObjMixed {
040:
041: // The value of properties relevant for inline-level FOs.
042: protected CommonBorderPaddingBackground commonBorderPaddingBackground;
043: protected CommonAccessibility commonAccessibility;
044: protected CommonMarginInline commonMarginInline;
045: protected CommonAural commonAural;
046: protected CommonFont commonFont;
047: protected Color color;
048: protected SpaceProperty lineHeight;
049: protected int visibility;
050:
051: // End of property values
052:
053: /**
054: * @param parent FONode that is the parent of this object
055: */
056: protected InlineLevel(FONode parent) {
057: super (parent);
058: }
059:
060: /**
061: * @see org.apache.fop.fo.FObj#bind(PropertyList)
062: */
063: public void bind(PropertyList pList) throws FOPException {
064: super .bind(pList);
065: commonBorderPaddingBackground = pList
066: .getBorderPaddingBackgroundProps();
067: commonAccessibility = pList.getAccessibilityProps();
068: commonMarginInline = pList.getMarginInlineProps();
069: commonAural = pList.getAuralProps();
070: commonFont = pList.getFontProps();
071: color = pList.get(PR_COLOR).getColor(getUserAgent());
072: lineHeight = pList.get(PR_LINE_HEIGHT).getSpace();
073: visibility = pList.get(PR_VISIBILITY).getEnum();
074: }
075:
076: /**
077: * @return the Common Margin Properties-Inline.
078: */
079: public CommonMarginInline getCommonMarginInline() {
080: return commonMarginInline;
081: }
082:
083: /**
084: * @return the Common Border, Padding, and Background Properties.
085: */
086: public CommonBorderPaddingBackground getCommonBorderPaddingBackground() {
087: return commonBorderPaddingBackground;
088: }
089:
090: /**
091: * @return the Common Font Properties.
092: */
093: public CommonFont getCommonFont() {
094: return commonFont;
095: }
096:
097: /**
098: * @return the "color" property.
099: */
100: public Color getColor() {
101: return color;
102: }
103:
104: /**
105: * @return the "line-height" property
106: */
107: public SpaceProperty getLineHeight() {
108: return lineHeight;
109: }
110:
111: }
|