01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * 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: Float.java 554104 2007-07-07 01:07:10Z adelmelle $ */
19:
20: package org.apache.fop.fo.flow;
21:
22: // XML
23: import org.xml.sax.Locator;
24:
25: import org.apache.fop.apps.FOPException;
26: import org.apache.fop.fo.FONode;
27: import org.apache.fop.fo.FObj;
28: import org.apache.fop.fo.PropertyList;
29: import org.apache.fop.fo.ValidationException;
30:
31: /**
32: * fo:float element.
33: */
34: public class Float extends FObj {
35: // The value of properties relevant for fo:float (commented out for performance.
36: // private int float_;
37: // private int clear;
38: // End of property values
39:
40: static boolean notImplementedWarningGiven = false;
41:
42: /**
43: * @see org.apache.fop.fo.FONode#FONode(FONode)
44: */
45: public Float(FONode parent) {
46: super (parent);
47:
48: if (!notImplementedWarningGiven) {
49: log.warn("fo:float is not yet implemented.");
50: notImplementedWarningGiven = true;
51: }
52: }
53:
54: /**
55: * @see org.apache.fop.fo.FObj#bind(PropertyList)
56: */
57: public void bind(PropertyList pList) throws FOPException {
58: // No active properties -> Nothing to do.
59: }
60:
61: /**
62: * @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
63: * XSL Content Model: (%block;)+
64: */
65: protected void validateChildNode(Locator loc, String nsURI,
66: String localName) throws ValidationException {
67: if (!isBlockItem(nsURI, localName)) {
68: invalidChildError(loc, nsURI, localName);
69: }
70: }
71:
72: /**
73: * Make sure content model satisfied, if so then tell the
74: * FOEventHandler that we are at the end of the flow.
75: * @see org.apache.fop.fo.FONode#endOfNode
76: */
77: protected void endOfNode() throws FOPException {
78: if (firstChild == null) {
79: missingChildElementError("(%block;)+");
80: }
81: }
82:
83: /** @see org.apache.fop.fo.FONode#getLocalName() */
84: public String getLocalName() {
85: return "float";
86: }
87:
88: /**
89: * @see org.apache.fop.fo.FObj#getNameId()
90: */
91: public int getNameId() {
92: return FO_FLOAT;
93: }
94: }
|