diff options
author | Tore Engvig <tore@apache.org> | 2001-07-30 20:29:35 +0000 |
---|---|---|
committer | Tore Engvig <tore@apache.org> | 2001-07-30 20:29:35 +0000 |
commit | e0edd215721150e6c04ac49706622d6189cb0b42 (patch) | |
tree | 6b59b872d9c0e93f99316ea2f421209b71a97755 /src/org/apache/fop/fo/pagination/RegionBody.java | |
parent | eb57915dec9bcd907e495595efac60dbf3579ad8 (diff) | |
download | xmlgraphics-fop-e0edd215721150e6c04ac49706622d6189cb0b42.tar.gz xmlgraphics-fop-e0edd215721150e6c04ac49706622d6189cb0b42.zip |
Formatted code according to code standards.
Changed license to use short license.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194380 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/fo/pagination/RegionBody.java')
-rw-r--r-- | src/org/apache/fop/fo/pagination/RegionBody.java | 156 |
1 files changed, 79 insertions, 77 deletions
diff --git a/src/org/apache/fop/fo/pagination/RegionBody.java b/src/org/apache/fop/fo/pagination/RegionBody.java index 187a5957c..1eae1bb70 100644 --- a/src/org/apache/fop/fo/pagination/RegionBody.java +++ b/src/org/apache/fop/fo/pagination/RegionBody.java @@ -1,4 +1,5 @@ -/* $Id$ +/* + * $Id$ * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. * For details on use and redistribution please refer to the * LICENSE file included with these sources. @@ -21,97 +22,98 @@ import org.apache.fop.messaging.MessageHandler; public class RegionBody extends Region { - + public static class Maker extends FObj.Maker { - public FObj make(FObj parent, PropertyList propertyList) throws FOPException { - return new RegionBody(parent, propertyList); - } + public FObj make(FObj parent, + PropertyList propertyList) throws FOPException { + return new RegionBody(parent, propertyList); + } + } public static FObj.Maker maker() { - return new RegionBody.Maker(); - } - + return new RegionBody.Maker(); + } + public static final String REGION_CLASS = "body"; - + ColorType backgroundColor; - protected RegionBody(FObj parent, PropertyList propertyList) - throws FOPException - { - super(parent, propertyList); + protected RegionBody(FObj parent, + PropertyList propertyList) throws FOPException { + super(parent, propertyList); } - + RegionArea makeRegionArea(int allocationRectangleXPosition, - int allocationRectangleYPosition, - int allocationRectangleWidth, - int allocationRectangleHeight) { - -// Common Border, Padding, and Background Properties -BorderAndPadding bap = propMgr.getBorderAndPadding(); -BackgroundProps bProps = propMgr.getBackgroundProps(); - -// Common Margin Properties-Block -MarginProps mProps = propMgr.getMarginProps(); - - //this.properties.get("clip"); - //this.properties.get("display-align"); - //this.properties.get("region-name"); - //this.properties.get("reference-orientation"); - //this.properties.get("writing-mode"); - - this.backgroundColor = this.properties.get( - "background-color").getColorType(); - - BodyRegionArea body = new BodyRegionArea(allocationRectangleXPosition + mProps.marginLeft, - allocationRectangleYPosition - mProps.marginTop, - allocationRectangleWidth - mProps.marginLeft - - mProps.marginRight, allocationRectangleHeight - - mProps.marginTop - mProps.marginBottom); - - int overflow = this.properties.get("overflow").getEnum(); - String columnCountAsString = this.properties.get("column-count").getString(); - int columnCount = 1; - try - { - columnCount = Integer.parseInt(columnCountAsString); - } - catch (NumberFormatException nfe) - { - MessageHandler.errorln("Bad value on region body 'column-count'"); - columnCount = 1; - } - if ((columnCount > 1) && (overflow == Overflow.SCROLL)) - { - // recover by setting 'column-count' to 1. This is allowed but - // not required by the spec. - MessageHandler.errorln("Setting 'column-count' to 1 because " - + "'overflow' is set to 'scroll'"); - columnCount = 1; - } - body.setColumnCount(columnCount); - - int columnGap = this.properties.get("column-gap").getLength().mvalue(); - body.setColumnGap(columnGap); - + int allocationRectangleYPosition, + int allocationRectangleWidth, + int allocationRectangleHeight) { + + // Common Border, Padding, and Background Properties + BorderAndPadding bap = propMgr.getBorderAndPadding(); + BackgroundProps bProps = propMgr.getBackgroundProps(); + + // Common Margin Properties-Block + MarginProps mProps = propMgr.getMarginProps(); + + // this.properties.get("clip"); + // this.properties.get("display-align"); + // this.properties.get("region-name"); + // this.properties.get("reference-orientation"); + // this.properties.get("writing-mode"); + + this.backgroundColor = + this.properties.get("background-color").getColorType(); + + BodyRegionArea body = new BodyRegionArea(allocationRectangleXPosition + + mProps.marginLeft, + allocationRectangleYPosition + - mProps.marginTop, + allocationRectangleWidth + - mProps.marginLeft + - mProps.marginRight, + allocationRectangleHeight + - mProps.marginTop + - mProps.marginBottom); + + int overflow = this.properties.get("overflow").getEnum(); + String columnCountAsString = + this.properties.get("column-count").getString(); + int columnCount = 1; + try { + columnCount = Integer.parseInt(columnCountAsString); + } catch (NumberFormatException nfe) { + MessageHandler.errorln("Bad value on region body 'column-count'"); + columnCount = 1; + } + if ((columnCount > 1) && (overflow == Overflow.SCROLL)) { + // recover by setting 'column-count' to 1. This is allowed but + // not required by the spec. + MessageHandler.errorln("Setting 'column-count' to 1 because " + + "'overflow' is set to 'scroll'"); + columnCount = 1; + } + body.setColumnCount(columnCount); + + int columnGap = + this.properties.get("column-gap").getLength().mvalue(); + body.setColumnGap(columnGap); + body.setBackgroundColor(backgroundColor); - return body; + return body; } - - protected String getDefaultRegionName() - { - return "xsl-region-body"; + + protected String getDefaultRegionName() { + return "xsl-region-body"; } - - protected String getElementName() - { - return "fo:region-body"; + + protected String getElementName() { + return "fo:region-body"; } - public String getRegionClass() - { - return REGION_CLASS; + public String getRegionClass() { + return REGION_CLASS; } } |