* @see org.apache.fop.fo.FObj#addLayoutManager(List)
*/
public void addLayoutManager(List list) {
- String str = getProperty(PR_CHARACTER).getString();
+ String str = getPropString(PR_CHARACTER);
if (str.length() == 1) {
CharacterLayoutManager lm = new CharacterLayoutManager(this);
list.add(lm);
* inline area that can be added to the area tree.
*/
public class ExternalGraphic extends FObj {
- private String url;
/**
* Create a new External graphic node.
*/
protected void addProperties(Attributes attlist) throws SAXParseException {
super.addProperties(attlist);
- url = this.propertyList.get(PR_SRC).getString();
getFOInputHandler().image(this);
}
- public String getURL() {
- return url;
- }
-
/**
* @see org.apache.fop.fo.FObj#addLayoutManager(List)
*/
public void addLayoutManager(List list) {
- if (getURL() != null) {
+ if (getPropString(PR_SRC) != null) {
ExternalGraphicLayoutManager lm = new ExternalGraphicLayoutManager(this);
list.add(lm);
}
super(parent);
}
+ /**
+ * @see org.apache.fop.fo.FObj#getName()
+ */
public String getName() {
return "fo:multi-case";
}
package org.apache.fop.fo.flow;
+// XML
+import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXParseException;
+
// FOP
import org.apache.fop.fo.FONode;
-import org.apache.fop.fo.ToBeImplementedElement;
+import org.apache.fop.fo.FObj;
/**
* Class modelling the fo:multi-properties object. See Sec. 6.9.6 of the XSL-FO
* Standard.
*/
-public class MultiProperties extends ToBeImplementedElement {
+public class MultiProperties extends FObj {
+
+ static boolean notImplementedWarningGiven = false;
+
+ // used for input FO validation
+ boolean hasMultiPropertySet = false;
+ boolean hasWrapper = false;
/**
* @param parent FONode that is the parent of this object
*/
public MultiProperties(FONode parent) {
super(parent);
+
+ if (!notImplementedWarningGiven) {
+ getLogger().warn("fo:multi-properties is not yet implemented.");
+ notImplementedWarningGiven = true;
+ }
+ }
+
+ /**
+ * @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
+ * XSL Content Model: (multi-property-set+, wrapper)
+ */
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
+ throws SAXParseException {
+ if (nsURI == FO_URI && localName.equals("multi-property-set")) {
+ if (hasWrapper) {
+ nodesOutOfOrderError(loc, "fo:multi-property-set", "fo:wrapper");
+ } else {
+ hasMultiPropertySet = true;
+ }
+ } else if (nsURI == FO_URI && localName.equals("wrapper")) {
+ if (hasWrapper) {
+ tooManyNodesError(loc, "fo:wrapper");
+ } else {
+ hasWrapper = true;
+ }
+ } else {
+ invalidChildError(loc, nsURI, localName);
+ }
}
+ /**
+ * Make sure content model satisfied, if so then tell the
+ * FOInputHandler that we are at the end of the flow.
+ * @see org.apache.fop.fo.FONode#end
+ */
+ protected void endOfNode() throws SAXParseException {
+ if (!hasMultiPropertySet || !hasWrapper) {
+ missingChildElementError("(multi-property-set+, wrapper)");
+ }
+ }
+
+ /**
+ * @see org.apache.fop.fo.FObj#getName()
+ */
public String getName() {
return "fo:multi-properties";
}
this.blue = c.getBlue();
this.wrapOption = this.propertyList.get(PR_WRAP_OPTION).getEnum();
- this.refId = this.propertyList.get(PR_REF_ID).getString();
+ this.refId = getPropString(PR_REF_ID);
if (this.refId.equals("")) {
//throw new FOPException("page-number-citation must contain \"ref-id\"");
*/
protected void addProperties(Attributes attlist) throws SAXParseException {
super.addProperties(attlist);
- this.retrieveClassName =
- this.propertyList.get(PR_RETRIEVE_CLASS_NAME).getString();
+ this.retrieveClassName = getPropString(PR_RETRIEVE_CLASS_NAME);
this.retrievePosition =
this.propertyList.get(PR_RETRIEVE_POSITION).getEnum();
this.retrieveBoundary =
// we are now on the first page of the page sequence
thisIsFirstPage = true;
- ipnValue = this.propertyList.get(PR_INITIAL_PAGE_NUMBER).getString();
+ ipnValue = getPropString(PR_INITIAL_PAGE_NUMBER);
if (ipnValue.equals("auto")) {
pageNumberType = AUTO;
}
}
- String masterName = this.propertyList.get(PR_MASTER_REFERENCE).getString();
+ String masterName = getPropString(PR_MASTER_REFERENCE);
this.simplePageMaster =
this.layoutMasterSet.getSimplePageMaster(masterName);
if (this.simplePageMaster == null) {
subSequenceSpecifiers = new java.util.ArrayList();
if (parent.getName().equals("fo:layout-master-set")) {
this.layoutMasterSet = (LayoutMasterSet)parent;
- masterName = this.propertyList.get(Constants.PR_MASTER_NAME).getString();
+ masterName = getPropString(PR_MASTER_NAME);
if (masterName == null) {
getLogger().warn("page-sequence-master does not have "
+ "a master-name and so is being ignored");
*/
protected void addProperties(Attributes attlist) throws SAXParseException {
super.addProperties(attlist);
- String mr = getProperty(PR_MAXIMUM_REPEATS).getString();
+ String mr = getPropString(PR_MAXIMUM_REPEATS);
if (mr.equals("no-limit")) {
this.maximumRepeats = INFINITE;
} else {
* @todo see if can simplify property handling logic
*/
private void setup() {
- url = ImageFactory.getURL(graphic.getURL());
+ url = ImageFactory.getURL(graphic.getPropString(PR_SRC));
// assume lr-tb for now and just use the .optimum value of the range
Length ipd = graphic.getPropertyList().get(PR_INLINE_PROGRESSION_DIMENSION).
* @return the viewport containing the image area
*/
public InlineArea getExternalGraphicInlineArea() {
- Image imArea = new Image(graphic.getURL());
+ Image imArea = new Image(graphic.getPropString(PR_SRC));
Viewport vp = new Viewport(imArea);
vp.setWidth(viewWidth);
vp.setHeight(viewHeight);
public void startPageSequence(PageSequence pageSeq) {
// get the layout master set
// setup the pages for this sequence
- String name = pageSeq.getProperty(Constants.PR_MASTER_REFERENCE).getString();
+ String name = pageSeq.getPropString(Constants.PR_MASTER_REFERENCE);
SimplePageMaster spm = pageSeq.getLayoutMasterSet().getSimplePageMaster(name);
if (spm == null) {
PageSequenceMaster psm = pageSeq.getLayoutMasterSet().getPageSequenceMaster(name);