for (Iterator regenum = spm.getRegions().values().iterator();
regenum.hasNext();) {
Region r = (Region)regenum.next();
- RegionViewport rvp = makeRegionViewport(r, reldims, pageCTM, spm);
+ RegionViewport rvp = makeRegionViewport(r, reldims, pageCTM);
if (r.getNameId() == Constants.FO_REGION_BODY) {
rr = new BodyRegion((RegionBody) r, rvp);
} else {
setRegionReferencePosition(rr, r, rvp.getViewArea());
rvp.setRegionReference(rr);
setRegionViewport(r.getNameId(), rvp);
- }
+ }
}
/**
* @param r the region the viewport is to be created for
* @param reldims relative dimensions
* @param pageCTM page coordinate transformation matrix
- * @param spm the simple-page-master for this page
* @return the new region viewport
*/
- private RegionViewport makeRegionViewport(Region r, FODimension reldims, CTM pageCTM,
- SimplePageMaster spm) {
- Rectangle2D relRegionRect = r.getViewportRectangle(reldims, spm);
+ private RegionViewport makeRegionViewport(Region r, FODimension reldims, CTM pageCTM) {
+ Rectangle2D relRegionRect = r.getViewportRectangle(reldims);
Rectangle2D absRegionRect = pageCTM.transform(relRegionRect);
// Get the region viewport rectangle in absolute coords by
// transforming it using the page CTM
private int writingMode;
// End of property values
- private SimplePageMaster layoutMaster;
+ protected final SimplePageMaster layoutMaster;
/**
* Base constructor
/**
* @param pageRefRect reference dimension of the page area.
- * @param spm the simple page master this region belongs to.
* @return the rectangle for the viewport area
*/
- public abstract Rectangle getViewportRectangle(FODimension pageRefRect
- , SimplePageMaster spm);
+ public abstract Rectangle getViewportRectangle(FODimension pageRefRect);
/**
* Returns the default region name (xsl-region-before, xsl-region-start,
}
/** {@inheritDoc} */
- public Rectangle getViewportRectangle (FODimension reldims, SimplePageMaster spm) {
+ public Rectangle getViewportRectangle (FODimension reldims) {
/* Special rules apply to resolving extent as values are resolved relative
* to the page size and reference orientation.
*/
PercentBaseContext pageHeightContext = getPageHeightContext(LengthBase.CUSTOM_BASE);
PercentBaseContext neighbourContext;
Rectangle vpRect;
- if (spm.getWritingMode() == EN_LR_TB || spm.getWritingMode() == EN_RL_TB) {
+ if (layoutMaster.getWritingMode() == EN_LR_TB
+ || layoutMaster.getWritingMode() == EN_RL_TB) {
neighbourContext = pageWidthContext;
vpRect = new Rectangle(0, reldims.bpd - getExtent().getValue(pageHeightContext)
, reldims.ipd, getExtent().getValue(pageHeightContext));
, getExtent().getValue(pageWidthContext), reldims.ipd);
}
if (getPrecedence() == EN_FALSE) {
- adjustIPD(vpRect, spm.getWritingMode(), neighbourContext);
+ adjustIPD(vpRect, layoutMaster.getWritingMode(), neighbourContext);
}
return vpRect;
}
}
/** {@inheritDoc} */
- public Rectangle getViewportRectangle (FODimension reldims, SimplePageMaster spm) {
+ public Rectangle getViewportRectangle (FODimension reldims) {
/* Special rules apply to resolving extent as values are resolved relative
* to the page size and reference orientation.
*/
PercentBaseContext pageHeightContext = getPageHeightContext(LengthBase.CUSTOM_BASE);
PercentBaseContext neighbourContext;
Rectangle vpRect;
- if (spm.getWritingMode() == EN_LR_TB || spm.getWritingMode() == EN_RL_TB) {
+ if (layoutMaster.getWritingMode() == EN_LR_TB || layoutMaster.getWritingMode() == EN_RL_TB) {
neighbourContext = pageWidthContext;
vpRect = new Rectangle(0, 0, reldims.ipd, getExtent().getValue(pageHeightContext));
} else {
vpRect = new Rectangle(0, 0, getExtent().getValue(pageWidthContext), reldims.ipd);
}
if (getPrecedence() == EN_FALSE) {
- adjustIPD(vpRect, spm.getWritingMode(), neighbourContext);
+ adjustIPD(vpRect, layoutMaster.getWritingMode(), neighbourContext);
}
return vpRect;
}
}
/** {@inheritDoc} */
- public Rectangle getViewportRectangle (FODimension reldims, SimplePageMaster spm) {
+ public Rectangle getViewportRectangle (FODimension reldims) {
/* Special rules apply to resolving margins in the page context.
* Contrary to normal margins in this case top and bottom margin
* are resolved relative to the height. In the property subsystem
int start;
int end;
- if (spm.getWritingMode() == EN_LR_TB) { // Left-to-right
+ if (layoutMaster.getWritingMode() == EN_LR_TB) { // Left-to-right
start = commonMarginBlock.marginLeft.getValue(pageWidthContext);
end = commonMarginBlock.marginRight.getValue(pageWidthContext);
} else { // all other supported modes are right-to-left
}
/** {@inheritDoc} */
- public Rectangle getViewportRectangle (FODimension reldims, SimplePageMaster spm) {
+ public Rectangle getViewportRectangle (FODimension reldims) {
/* Special rules apply to resolving extent as values are resolved relative
* to the page size and reference orientation.
*/
PercentBaseContext pageHeightContext = getPageHeightContext(LengthBase.CUSTOM_BASE);
PercentBaseContext neighbourContext;
Rectangle vpRect;
- if (spm.getWritingMode() == EN_LR_TB || spm.getWritingMode() == EN_RL_TB) {
+ if (layoutMaster.getWritingMode() == EN_LR_TB || layoutMaster.getWritingMode() == EN_RL_TB) {
neighbourContext = pageHeightContext;
vpRect = new Rectangle(reldims.ipd - getExtent().getValue(pageWidthContext), 0,
getExtent().getValue(pageWidthContext), reldims.bpd);
vpRect = new Rectangle(reldims.ipd - getExtent().getValue(pageHeightContext), 0,
reldims.bpd, getExtent().getValue(pageHeightContext));
}
- adjustIPD(vpRect, spm.getWritingMode(), neighbourContext);
+ adjustIPD(vpRect, layoutMaster.getWritingMode(), neighbourContext);
return vpRect;
}
}
/** {@inheritDoc} */
- public Rectangle getViewportRectangle (FODimension reldims, SimplePageMaster spm) {
+ public Rectangle getViewportRectangle (FODimension reldims) {
/* Special rules apply to resolving extent as values are resolved relative
* to the page size and reference orientation.
*/
PercentBaseContext pageHeightContext = getPageHeightContext(LengthBase.CUSTOM_BASE);
PercentBaseContext neighbourContext;
Rectangle vpRect;
- if (spm.getWritingMode() == EN_LR_TB || spm.getWritingMode() == EN_RL_TB) {
+ if (layoutMaster.getWritingMode() == EN_LR_TB || layoutMaster.getWritingMode() == EN_RL_TB) {
neighbourContext = pageHeightContext;
vpRect = new Rectangle(0, 0, getExtent().getValue(pageWidthContext), reldims.bpd);
} else {
neighbourContext = pageWidthContext;
vpRect = new Rectangle(0, 0, reldims.bpd, getExtent().getValue(pageHeightContext));
}
- adjustIPD(vpRect, spm.getWritingMode(), neighbourContext);
+ adjustIPD(vpRect, layoutMaster.getWritingMode(), neighbourContext);
return vpRect;
}