[FOray-commit] SF.net SVN: foray: [7644] trunk/foray/foray-fotree/src/java/org/foray/fotree
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2006-06-16 01:00:34
|
Revision: 7644 Author: victormote Date: 2006-06-15 18:00:22 -0700 (Thu, 15 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7644&view=rev Log Message: ----------- Conform to axsl changes: Remove unneeded method parameters. Modified Paths: -------------- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RegionBefore.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RegionBody.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/SimplePageMaster.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Extent.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Margin.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/PageDimension.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Size.java Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2006-06-16 00:50:15 UTC (rev 7643) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2006-06-16 01:00:22 UTC (rev 7644) @@ -753,15 +753,15 @@ /** * {@inheritDoc} */ - public int traitPageWidth(FOContext context) { - return propertyList.getPageWidth(context); + public int traitPageWidth() { + return propertyList.getPageWidth(); } /** * {@inheritDoc} */ - public int traitPageHeight(FOContext context) { - return propertyList.getPageHeight(context); + public int traitPageHeight() { + return propertyList.getPageHeight(); } /** Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2006-06-16 00:50:15 UTC (rev 7643) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2006-06-16 01:00:22 UTC (rev 7644) @@ -1017,13 +1017,15 @@ return MaximumRepeats.getValueNoInstance(); } - private int getPageDimension(FOContext context, byte axis) { + private int getPageDimension(byte axis) { short propertyType = PageDimension.rawPropertyType(axis); PageDimension property = (PageDimension) getProperty(propertyType); if (property != null) { - return property.getValue(context, axis, fobj); + return property.getValue(axis, fobj); } // Try the shorthand. + /* Null context is OK, because the object can't be inside a marker. */ + FOContext context = null; Size sizeProperty = (Size) getProperty(Constants.FOPROP_SIZE); if (sizeProperty != null) { return sizeProperty.getValue(context, fobj, axis); @@ -1031,12 +1033,12 @@ return PageDimension.getValueNoInstance(axis); } - public int getPageWidth(FOContext context) { - return getPageDimension(context, Constants.AXIS_HORIZONTAL); + public int getPageWidth() { + return getPageDimension(Constants.AXIS_HORIZONTAL); } - public int getPageHeight(FOContext context) { - return getPageDimension(context, Constants.AXIS_VERTICAL); + public int getPageHeight() { + return getPageDimension(Constants.AXIS_VERTICAL); } public short getTextAlign(FOContext context) { Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RegionBefore.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RegionBefore.java 2006-06-16 00:50:15 UTC (rev 7643) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RegionBefore.java 2006-06-16 01:00:22 UTC (rev 7644) @@ -57,7 +57,7 @@ * Inherited documentation: @inheritDoc */ public int getXPositionVP_CR(FOContext context) { - int pageWidth = getPageMaster().traitPageWidth(context); + int pageWidth = getPageMaster().traitPageWidth(); int xPosition = getPageMaster().getMarginLeft(context, pageWidth); if (traitPrecedence() == false) { xPosition += getPageMaster().getStartExtent(); @@ -69,8 +69,8 @@ * Inherited documentation: @inheritDoc */ public int getYPositionVP_CR(FOContext context) { - int pageWidth = getPageMaster().traitPageWidth(context); - return getPageMaster().traitPageHeight(context) + int pageWidth = getPageMaster().traitPageWidth(); + return getPageMaster().traitPageHeight() - getPageMaster().getMarginTop(context, pageWidth); } @@ -78,8 +78,8 @@ * Inherited documentation: @inheritDoc */ public int getWidthVP_CR(FOContext context) { - int pageWidth = getPageMaster().traitPageWidth(context); - int width = getPageMaster().traitPageWidth(context) + int pageWidth = getPageMaster().traitPageWidth(); + int width = getPageMaster().traitPageWidth() - getPageMaster().getMarginLeft(context, pageWidth) - getPageMaster().getMarginRight(context, pageWidth); if (traitPrecedence() == false) { Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RegionBody.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RegionBody.java 2006-06-16 00:50:15 UTC (rev 7643) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RegionBody.java 2006-06-16 01:00:22 UTC (rev 7644) @@ -57,7 +57,7 @@ * Inherited documentation: @inheritDoc */ public int getXPositionVP_CR(FOContext context) { - int pageWidth = getPageMaster().traitPageWidth(context); + int pageWidth = getPageMaster().traitPageWidth(); int pageMarginLeft = getPageMaster().getMarginLeft(context, pageWidth); int regionMarginLeft = this.getMarginLeft(context, pageWidth); return pageMarginLeft + regionMarginLeft; @@ -67,8 +67,8 @@ * Inherited documentation: @inheritDoc */ public int getYPositionVP_CR(FOContext context) { - int pageWidth = getPageMaster().traitPageWidth(context); - int pageHeight = getPageMaster().traitPageHeight(context); + int pageWidth = getPageMaster().traitPageWidth(); + int pageHeight = getPageMaster().traitPageHeight(); int pageMarginTop = getPageMaster().getMarginTop(context, pageWidth); int regionMarginTop = this.getMarginTop(context, pageWidth); return pageHeight - pageMarginTop - regionMarginTop; @@ -78,8 +78,8 @@ * Inherited documentation: @inheritDoc */ public int getWidthVP_CR(FOContext context) { - int pageWidth = getPageMaster().traitPageWidth(context); - return getPageMaster().traitPageWidth(context) + int pageWidth = getPageMaster().traitPageWidth(); + return getPageMaster().traitPageWidth() - getPageMaster().getMarginLeft(context, pageWidth) - getPageMaster().getMarginRight(context, pageWidth) - this.getMarginLeft(context, pageWidth) @@ -90,8 +90,8 @@ * Inherited documentation: @inheritDoc */ public int getHeightVP_CR(FOContext context) { - int pageWidth = getPageMaster().traitPageWidth(context); - return getPageMaster().traitPageHeight(context) + int pageWidth = getPageMaster().traitPageWidth(); + return getPageMaster().traitPageHeight() - getPageMaster().getMarginTop(context, pageWidth) - getPageMaster().getMarginBottom(context, pageWidth) - this.getMarginTop(context, pageWidth) Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/SimplePageMaster.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/SimplePageMaster.java 2006-06-16 00:50:15 UTC (rev 7643) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/SimplePageMaster.java 2006-06-16 01:00:22 UTC (rev 7644) @@ -214,7 +214,7 @@ public int getXPositionRA_CR() { /* TODO: Handle context better. */ FOContext context = null; - return getMarginLeft(context, traitPageWidth(context)); + return getMarginLeft(context, traitPageWidth()); } /** @@ -224,8 +224,8 @@ public int getYPositionRA_CR() { /* TODO: Handle context better. */ FOContext context = null; - return traitPageHeight(context) - - getMarginTop(context, traitPageWidth(context)); + return traitPageHeight() + - getMarginTop(context, traitPageWidth()); } /** @@ -235,9 +235,9 @@ public int getWidthRA_CR() { /* TODO: Handle context better. */ FOContext context = null; - return traitPageWidth(context) - - getMarginLeft(context, traitPageWidth(context)) - - getMarginRight(context, traitPageWidth(context)); + return traitPageWidth() + - getMarginLeft(context, traitPageWidth()) + - getMarginRight(context, traitPageWidth()); } /** @@ -247,9 +247,9 @@ public int getHeightRA_CR() { /* TODO: Handle context better. */ FOContext context = null; - return traitPageHeight(context) - - getMarginTop(context, traitPageWidth(context)) - - getMarginBottom(context, traitPageWidth(context)); + return traitPageHeight() + - getMarginTop(context, traitPageWidth()) + - getMarginBottom(context, traitPageWidth()); } public Namespace getNamespace() { Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Extent.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Extent.java 2006-06-16 00:50:15 UTC (rev 7643) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Extent.java 2006-06-16 01:00:22 UTC (rev 7644) @@ -111,10 +111,10 @@ } switch (absoluteAxis) { case Constants.AXIS_VERTICAL: { - return fobj.traitPageHeight(context); + return fobj.traitPageHeight(); } case Constants.AXIS_HORIZONTAL: { - return fobj.traitPageWidth(context); + return fobj.traitPageWidth(); } } return getValueNoInstance(); Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Margin.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Margin.java 2006-06-16 00:50:15 UTC (rev 7643) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Margin.java 2006-06-16 01:00:22 UTC (rev 7644) @@ -118,7 +118,7 @@ int base = 0; if (fobj instanceof SimplePageMaster) { SimplePageMaster spm = (SimplePageMaster) fobj; - base = spm.traitPageHeight(context); + base = spm.traitPageHeight(); } else { base = widthContainingBlock; } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/PageDimension.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/PageDimension.java 2006-06-16 00:50:15 UTC (rev 7643) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/PageDimension.java 2006-06-16 01:00:22 UTC (rev 7644) @@ -68,20 +68,22 @@ propertyList)); } - public int getValue(FOContext context, byte axis, FObj fobj) { + public int getValue(byte axis, FObj fobj) { + /* Null context is OK, because the object can't be inside a marker. */ + FOContext context = null; if (this.value instanceof PropertyKeyword) { short keyword = ((PropertyKeyword) value).getValue(); switch (keyword) { case Constants.FOVAL_INHERIT: { - FObj parent = fobj.effectiveParent(context); + FObj parent = fobj.realParent(); if (parent == null) { return getValueNoInstance(axis); } if (axis == Constants.AXIS_HORIZONTAL) { - return parent.traitPageWidth(context); + return parent.traitPageWidth(); } if (axis == Constants.AXIS_VERTICAL) { - return parent.traitPageHeight(context); + return parent.traitPageHeight(); } break; } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Size.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Size.java 2006-06-16 00:50:15 UTC (rev 7643) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Size.java 2006-06-16 01:00:22 UTC (rev 7644) @@ -138,10 +138,10 @@ if (parent != null) { switch (axis) { case Constants.AXIS_HORIZONTAL: { - return fobj.traitPageWidth(context); + return fobj.traitPageWidth(); } case Constants.AXIS_VERTICAL: { - return fobj.traitPageHeight(context); + return fobj.traitPageHeight(); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |