// to the Title.
InlineStackingLayoutManager lm;
lm = new InlineStackingLayoutManager(foTitle);
- lm.setLMiter(new LMiter(lm, foTitle.childNodes.listIterator()));
+ lm.setLMiter(new LMiter(lm, foTitle.getChildNodes()));
lm.initialize();
// get breaks then add areas to title
/**
* Helper method to quickly obtain the value of a property
* for this FO, without querying for the propertyList first.
- * @param name - the name of the desired property to obtain
+ * @param propId - the Constants ID of the desired property to obtain
* @return the property
*/
public Property getProperty(int propId) {
return propertyList.get(propId);
}
+ /**
+ * Helper method to quickly obtain the String value of a property
+ * for this FO, without querying for the propertyList first.
+ * Meaningful only for properties having a string representation
+ * @param propId - the Constants ID of the desired property to obtain
+ * @return the String value of the property value
+ */
+ public String getPropString(int propId) {
+ return propertyList.get(propId).getString();
+ }
+
/**
* @see org.apache.fop.fo.FONode#addChildNode(FONode)
*/
* @param marker Marker to add.
*/
protected void addMarker(Marker marker) {
- String mcname = marker.getMarkerClassName();
+ String mcname = marker.getPropString(PR_MARKER_CLASS_NAME);
if (childNodes != null) {
// check for empty childNodes
for (Iterator iter = childNodes.iterator(); iter.hasNext();) {
// FOP
import org.apache.fop.fo.FONode;
-import org.apache.fop.fo.ToBeImplementedElement;
+import org.apache.fop.fo.FObj;
/**
* fo:float element.
*/
-public class Float extends ToBeImplementedElement {
+public class Float extends FObj {
+ static boolean notImplementedWarningGiven = false;
+
/**
* @see org.apache.fop.fo.FONode#FONode(FONode)
*/
public Float(FONode parent) {
super(parent);
+
+ if (!notImplementedWarningGiven) {
+ getLogger().warn("fo:float is not yet implemented.");
+ notImplementedWarningGiven = true;
+ }
}
/**
// XML
import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
import org.xml.sax.SAXParseException;
// FOP
/**
* Marker formatting object.
- * This is the marker formatting object that handles merkers.
- * This attempts to add itself to the parent formatting object.
*/
public class Marker extends FObjMixed {
- private String markerClassName;
-
/**
* Create a marker fo.
- *
* @param parent the parent fo node
*/
public Marker(FONode parent) {
*/
protected void addProperties(Attributes attlist) throws SAXParseException {
super.addProperties(attlist);
- this.markerClassName =
- this.propertyList.get(PR_MARKER_CLASS_NAME).getString();
}
/**
- * Get the marker class name for this marker.
- *
- * @return the marker class name
+ * @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
+ * XSL Content Model: (#PCDATA|%inline;|%block;)*
+ * Additionally: "An fo:marker may contain any formatting objects that
+ * are permitted as a replacement of any fo:retrieve-marker that retrieves
+ * the fo:marker's children."
+ * @todo implement "additional" constraint, possibly within fo:retrieve-marker
*/
- public String getMarkerClassName() {
- return markerClassName;
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
+ throws SAXParseException {
+ if (!isBlockOrInlineItem(nsURI, localName)) {
+ invalidChildError(loc, nsURI, localName);
+ }
}
+ /**
+ * @see org.apache.fop.fo.FObj#getName()
+ */
public String getName() {
return "fo:marker";
}
}
public Column getTableColumnLayoutManager(TableColumn node) {
- node.initialize();
Column clm = new Column(node);
return clm;
}
return blm;
}
+ /**
+ * @see org.apache.fop.fo.FObj#getName()
+ */
public String getName() {
return "fo:table";
}
public class TableColumn extends FObj {
private ColorType backgroundColor;
-
private Length columnWidth;
private int columnOffset;
private int numColumnsRepeated;
private int iColumnNumber;
- private boolean initialized = false;
-
/**
* @param parent FONode that is the parent of this object
*/
}
/**
- * @see org.apache.fop.fo.FObj#addProperties
+ * @see org.apache.fop.fo.FObj#addProperties(Attributes)
*/
protected void addProperties(Attributes attlist) throws SAXParseException {
super.addProperties(attlist);
- initialize(); // init some basic property values
+
+ iColumnNumber = propertyList.get(PR_COLUMN_NUMBER).getNumber().intValue();
+ numColumnsRepeated =
+ propertyList.get(PR_NUMBER_COLUMNS_REPEATED).getNumber().intValue();
+ this.backgroundColor =
+ this.propertyList.get(PR_BACKGROUND_COLOR).getColorType();
+ columnWidth = this.propertyList.get(PR_COLUMN_WIDTH).getLength();
+
getFOInputHandler().startColumn(this);
}
+ /**
+ * @see org.apache.fop.fo.FONode#endOfNode
+ */
+ protected void endOfNode() throws SAXParseException {
+ getFOInputHandler().endColumn(this);
+ }
+
/**
* @return Length object containing column width
*/
return numColumnsRepeated;
}
- /**
- * @todo convert to addProperties()
- */
- public void initialize() {
- iColumnNumber = propertyList.get(PR_COLUMN_NUMBER).getNumber().intValue();
-
- numColumnsRepeated =
- propertyList.get(PR_NUMBER_COLUMNS_REPEATED).getNumber().intValue();
-
- this.backgroundColor =
- this.propertyList.get(PR_BACKGROUND_COLOR).getColorType();
-
- columnWidth = this.propertyList.get(PR_COLUMN_WIDTH).getLength();
-
- initialized = true;
- }
-
- protected void endOfNode() throws SAXParseException {
- getFOInputHandler().endColumn(this);
- }
-
public String getName() {
return "fo:table-column";
}