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 bc...@apache.org on 2004/10/20 23:07:02 UTC
cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr BasicLinkLayoutManager.java FlowLayoutManager.java InlineStackingLayoutManager.java LeaderLayoutManager.java LineLayoutManager.java PageNumberLayoutManager.java StaticContentLayoutManager.java
bckfnn 2004/10/20 14:07:02
Modified: src/java/org/apache/fop/fo PropertyList.java
src/java/org/apache/fop/fo/flow Leader.java PageNumber.java
src/java/org/apache/fop/fo/pagination ColorProfile.java
Declarations.java Region.java RegionAfter.java
RegionBefore.java RegionBody.java RegionEnd.java
RegionStart.java
RepeatablePageMasterAlternatives.java
src/java/org/apache/fop/fo/properties
CorrespondingPropertyMaker.java
src/java/org/apache/fop/layoutmgr
BasicLinkLayoutManager.java FlowLayoutManager.java
InlineStackingLayoutManager.java
LeaderLayoutManager.java LineLayoutManager.java
PageNumberLayoutManager.java
StaticContentLayoutManager.java
Log:
Fourth phase of performance improvement.
- Misc cleanup.
PR: 31699
Revision Changes Path
1.39 +1 -1 xml-fop/src/java/org/apache/fop/fo/PropertyList.java
Index: PropertyList.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/PropertyList.java,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- PropertyList.java 20 Oct 2004 11:55:32 -0000 1.38
+++ PropertyList.java 20 Oct 2004 21:07:01 -0000 1.39
@@ -98,7 +98,7 @@
/* Handle request for one part of a compound property */
Property p = getExplicit(propId);
if (p == null) {
- p = getShorthand(propId & Constants.PROPERTY_MASK);
+ p = getShorthand(propId);
}
return p;
}
1.43 +0 -5 xml-fop/src/java/org/apache/fop/fo/flow/Leader.java
Index: Leader.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/Leader.java,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- Leader.java 20 Oct 2004 17:49:16 -0000 1.42
+++ Leader.java 20 Oct 2004 21:07:01 -0000 1.43
@@ -40,7 +40,6 @@
import org.apache.fop.fo.properties.LengthRangeProperty;
import org.apache.fop.fo.properties.SpaceProperty;
import org.apache.fop.fo.properties.PercentLength;
-import org.apache.fop.fonts.Font;
import org.apache.fop.layoutmgr.LeaderLayoutManager;
/**
@@ -153,10 +152,6 @@
length = maxlength.getValue();
}
return length;
- }
-
- public Font getFontState() {
- return commonFont.getFontState(getFOEventHandler().getFontInfo());
}
/**
1.43 +0 -9 xml-fop/src/java/org/apache/fop/fo/flow/PageNumber.java
Index: PageNumber.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/PageNumber.java,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- PageNumber.java 20 Oct 2004 11:55:32 -0000 1.42
+++ PageNumber.java 20 Oct 2004 21:07:01 -0000 1.43
@@ -38,7 +38,6 @@
import org.apache.fop.fo.properties.CommonRelativePosition;
import org.apache.fop.fo.properties.KeepProperty;
import org.apache.fop.fo.properties.SpaceProperty;
-import org.apache.fop.fonts.Font;
import org.apache.fop.layoutmgr.PageNumberLayoutManager;
/**
@@ -131,14 +130,6 @@
protected void validateChildNode(Locator loc, String nsURI, String localName)
throws SAXParseException {
invalidChildError(loc, nsURI, localName);
- }
-
- /**
- * @return the FontState object for this PageNumber
- */
- public Font getFontState() {
- return commonFont.getFontState(getFOEventHandler().getFontInfo());
-
}
/**
1.19 +4 -6 xml-fop/src/java/org/apache/fop/fo/pagination/ColorProfile.java
Index: ColorProfile.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/ColorProfile.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- ColorProfile.java 20 Oct 2004 13:19:24 -0000 1.18
+++ ColorProfile.java 20 Oct 2004 21:07:02 -0000 1.19
@@ -46,8 +46,6 @@
private int renderingIntent;
// End of property values
- private int intent;
- private String profileName;
private ICC_ColorSpace colorSpace = null;
/**
@@ -76,10 +74,10 @@
}
/**
- * @return the name of this color profile.
+ * Return the "color-profile-name" property.
*/
- public String getProfileName() {
- return profileName;
+ public String getColorProfileName() {
+ return colorProfileName;
}
/**
1.20 +5 -5 xml-fop/src/java/org/apache/fop/fo/pagination/Declarations.java
Index: Declarations.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/Declarations.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- Declarations.java 19 Oct 2004 08:53:51 -0000 1.19
+++ Declarations.java 20 Oct 2004 21:07:02 -0000 1.20
@@ -85,16 +85,16 @@
FONode node = (FONode)iter.next();
if (node.getName().equals("fo:color-profile")) {
ColorProfile cp = (ColorProfile)node;
- if (!"".equals(cp.getProfileName())) {
+ if (!"".equals(cp.getColorProfileName())) {
if (colorProfiles == null) {
colorProfiles = new java.util.HashMap();
}
- if (colorProfiles.get(cp.getProfileName()) != null) {
+ if (colorProfiles.get(cp.getColorProfileName()) != null) {
// duplicate names
getLogger().warn("Duplicate fo:color-profile profile name : "
- + cp.getProfileName());
+ + cp.getColorProfileName());
}
- colorProfiles.put(cp.getProfileName(), cp);
+ colorProfiles.put(cp.getColorProfileName(), cp);
} else {
getLogger().warn("color-profile-name required for color profile");
}
1.34 +3 -14 xml-fop/src/java/org/apache/fop/fo/pagination/Region.java
Index: Region.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/Region.java,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- Region.java 19 Oct 2004 13:45:37 -0000 1.33
+++ Region.java 20 Oct 2004 21:07:02 -0000 1.34
@@ -69,12 +69,9 @@
writingMode = pList.getWritingMode();
// regions may have name, or default
- if (null == regionName) {
- setRegionName(getDefaultRegionName());
- } else if (regionName.equals("")) {
- setRegionName(getDefaultRegionName());
+ if (regionName.equals("")) {
+ regionName = getDefaultRegionName();
} else {
- setRegionName(regionName);
// check that name is OK. Not very pretty.
if (isReserved(getRegionName())
&& !getRegionName().equals(getDefaultRegionName())) {
@@ -103,14 +100,6 @@
*/
protected abstract String getDefaultRegionName();
- /**
- * Sets the name of the region.
- * @param name the name
- */
- private void setRegionName(String name) {
- this.regionName = name;
- }
-
/**
* Checks to see if a given region name is one of the reserved names
*
@@ -154,7 +143,7 @@
* Return the "region-name" property.
*/
public String getRegionName() {
- return this.regionName;
+ return regionName;
}
/**
1.18 +2 -2 xml-fop/src/java/org/apache/fop/fo/pagination/RegionAfter.java
Index: RegionAfter.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/RegionAfter.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- RegionAfter.java 19 Oct 2004 13:45:37 -0000 1.17
+++ RegionAfter.java 20 Oct 2004 21:07:02 -0000 1.18
@@ -43,13 +43,13 @@
public Rectangle getViewportRectangle (FODimension reldims) {
// Depends on extent, precedence ans writing mode
Rectangle vpRect;
- if (this.getWritingMode() == WritingMode.LR_TB || this.getWritingMode() == WritingMode.RL_TB) {
+ if (getWritingMode() == WritingMode.LR_TB || getWritingMode() == WritingMode.RL_TB) {
vpRect = new Rectangle(0, reldims.bpd - getExtent().getValue(), reldims.ipd, getExtent().getValue());
} else {
vpRect = new Rectangle(0, reldims.bpd - getExtent().getValue(), getExtent().getValue(), reldims.ipd);
}
if (getPrecedence() == FALSE) {
- adjustIPD(vpRect, this.getWritingMode());
+ adjustIPD(vpRect, getWritingMode());
}
return vpRect;
}
1.19 +2 -2 xml-fop/src/java/org/apache/fop/fo/pagination/RegionBefore.java
Index: RegionBefore.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/RegionBefore.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- RegionBefore.java 19 Oct 2004 13:45:37 -0000 1.18
+++ RegionBefore.java 20 Oct 2004 21:07:02 -0000 1.19
@@ -54,13 +54,13 @@
// Before is always 0, start depends on extent
// ipd depends on precedence, bpd=extent
Rectangle vpRect;
- if (this.getWritingMode() == WritingMode.LR_TB || this.getWritingMode() == WritingMode.RL_TB) {
+ if (getWritingMode() == WritingMode.LR_TB || getWritingMode() == WritingMode.RL_TB) {
vpRect = new Rectangle(0, 0, reldims.ipd, getExtent().getValue());
} else {
vpRect = new Rectangle(0, 0, getExtent().getValue(), reldims.ipd);
}
if (getPrecedence() == FALSE) {
- adjustIPD(vpRect, this.getWritingMode());
+ adjustIPD(vpRect, getWritingMode());
}
return vpRect;
}
1.33 +0 -3 xml-fop/src/java/org/apache/fop/fo/pagination/RegionBody.java
Index: RegionBody.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/RegionBody.java,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- RegionBody.java 20 Oct 2004 11:55:32 -0000 1.32
+++ RegionBody.java 20 Oct 2004 21:07:02 -0000 1.33
@@ -25,7 +25,6 @@
import org.xml.sax.SAXParseException;
// FOP
-import org.apache.fop.datatypes.ColorType;
import org.apache.fop.datatypes.FODimension;
import org.apache.fop.datatypes.Length;
import org.apache.fop.datatypes.Numeric;
@@ -42,8 +41,6 @@
private Numeric columnCount;
private Length columnGap;
// End of property values
-
- private ColorType backgroundColor;
/**
* @see org.apache.fop.fo.FONode#FONode(FONode)
1.19 +2 -2 xml-fop/src/java/org/apache/fop/fo/pagination/RegionEnd.java
Index: RegionEnd.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/RegionEnd.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- RegionEnd.java 19 Oct 2004 13:45:37 -0000 1.18
+++ RegionEnd.java 20 Oct 2004 21:07:02 -0000 1.19
@@ -42,7 +42,7 @@
public Rectangle getViewportRectangle (FODimension reldims) {
// Depends on extent, precedence and writing mode
Rectangle vpRect;
- if (this.getWritingMode() == WritingMode.LR_TB || this.getWritingMode() == WritingMode.RL_TB) {
+ if (getWritingMode() == WritingMode.LR_TB || getWritingMode() == WritingMode.RL_TB) {
// Rectangle: x , y (of top left point), width, height
vpRect = new Rectangle(reldims.ipd - getExtent().getValue(), 0,
getExtent().getValue(), reldims.bpd);
@@ -51,7 +51,7 @@
vpRect = new Rectangle(reldims.ipd - getExtent().getValue(), 0,
reldims.bpd, getExtent().getValue());
}
- adjustIPD(vpRect, this.getWritingMode());
+ adjustIPD(vpRect, getWritingMode());
return vpRect;
}
1.18 +2 -2 xml-fop/src/java/org/apache/fop/fo/pagination/RegionStart.java
Index: RegionStart.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/RegionStart.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- RegionStart.java 19 Oct 2004 13:45:37 -0000 1.17
+++ RegionStart.java 20 Oct 2004 21:07:02 -0000 1.18
@@ -44,12 +44,12 @@
// This is the rectangle relative to the page-reference area in
// writing-mode relative coordinates
Rectangle vpRect;
- if (this.getWritingMode() == WritingMode.LR_TB || this.getWritingMode() == WritingMode.RL_TB) {
+ if (getWritingMode() == WritingMode.LR_TB || getWritingMode() == WritingMode.RL_TB) {
vpRect = new Rectangle(0, 0, getExtent().getValue(), reldims.bpd);
} else {
vpRect = new Rectangle(0, 0, reldims.bpd, getExtent().getValue());
}
- adjustIPD(vpRect, this.getWritingMode());
+ adjustIPD(vpRect, getWritingMode());
return vpRect;
}
1.21 +2 -7 xml-fop/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java
Index: RepeatablePageMasterAlternatives.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- RepeatablePageMasterAlternatives.java 19 Oct 2004 13:45:37 -0000 1.20
+++ RepeatablePageMasterAlternatives.java 20 Oct 2004 21:07:02 -0000 1.21
@@ -45,11 +45,6 @@
private static final int INFINITE = -1;
- /**
- * Max times this page master can be repeated.
- * INFINITE is used for the unbounded case
- */
- private int _maximumRepeats;
private int numberConsumed = 0;
private ArrayList conditionalPageMasterRefs;
@@ -130,8 +125,8 @@
public String getNextPageMasterName(boolean isOddPage,
boolean isFirstPage,
boolean isBlankPage) {
- if (_maximumRepeats != INFINITE) {
- if (numberConsumed < _maximumRepeats) {
+ if (getMaximumRepeats() != INFINITE) {
+ if (numberConsumed < getMaximumRepeats()) {
numberConsumed++;
} else {
return null;
1.6 +2 -2 xml-fop/src/java/org/apache/fop/fo/properties/CorrespondingPropertyMaker.java
Index: CorrespondingPropertyMaker.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/properties/CorrespondingPropertyMaker.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- CorrespondingPropertyMaker.java 10 Oct 2004 21:05:21 -0000 1.5
+++ CorrespondingPropertyMaker.java 20 Oct 2004 21:07:02 -0000 1.6
@@ -29,7 +29,7 @@
protected int lr_tb;
protected int rl_tb;
protected int tb_rl;
- private boolean useParent;
+ protected boolean useParent;
private boolean relative;
public CorrespondingPropertyMaker(PropertyMaker baseMaker) {
1.4 +5 -9 xml-fop/src/java/org/apache/fop/layoutmgr/BasicLinkLayoutManager.java
Index: BasicLinkLayoutManager.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/BasicLinkLayoutManager.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- BasicLinkLayoutManager.java 19 Oct 2004 13:38:15 -0000 1.3
+++ BasicLinkLayoutManager.java 20 Oct 2004 21:07:02 -0000 1.4
@@ -28,9 +28,7 @@
* LayoutManager for the fo:basic-link formatting object
*/
public class BasicLinkLayoutManager extends InlineStackingLayoutManager {
-
- private String externalLink;
- private String internalLink;
+ private BasicLink fobj;
/**
* Create an fo:basic-link layout manager.
@@ -39,8 +37,6 @@
*/
public BasicLinkLayoutManager(BasicLink node) {
super(node);
- externalLink = node.getExternalDestination();
- internalLink = node.getInternalDestination();
}
protected InlineParent createArea() {
@@ -51,10 +47,10 @@
private void setupBasicLinkArea(LayoutManager parentLM,
InlineParent area) {
- if (externalLink != null) {
- area.addTrait(Trait.EXTERNAL_LINK, externalLink);
+ if (fobj.getExternalDestination() != null) {
+ area.addTrait(Trait.EXTERNAL_LINK, fobj.getExternalDestination());
} else {
- String link = internalLink;
+ String link = fobj.getInternalDestination();
PageViewport page = parentLM.resolveRefID(link);
if (page != null) {
area.addTrait(Trait.INTERNAL_LINK, page.getKey());
1.9 +5 -3 xml-fop/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java
Index: FlowLayoutManager.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- FlowLayoutManager.java 26 Sep 2004 13:51:00 -0000 1.8
+++ FlowLayoutManager.java 20 Oct 2004 21:07:02 -0000 1.9
@@ -18,8 +18,8 @@
package org.apache.fop.layoutmgr;
-import org.apache.fop.fo.FObj;
import org.apache.fop.fo.flow.Marker;
+import org.apache.fop.fo.pagination.Flow;
import org.apache.fop.area.Area;
import org.apache.fop.area.BlockParent;
@@ -34,7 +34,8 @@
* and filling them with block-level areas generated by its children.
*/
public class FlowLayoutManager extends BlockStackingLayoutManager {
-
+ private Flow fobj;
+
/** List of break possibilities */
protected List blockBreaks = new ArrayList();
@@ -47,8 +48,9 @@
* This is the top level layout manager.
* It is created by the PageSequence FO.
*/
- public FlowLayoutManager(FObj node) {
+ public FlowLayoutManager(Flow node) {
super(node);
+ fobj = node;
}
/**
1.15 +1 -1 xml-fop/src/java/org/apache/fop/layoutmgr/InlineStackingLayoutManager.java
Index: InlineStackingLayoutManager.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/InlineStackingLayoutManager.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- InlineStackingLayoutManager.java 20 Oct 2004 12:00:24 -0000 1.14
+++ InlineStackingLayoutManager.java 20 Oct 2004 21:07:02 -0000 1.15
@@ -116,7 +116,7 @@
return true;
}
- private MinOptMax getExtraIPD(boolean bNotFirst, boolean bNotLast) {
+ protected MinOptMax getExtraIPD(boolean bNotFirst, boolean bNotLast) {
return new MinOptMax(0);
}
1.11 +2 -2 xml-fop/src/java/org/apache/fop/layoutmgr/LeaderLayoutManager.java
Index: LeaderLayoutManager.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/LeaderLayoutManager.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- LeaderLayoutManager.java 20 Oct 2004 17:49:16 -0000 1.10
+++ LeaderLayoutManager.java 20 Oct 2004 21:07:02 -0000 1.11
@@ -47,7 +47,7 @@
public LeaderLayoutManager(Leader node) {
super(node);
fobj = node;
- font = node.getFontState();
+ font = fobj.getCommonFont().getFontState(fobj.getFOEventHandler().getFontInfo());
setAlignment(node.getLeaderAlignment());
}
1.30 +0 -2 xml-fop/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java
Index: LineLayoutManager.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- LineLayoutManager.java 20 Oct 2004 12:01:09 -0000 1.29
+++ LineLayoutManager.java 20 Oct 2004 21:07:02 -0000 1.30
@@ -21,7 +21,6 @@
import org.apache.fop.datatypes.Length;
import org.apache.fop.fo.Constants;
import org.apache.fop.fo.flow.Block;
-import org.apache.fop.fo.properties.CommonMarginBlock;
import org.apache.fop.fo.properties.CommonHyphenation;
import org.apache.fop.hyphenation.Hyphenation;
import org.apache.fop.hyphenation.Hyphenator;
@@ -54,7 +53,6 @@
* @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties()
*/
protected void initProperties() {
- CommonMarginBlock marginProps = fobj.getCommonMarginBlock();
bTextAlignment = fobj.getTextAlign();
bTextAlignmentLast = fobj.getTextAlignLast();
textIndent = fobj.getTextIndent();
1.5 +2 -2 xml-fop/src/java/org/apache/fop/layoutmgr/PageNumberLayoutManager.java
Index: PageNumberLayoutManager.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/PageNumberLayoutManager.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- PageNumberLayoutManager.java 20 Oct 2004 13:19:24 -0000 1.4
+++ PageNumberLayoutManager.java 20 Oct 2004 21:07:02 -0000 1.5
@@ -40,7 +40,7 @@
public PageNumberLayoutManager(PageNumber node) {
super(node);
fobj = node;
- font = node.getFontState();
+ font = fobj.getCommonFont().getFontState(fobj.getFOEventHandler().getFontInfo());
}
public InlineArea get(LayoutContext context) {
1.7 +2 -2 xml-fop/src/java/org/apache/fop/layoutmgr/StaticContentLayoutManager.java
Index: StaticContentLayoutManager.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/StaticContentLayoutManager.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- StaticContentLayoutManager.java 20 Oct 2004 13:41:06 -0000 1.6
+++ StaticContentLayoutManager.java 20 Oct 2004 21:07:02 -0000 1.7
@@ -21,7 +21,7 @@
import org.apache.fop.area.RegionReference;
import org.apache.fop.area.Area;
import org.apache.fop.area.Block;
-import org.apache.fop.fo.pagination.Flow;
+import org.apache.fop.fo.pagination.StaticContent;
import java.util.ArrayList;
import java.util.List;
@@ -38,7 +38,7 @@
private RegionReference region;
private List blockBreaks = new ArrayList();
- public StaticContentLayoutManager(Flow node) {
+ public StaticContentLayoutManager(StaticContent node) {
super(node);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-cvs-help@xml.apache.org