You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by ac...@apache.org on 2008/07/04 16:05:41 UTC
svn commit: r674062 - in /xmlgraphics/fop/branches/Temp_AFPGOCAResources: ./
src/java/org/apache/fop/area/Area.java
src/java/org/apache/fop/area/inline/InlineArea.java
src/java/org/apache/fop/render/AbstractRenderer.java
Author: acumiskey
Date: Fri Jul 4 07:05:40 2008
New Revision: 674062
URL: http://svn.apache.org/viewvc?rev=674062&view=rev
Log:
Merged revisions 674056 via svnmerge from
https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk
........
r674056 | acumiskey | 2008-07-04 14:57:57 +0100 (Fri, 04 Jul 2008) | 3 lines
* Some minor optimizations in AbstractRenderer.
* Renamed getBooleanTrait() to getTraitAsBoolean() in Area.
........
Modified:
xmlgraphics/fop/branches/Temp_AFPGOCAResources/ (props changed)
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/area/Area.java
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/area/inline/InlineArea.java
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/AbstractRenderer.java
Propchange: xmlgraphics/fop/branches/Temp_AFPGOCAResources/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Jul 4 07:05:40 2008
@@ -1 +1 @@
-/xmlgraphics/fop/trunk:1-674043
+/xmlgraphics/fop/trunk:1-674060
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/area/Area.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/area/Area.java?rev=674062&r1=674061&r2=674062&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/area/Area.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/area/Area.java Fri Jul 4 07:05:40 2008
@@ -417,10 +417,11 @@
/**
* Get a boolean trait from this area.
+ *
* @param oTraitCode the trait key
* @return the trait value
*/
- public boolean getBooleanTrait(Object oTraitCode) {
+ public boolean getTraitAsBoolean(Object oTraitCode) {
final Object obj = getTrait(oTraitCode);
if (obj instanceof Boolean) {
return ((Boolean)obj).booleanValue();
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/area/inline/InlineArea.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/area/inline/InlineArea.java?rev=674062&r1=674061&r2=674062&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/area/inline/InlineArea.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/area/inline/InlineArea.java Fri Jul 4 07:05:40 2008
@@ -182,22 +182,22 @@
*@return true if the inline area is underlined.
*/
public boolean hasUnderline() {
- return getBooleanTrait(Trait.UNDERLINE);
+ return getTraitAsBoolean(Trait.UNDERLINE);
}
/** @return true if the inline area is overlined. */
public boolean hasOverline() {
- return getBooleanTrait(Trait.OVERLINE);
+ return getTraitAsBoolean(Trait.OVERLINE);
}
/** @return true if the inline area has a line through. */
public boolean hasLineThrough() {
- return getBooleanTrait(Trait.LINETHROUGH);
+ return getTraitAsBoolean(Trait.LINETHROUGH);
}
/** @return true if the inline area is blinking. */
public boolean isBlinking() {
- return getBooleanTrait(Trait.BLINK);
+ return getTraitAsBoolean(Trait.BLINK);
}
/**
Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/AbstractRenderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/AbstractRenderer.java?rev=674062&r1=674061&r2=674062&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/AbstractRenderer.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/AbstractRenderer.java Fri Jul 4 07:05:40 2008
@@ -246,15 +246,25 @@
last here. */
RegionViewport viewport;
viewport = page.getRegionViewport(FO_REGION_BEFORE);
- renderRegionViewport(viewport);
+ if (viewport != null) {
+ renderRegionViewport(viewport);
+ }
viewport = page.getRegionViewport(FO_REGION_START);
- renderRegionViewport(viewport);
+ if (viewport != null) {
+ renderRegionViewport(viewport);
+ }
viewport = page.getRegionViewport(FO_REGION_END);
- renderRegionViewport(viewport);
+ if (viewport != null) {
+ renderRegionViewport(viewport);
+ }
viewport = page.getRegionViewport(FO_REGION_AFTER);
- renderRegionViewport(viewport);
+ if (viewport != null) {
+ renderRegionViewport(viewport);
+ }
viewport = page.getRegionViewport(FO_REGION_BODY);
- renderRegionViewport(viewport);
+ if (viewport != null) {
+ renderRegionViewport(viewport);
+ }
}
/**
@@ -266,27 +276,25 @@
* @param port The region viewport to be rendered
*/
protected void renderRegionViewport(RegionViewport port) {
- if (port != null) {
- Rectangle2D view = port.getViewArea();
- // The CTM will transform coordinates relative to
- // this region-reference area into page coords, so
- // set origin for the region to 0,0.
- currentBPPosition = 0;
- currentIPPosition = 0;
-
- RegionReference regionReference = port.getRegionReference();
- handleRegionTraits(port);
-
- // shouldn't the viewport have the CTM
- startVParea(regionReference.getCTM(), port.isClip() ? view : null);
- // do after starting viewport area
- if (regionReference.getRegionClass() == FO_REGION_BODY) {
- renderBodyRegion((BodyRegion) regionReference);
- } else {
- renderRegion(regionReference);
- }
- endVParea();
+ Rectangle2D view = port.getViewArea();
+ // The CTM will transform coordinates relative to
+ // this region-reference area into page coords, so
+ // set origin for the region to 0,0.
+ currentBPPosition = 0;
+ currentIPPosition = 0;
+
+ RegionReference regionReference = port.getRegionReference();
+ handleRegionTraits(port);
+
+ // shouldn't the viewport have the CTM
+ startVParea(regionReference.getCTM(), port.isClip() ? view : null);
+ // do after starting viewport area
+ if (regionReference.getRegionClass() == FO_REGION_BODY) {
+ renderBodyRegion((BodyRegion) regionReference);
+ } else {
+ renderRegion(regionReference);
}
+ endVParea();
}
/**
@@ -320,8 +328,7 @@
* @param region The region reference area
*/
protected void renderRegion(RegionReference region) {
- List blocks = region.getBlocks();
- renderBlocks(null, blocks);
+ renderBlocks(null, region.getBlocks());
}
/**
@@ -502,7 +509,7 @@
int saveBP = currentBPPosition;
// Calculate the position of the content rectangle.
- if (parent != null && !Boolean.TRUE.equals(parent.getTrait(Trait.IS_VIEWPORT_AREA))) {
+ if (parent != null && !parent.getTraitAsBoolean(Trait.IS_VIEWPORT_AREA)) {
currentBPPosition += parent.getBorderAndPaddingWidthBefore();
/* This is unnecessary now as we're going to use the *-indent traits
currentIPPosition += parent.getBorderAndPaddingWidthStart();
@@ -558,7 +565,7 @@
// simply move position
currentBPPosition += block.getAllocBPD();
}
- } else if (Boolean.TRUE.equals(block.getTrait(Trait.IS_REFERENCE_AREA))) {
+ } else if (block.getTraitAsBoolean(Trait.IS_REFERENCE_AREA)) {
renderReferenceArea(block);
} else {
// save position and offset
@@ -864,4 +871,5 @@
matrix[5] = matrix[5] * 1000;
return new AffineTransform(matrix);
}
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org