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: InitialPropertySet.java 554094 2007-07-07 00:04:25Z adelmelle $ */
019:
020: package org.apache.fop.fo.flow;
021:
022: // XML
023: import java.awt.Color;
024:
025: import org.xml.sax.Locator;
026:
027: import org.apache.fop.apps.FOPException;
028: import org.apache.fop.fo.FONode;
029: import org.apache.fop.fo.FObj;
030: import org.apache.fop.fo.PropertyList;
031: import org.apache.fop.fo.ValidationException;
032: import org.apache.fop.fo.properties.CommonAccessibility;
033: import org.apache.fop.fo.properties.CommonAural;
034: import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
035: import org.apache.fop.fo.properties.CommonFont;
036: import org.apache.fop.fo.properties.CommonRelativePosition;
037: import org.apache.fop.fo.properties.SpaceProperty;
038:
039: /**
040: * Class modelling the fo:initial-property-set object.
041: */
042: public class InitialPropertySet extends FObj {
043: // The value of properties relevant for fo:initial-property-set.
044: private String id;
045: // private ToBeImplementedProperty letterSpacing;
046: private SpaceProperty lineHeight;
047:
048: // private ToBeImplementedProperty textShadow;
049: // Unused but valid items, commented out for performance:
050: // private CommonAccessibility commonAccessibility;
051: // private CommonAural commonAural;
052: // private CommonBorderPaddingBackground commonBorderPaddingBackground;
053: // private CommonFont commonFont;
054: // private CommonRelativePosition commonRelativePosition;
055: // private Color color;
056: // private int scoreSpaces;
057: // private int textDecoration;
058: // private int textTransform;
059: // private SpaceProperty wordSpacing;
060: // End of property values
061:
062: /**
063: * @param parent FONode that is the parent of this object
064: */
065: public InitialPropertySet(FONode parent) {
066: super (parent);
067: }
068:
069: /**
070: * @see org.apache.fop.fo.FObj#bind(PropertyList)
071: */
072: public void bind(PropertyList pList) throws FOPException {
073: super .bind(pList);
074: // letterSpacing = pList.get(PR_LETTER_SPACING);
075: lineHeight = pList.get(PR_LINE_HEIGHT).getSpace();
076: // textShadow = pList.get(PR_TEXT_SHADOW);
077: }
078:
079: /**
080: * @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
081: * XSL Content Model: empty
082: */
083: protected void validateChildNode(Locator loc, String nsURI,
084: String localName) throws ValidationException {
085: invalidChildError(loc, nsURI, localName);
086: }
087:
088: /**
089: * @return the "line-height" property.
090: */
091: public SpaceProperty getLineHeight() {
092: return lineHeight;
093: }
094:
095: /** @see org.apache.fop.fo.FONode#getLocalName() */
096: public String getLocalName() {
097: return "initial-property-set";
098: }
099:
100: /**
101: * @see org.apache.fop.fo.FObj#getNameId()
102: */
103: public int getNameId() {
104: return FO_INITIAL_PROPERTY_SET;
105: }
106: }
|