|
|
@@ -35,7 +35,8 @@ import org.apache.fop.fo.properties.KeepProperty; |
|
|
|
import org.apache.fop.fo.properties.LengthRangeProperty; |
|
|
|
|
|
|
|
/** |
|
|
|
* Class modelling the fo:block-container object. |
|
|
|
* Class modelling the <a href="http://www.w3.org/TR/xsl/#fo_block-container"> |
|
|
|
* <code>fo:block-container</code></a> object. |
|
|
|
*/ |
|
|
|
public class BlockContainer extends FObj { |
|
|
|
// The value of properties relevant for fo:block-container. |
|
|
@@ -66,15 +67,16 @@ public class BlockContainer extends FObj { |
|
|
|
private boolean blockItemFound = false; |
|
|
|
|
|
|
|
/** |
|
|
|
* @param parent FONode that is the parent of this object |
|
|
|
* Creates a new BlockContainer instance as a child of |
|
|
|
* the given {@link FONode}. |
|
|
|
* |
|
|
|
* @param parent {@link FONode} that is the parent of this object |
|
|
|
*/ |
|
|
|
public BlockContainer(FONode parent) { |
|
|
|
super(parent); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* {@inheritDoc} |
|
|
|
*/ |
|
|
|
/** {@inheritDoc} */ |
|
|
|
public void bind(PropertyList pList) throws FOPException { |
|
|
|
super.bind(pList); |
|
|
|
commonAbsolutePosition = pList.getAbsolutePositionProps(); |
|
|
@@ -97,9 +99,7 @@ public class BlockContainer extends FObj { |
|
|
|
writingMode = pList.get(PR_WRITING_MODE).getEnum(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* {@inheritDoc} |
|
|
|
*/ |
|
|
|
/** {@inheritDoc} */ |
|
|
|
protected void startOfNode() throws FOPException { |
|
|
|
super.startOfNode(); |
|
|
|
getFOEventHandler().startBlockContainer(this); |
|
|
@@ -107,30 +107,34 @@ public class BlockContainer extends FObj { |
|
|
|
|
|
|
|
/** |
|
|
|
* {@inheritDoc} |
|
|
|
* XSL Content Model: marker* (%block;)+ |
|
|
|
* But: "In addition an fo:block-container that does not generate an |
|
|
|
* <br>XSL Content Model: marker* (%block;)+ |
|
|
|
* <br><i><b>BUT</b>: "In addition an fo:block-container that does not generate an |
|
|
|
* absolutely positioned area may have a sequence of zero or more |
|
|
|
* fo:markers as its initial children." |
|
|
|
* @todo - implement above restriction if possible |
|
|
|
* The latter refers to block-containers with absolute-position="absolute" |
|
|
|
* or absolute-position="fixed". |
|
|
|
*/ |
|
|
|
protected void validateChildNode(Locator loc, String nsURI, String localName) |
|
|
|
throws ValidationException { |
|
|
|
throws ValidationException { |
|
|
|
if (FO_URI.equals(nsURI)) { |
|
|
|
if (localName.equals("marker")) { |
|
|
|
if ("marker".equals(localName)) { |
|
|
|
if (commonAbsolutePosition.absolutePosition == EN_ABSOLUTE |
|
|
|
|| commonAbsolutePosition.absolutePosition == EN_FIXED) { |
|
|
|
getFOValidationEventProducer() |
|
|
|
.markerBlockContainerAbsolutePosition(this, locator); |
|
|
|
} |
|
|
|
if (blockItemFound) { |
|
|
|
nodesOutOfOrderError(loc, "fo:marker", "(%block;)"); |
|
|
|
} |
|
|
|
} else if (!isBlockItem(nsURI, localName)) { |
|
|
|
invalidChildError(loc, nsURI, localName); |
|
|
|
} else if (!isBlockItem(FO_URI, localName)) { |
|
|
|
invalidChildError(loc, FO_URI, localName); |
|
|
|
} else { |
|
|
|
blockItemFound = true; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* {@inheritDoc} |
|
|
|
*/ |
|
|
|
/** {@inheritDoc} */ |
|
|
|
protected void endOfNode() throws FOPException { |
|
|
|
if (!blockItemFound) { |
|
|
|
missingChildElementError("marker* (%block;)+"); |
|
|
@@ -139,30 +143,22 @@ public class BlockContainer extends FObj { |
|
|
|
getFOEventHandler().endBlockContainer(this); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @return true (BlockContainer can generate Reference Areas) |
|
|
|
*/ |
|
|
|
/** @return <code>true</code> (BlockContainer can generate Reference Areas) */ |
|
|
|
public boolean generatesReferenceAreas() { |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @return the Common Absolute Position Properties. |
|
|
|
*/ |
|
|
|
/** @return the {@link CommonAbsolutePosition} */ |
|
|
|
public CommonAbsolutePosition getCommonAbsolutePosition() { |
|
|
|
return commonAbsolutePosition; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @return the Common Margin Properties-Block. |
|
|
|
*/ |
|
|
|
/** @return the {@link CommonMarginBlock} */ |
|
|
|
public CommonMarginBlock getCommonMarginBlock() { |
|
|
|
return commonMarginBlock; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @return the Common Border, Padding, and Background Properties. |
|
|
|
*/ |
|
|
|
/** @return the {@link CommonBorderPaddingBackground} */ |
|
|
|
public CommonBorderPaddingBackground getCommonBorderPaddingBackground() { |
|
|
|
return commonBorderPaddingBackground; |
|
|
|
} |
|
|
@@ -174,7 +170,7 @@ public class BlockContainer extends FObj { |
|
|
|
return blockProgressionDimension; |
|
|
|
} |
|
|
|
|
|
|
|
/** @return the display-align property. */ |
|
|
|
/** @return the "display-align" property. */ |
|
|
|
public int getDisplayAlign() { |
|
|
|
return displayAlign; |
|
|
|
} |
|
|
@@ -204,51 +200,37 @@ public class BlockContainer extends FObj { |
|
|
|
return keepTogether; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @return the "inline-progression-dimension" property. |
|
|
|
*/ |
|
|
|
/** @return the "inline-progression-dimension" property */ |
|
|
|
public LengthRangeProperty getInlineProgressionDimension() { |
|
|
|
return inlineProgressionDimension; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @return the "overflow" property. |
|
|
|
*/ |
|
|
|
/** @return the "overflow" property */ |
|
|
|
public int getOverflow() { |
|
|
|
return overflow; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @return the "reference-orientation" property. |
|
|
|
*/ |
|
|
|
/** @return the "reference-orientation" property */ |
|
|
|
public int getReferenceOrientation() { |
|
|
|
return referenceOrientation.getValue(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @return the "span" property. |
|
|
|
*/ |
|
|
|
/** @return the "span" property */ |
|
|
|
public int getSpan() { |
|
|
|
return this.span; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @return the "writing-mode" property. |
|
|
|
*/ |
|
|
|
/** @return the "writing-mode" property */ |
|
|
|
public int getWritingMode() { |
|
|
|
return writingMode; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @return the width property |
|
|
|
*/ |
|
|
|
/** @return the "width" property */ |
|
|
|
public Length getWidth() { |
|
|
|
return width; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @return the height property |
|
|
|
*/ |
|
|
|
/** @return the "height" property */ |
|
|
|
public Length getHeight() { |
|
|
|
return height; |
|
|
|
} |
|
|
@@ -260,6 +242,7 @@ public class BlockContainer extends FObj { |
|
|
|
|
|
|
|
/** |
|
|
|
* {@inheritDoc} |
|
|
|
* @return {@link org.apache.fop.fo.Constants#FO_BLOCK_CONTAINER} |
|
|
|
*/ |
|
|
|
public int getNameId() { |
|
|
|
return FO_BLOCK_CONTAINER; |