aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache
diff options
context:
space:
mode:
authorGlen Mazza <gmazza@apache.org>2003-11-09 15:38:27 +0000
committerGlen Mazza <gmazza@apache.org>2003-11-09 15:38:27 +0000
commitcc5cbd4f82e565344ee853359c0ef4fd69a06abd (patch)
tree18cc25761bd83d8def41c7138cd01f1e51077278 /src/java/org/apache
parent62e0b02e68248c8f81c8147a0c60d887c3fbd397 (diff)
downloadxmlgraphics-fop-cc5cbd4f82e565344ee853359c0ef4fd69a06abd.tar.gz
xmlgraphics-fop-cc5cbd4f82e565344ee853359c0ef4fd69a06abd.zip
A few more toString() implementations helpful for debugging spacing
issues in BLM. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197001 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache')
-rw-r--r--src/java/org/apache/fop/layoutmgr/LayoutContext.java19
-rw-r--r--src/java/org/apache/fop/layoutmgr/SpaceSpecifier.java16
2 files changed, 30 insertions, 5 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/LayoutContext.java b/src/java/org/apache/fop/layoutmgr/LayoutContext.java
index 76efe2175..0f50acf46 100644
--- a/src/java/org/apache/fop/layoutmgr/LayoutContext.java
+++ b/src/java/org/apache/fop/layoutmgr/LayoutContext.java
@@ -95,7 +95,6 @@ public class LayoutContext {
*/
MinOptMax stackLimit;
-
/** True if current top-level reference area is spanning. */
boolean bIsSpan;
@@ -256,5 +255,23 @@ public class LayoutContext {
public int getBaseline() {
return iBaseline;
}
+
+ public String toString() {
+ return "Layout Context:" +
+ "\nStack Limit: \t" + (getStackLimit() == null ? "null" : getStackLimit().toString()) +
+ "\nTrailing Space: \t" + (getTrailingSpace() == null ? "null" : getTrailingSpace().toString()) +
+ "\nLeading Space: \t" + (getLeadingSpace() == null ? "null" : getLeadingSpace().toString()) +
+ "\nReference IPD: \t" + getRefIPD() +
+ "\nSpace Adjust: \t" + getSpaceAdjust() +
+ "\nIPD Adjust: \t" + getIPDAdjust() +
+ "\nLine Height: \t" + getLineHeight() +
+ "\nBaseline: \t" + getBaseline() +
+ "\nResolve Leading Space: \t" + resolveLeadingSpace() +
+ "\nSuppress Leading Space: \t" + suppressLeadingSpace() +
+ "\nIs First Area: \t" + isFirstArea() +
+ "\nStarts New Area: \t" + startsNewArea() +
+ "\nIs Last Area: \t" + isLastArea() +
+ "\nTry Hyphenate: \t" + tryHyphenate();
+ }
}
diff --git a/src/java/org/apache/fop/layoutmgr/SpaceSpecifier.java b/src/java/org/apache/fop/layoutmgr/SpaceSpecifier.java
index 816e97cae..1bf8e7bcb 100644
--- a/src/java/org/apache/fop/layoutmgr/SpaceSpecifier.java
+++ b/src/java/org/apache/fop/layoutmgr/SpaceSpecifier.java
@@ -63,17 +63,17 @@ import org.apache.fop.traits.MinOptMax;
public class SpaceSpecifier implements Cloneable {
- private boolean bStartsRefArea;
+ private boolean bStartsReferenceArea;
private boolean bHasForcing = false;
private List vecSpaceVals = new java.util.ArrayList();
/**
* Creates a new SpaceSpecifier.
- * @param bStarts true if it starts anew reference area
+ * @param bStarts true if it starts a new reference area
*/
public SpaceSpecifier(boolean bStarts) {
- bStartsRefArea = bStarts;
+ bStartsReferenceArea = bStarts;
}
/**
@@ -82,6 +82,8 @@ public class SpaceSpecifier implements Cloneable {
public Object clone() {
try {
SpaceSpecifier ss = (SpaceSpecifier) super.clone();
+ ss.bStartsReferenceArea = this.bStartsReferenceArea;
+ ss.bHasForcing = this.bHasForcing;
// Clone the vector, but share the objects in it!
ss.vecSpaceVals = new ArrayList();
ss.vecSpaceVals.addAll(this.vecSpaceVals);
@@ -115,7 +117,7 @@ public class SpaceSpecifier implements Cloneable {
* add it to the sequence.
*/
public void addSpace(SpaceVal moreSpace) {
- if (!bStartsRefArea
+ if (!bStartsReferenceArea
|| !moreSpace.isConditional()
|| !vecSpaceVals.isEmpty()) {
if (moreSpace.isForcing()) {
@@ -182,4 +184,10 @@ public class SpaceSpecifier implements Cloneable {
}
return resSpace;
}
+
+ public String toString() {
+ return "Space Specifier (resolved at begin/end of ref. area:):\n" +
+ resolve(false).toString() + "\n" +
+ resolve(true).toString();
+ }
}