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 vh...@apache.org on 2009/10/23 19:27:17 UTC
svn commit: r829138 [2/2] - in /xmlgraphics/fop/branches/Temp_Accessibility:
./ lib/ src/documentation/content/xdocs/trunk/ src/java/META-INF/services/
src/java/org/apache/fop/afp/ src/java/org/apache/fop/afp/goca/
src/java/org/apache/fop/afp/ioca/ src...
Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/ElementListUtils.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/ElementListUtils.java?rev=829138&r1=829137&r2=829138&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/ElementListUtils.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/ElementListUtils.java Fri Oct 23 17:27:14 2009
@@ -62,13 +62,14 @@
if (el.isPenalty()) {
KnuthPenalty penalty = (KnuthPenalty)el;
//Convert all penalties to break inhibitors
- if (penalty.getP() < KnuthPenalty.INFINITE) {
- iter.set(new KnuthPenalty(penalty.getW(), KnuthPenalty.INFINITE,
- penalty.isFlagged(), penalty.getPosition(), penalty.isAuxiliary()));
+ if (penalty.getPenalty() < KnuthPenalty.INFINITE) {
+ iter.set(new KnuthPenalty(penalty.getWidth(), KnuthPenalty.INFINITE,
+ penalty.isPenaltyFlagged(), penalty.getPosition(),
+ penalty.isAuxiliary()));
}
} else if (el.isGlue()) {
KnuthGlue glue = (KnuthGlue)el;
- len += glue.getW();
+ len += glue.getWidth();
iter.previous();
el = (ListElement)iter.previous();
iter.next();
@@ -84,7 +85,7 @@
}
} else {
KnuthElement kel = (KnuthElement)el;
- len += kel.getW();
+ len += kel.getWidth();
}
if (len >= constraint) {
return false;
@@ -109,13 +110,14 @@
if (el.isPenalty()) {
KnuthPenalty penalty = (KnuthPenalty)el;
//Convert all penalties to break inhibitors
- if (penalty.getP() < KnuthPenalty.INFINITE) {
- i.set(new KnuthPenalty(penalty.getW(), KnuthPenalty.INFINITE,
- penalty.isFlagged(), penalty.getPosition(), penalty.isAuxiliary()));
+ if (penalty.getPenalty() < KnuthPenalty.INFINITE) {
+ i.set(new KnuthPenalty(penalty.getWidth(), KnuthPenalty.INFINITE,
+ penalty.isPenaltyFlagged(), penalty.getPosition(),
+ penalty.isAuxiliary()));
}
} else if (el.isGlue()) {
KnuthGlue glue = (KnuthGlue)el;
- len += glue.getW();
+ len += glue.getWidth();
el = (ListElement)i.previous();
i.next();
if (el.isBox()) {
@@ -134,7 +136,7 @@
}
} else {
KnuthElement kel = (KnuthElement)el;
- len += kel.getW();
+ len += kel.getWidth();
}
if (len >= constraint) {
return false;
@@ -158,9 +160,9 @@
while (iter.hasNext()) {
ListElement el = (ListElement)iter.next();
if (el.isBox()) {
- len += ((KnuthElement)el).getW();
+ len += ((KnuthElement)el).getWidth();
} else if (el.isGlue()) {
- len += ((KnuthElement)el).getW();
+ len += ((KnuthElement)el).getWidth();
} else {
//log.debug("Ignoring penalty: " + el);
//ignore penalties
@@ -210,7 +212,7 @@
*/
public static boolean endsWithNonInfinitePenalty(List elems) {
ListElement last = (ListElement) ListUtil.getLast(elems);
- if (last.isPenalty() && ((KnuthPenalty)last).getP() < KnuthElement.INFINITE) {
+ if (last.isPenalty() && ((KnuthPenalty)last).getPenalty() < KnuthElement.INFINITE) {
return true;
} else if (last instanceof BreakElement
&& ((BreakElement)last).getPenaltyValue() < KnuthElement.INFINITE) {
@@ -230,7 +232,7 @@
int prevBreak = startIndex - 1;
while (prevBreak >= 0) {
KnuthElement el = (KnuthElement)elems.get(prevBreak);
- if (el.isPenalty() && el.getP() < KnuthElement.INFINITE) {
+ if (el.isPenalty() && el.getPenalty() < KnuthElement.INFINITE) {
break;
}
prevBreak--;
Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java?rev=829138&r1=829137&r2=829138&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java Fri Oct 23 17:27:14 2009
@@ -72,7 +72,7 @@
lastOldElement = getLast();
firstNewElement = sequence.getElement(0);
if (firstNewElement.isBox() && !((KnuthElement) firstNewElement).isAuxiliary()
- && lastOldElement.isBox() && ((KnuthElement) lastOldElement).getW() != 0) {
+ && lastOldElement.isBox() && ((KnuthElement) lastOldElement).getWidth() != 0) {
addALetterSpace();
}
addAll(sequence);
Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/KnuthBox.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/KnuthBox.java?rev=829138&r1=829137&r2=829138&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/KnuthBox.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/KnuthBox.java Fri Oct 23 17:27:14 2009
@@ -37,12 +37,12 @@
/**
* Create a new KnuthBox.
*
- * @param w the width of this box
+ * @param width the width of this box
* @param pos the Position stored in this box
- * @param bAux is this box auxiliary?
+ * @param auxiliary is this box auxiliary?
*/
- public KnuthBox(int w, Position pos, boolean bAux) {
- super(w, pos, bAux);
+ public KnuthBox(int width, Position pos, boolean auxiliary) {
+ super(width, pos, auxiliary);
}
/** {@inheritDoc} */
@@ -52,14 +52,14 @@
/** {@inheritDoc} */
public String toString() {
- StringBuffer sb = new StringBuffer(64);
+ StringBuffer buffer = new StringBuffer(64);
if (isAuxiliary()) {
- sb.append("aux. ");
+ buffer.append("aux. ");
}
- sb.append("box");
- sb.append(" w=");
- sb.append(getW());
- return sb.toString();
+ buffer.append("box");
+ buffer.append(" w=");
+ buffer.append(getWidth());
+ return buffer.toString();
}
}
Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/KnuthElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/KnuthElement.java?rev=829138&r1=829137&r2=829138&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/KnuthElement.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/KnuthElement.java Fri Oct 23 17:27:14 2009
@@ -33,44 +33,44 @@
public static final int INFINITE = 1000;
private int width;
- private boolean bIsAuxiliary;
+ private boolean auxiliary;
/**
* Create a new KnuthElement.
* This class being abstract, this can be called only by subclasses.
*
- * @param w the width of this element
+ * @param width the width of this element
* @param pos the Position stored in this element
- * @param bAux is this an auxiliary element?
+ * @param auxiliary is this an auxiliary element?
*/
- protected KnuthElement(int w, Position pos, boolean bAux) {
+ protected KnuthElement(int width, Position pos, boolean auxiliary) {
super(pos);
- width = w;
- bIsAuxiliary = bAux;
+ this.width = width;
+ this.auxiliary = auxiliary;
}
/** @return true if this element is an auxiliary one. */
public boolean isAuxiliary() {
- return bIsAuxiliary;
+ return auxiliary;
}
/** @return the width of this element. */
- public int getW() {
+ public int getWidth() {
return width;
}
/** @return the penalty value of this element, if applicable. */
- public int getP() {
+ public int getPenalty() {
throw new RuntimeException("Element is not a penalty");
}
/** @return the stretch value of this element, if applicable. */
- public int getY() {
+ public int getStretch() {
throw new RuntimeException("Element is not a glue");
}
/** @return the shrink value of this element, if applicable. */
- public int getZ() {
+ public int getShrink() {
throw new RuntimeException("Element is not a glue");
}
Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/KnuthGlue.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/KnuthGlue.java?rev=829138&r1=829137&r2=829138&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/KnuthGlue.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/KnuthGlue.java Fri Oct 23 17:27:14 2009
@@ -54,24 +54,25 @@
/**
* Create a new KnuthGlue.
*
- * @param w the width of this glue
- * @param y the stretchability of this glue
- * @param z the shrinkability of this glue
+ * @param width the width of this glue
+ * @param stretchability the stretchability of this glue
+ * @param shrinkability the shrinkability of this glue
* @param pos the Position stored in this glue
- * @param bAux is this glue auxiliary?
+ * @param auxiliary is this glue auxiliary?
*/
- public KnuthGlue(int w, int y, int z, Position pos, boolean bAux) {
- super(w, pos, bAux);
- stretchability = y;
- shrinkability = z;
+ public KnuthGlue(int width, int stretchability, int shrinkability, Position pos,
+ boolean auxiliary) {
+ super(width, pos, auxiliary);
+ this.stretchability = stretchability;
+ this.shrinkability = shrinkability;
}
- public KnuthGlue(int w, int y, int z,
- int iAdjClass, Position pos, boolean bAux) {
- super(w, pos, bAux);
- stretchability = y;
- shrinkability = z;
- adjustmentClass = iAdjClass;
+ public KnuthGlue(int width, int stretchability, int shrinkability, int adjustmentClass,
+ Position pos, boolean auxiliary) {
+ super(width, pos, auxiliary);
+ this.stretchability = stretchability;
+ this.shrinkability = shrinkability;
+ this.adjustmentClass = adjustmentClass;
}
/** {@inheritDoc} */
@@ -80,12 +81,12 @@
}
/** @return the stretchability of this glue. */
- public int getY() {
+ public int getStretch() {
return stretchability;
}
/** @return the shrinkability of this glue. */
- public int getZ() {
+ public int getShrink() {
return shrinkability;
}
@@ -96,18 +97,18 @@
/** {@inheritDoc} */
public String toString() {
- StringBuffer sb = new StringBuffer(64);
+ StringBuffer buffer = new StringBuffer(64);
if (isAuxiliary()) {
- sb.append("aux. ");
+ buffer.append("aux. ");
}
- sb.append("glue");
- sb.append(" w=").append(getW());
- sb.append(" stretch=").append(getY());
- sb.append(" shrink=").append(getZ());
+ buffer.append("glue");
+ buffer.append(" w=").append(getWidth());
+ buffer.append(" stretch=").append(getStretch());
+ buffer.append(" shrink=").append(getShrink());
if (getAdjustmentClass() >= 0) {
- sb.append(" adj-class=").append(getAdjustmentClass());
+ buffer.append(" adj-class=").append(getAdjustmentClass());
}
- return sb.toString();
+ return buffer.toString();
}
}
Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/KnuthPenalty.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/KnuthPenalty.java?rev=829138&r1=829137&r2=829138&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/KnuthPenalty.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/KnuthPenalty.java Fri Oct 23 17:27:14 2009
@@ -45,39 +45,40 @@
public static final int FLAGGED_PENALTY = 50;
private int penalty;
- private boolean isFlagged;
+ private boolean penaltyFlagged;
private int breakClass = -1;
/**
* Create a new KnuthPenalty.
*
- * @param w the width of this penalty
- * @param p the penalty value of this penalty
- * @param f is this penalty flagged?
+ * @param width the width of this penalty
+ * @param penalty the penalty value of this penalty
+ * @param penaltyFlagged is this penalty flagged?
* @param pos the Position stored in this penalty
- * @param isAuxiliary is this penalty auxiliary?
+ * @param auxiliary is this penalty auxiliary?
*/
- public KnuthPenalty(int w, int p, boolean f, Position pos, boolean isAuxiliary) {
- super(w, pos, isAuxiliary);
- penalty = p;
- isFlagged = f;
+ public KnuthPenalty(int width, int penalty, boolean penaltyFlagged, Position pos,
+ boolean auxiliary) {
+ super(width, pos, auxiliary);
+ this.penalty = penalty;
+ this.penaltyFlagged = penaltyFlagged;
}
/**
* Create a new KnuthPenalty.
*
- * @param w the width of this penalty
- * @param p the penalty value of this penalty
- * @param f is this penalty flagged?
+ * @param width the width of this penalty
+ * @param penalty the penalty value of this penalty
+ * @param penaltyFlagged is this penalty flagged?
* @param breakClass the break class of this penalty (one of
* {@link Constants#EN_AUTO}, {@link Constants#EN_COLUMN}, {@link Constants#EN_PAGE},
* {@link Constants#EN_EVEN_PAGE}, {@link Constants#EN_ODD_PAGE})
* @param pos the Position stored in this penalty
* @param isAuxiliary is this penalty auxiliary?
*/
- public KnuthPenalty(int w, int p, boolean f,
- int breakClass, Position pos, boolean isAuxiliary) {
- this(w, p, f, pos, isAuxiliary);
+ public KnuthPenalty(int width, int penalty, boolean penaltyFlagged, int breakClass,
+ Position pos, boolean isAuxiliary) {
+ this(width, penalty, penaltyFlagged, pos, isAuxiliary);
this.breakClass = breakClass;
}
@@ -90,6 +91,8 @@
* (Mainly used in {@link #toString()} methods, to improve readability
* of the trace logs.)
*
+ * TODO: shouldn't be penalty a class of its own?
+ *
* @param penaltyValue the penalty value
* @return the penalty value as a {@link java.lang.String}
*/
@@ -110,21 +113,21 @@
/**
* @return the penalty value of this penalty.
*/
- public int getP() {
+ public int getPenalty() {
return penalty;
}
/**
* Sets a new penalty value.
- * @param p the new penalty value
+ * @param penalty the new penalty value
*/
- public void setP(int p) {
- this.penalty = p;
+ public void setPenalty(int penalty) {
+ this.penalty = penalty;
}
/** @return true is this penalty is a flagged one. */
- public boolean isFlagged() {
- return isFlagged;
+ public boolean isPenaltyFlagged() {
+ return penaltyFlagged;
}
/** {@inheritDoc} */
@@ -142,28 +145,28 @@
/** {@inheritDoc} */
public String toString() {
- StringBuffer sb = new StringBuffer(64);
+ StringBuffer buffer = new StringBuffer(64);
if (isAuxiliary()) {
- sb.append("aux. ");
+ buffer.append("aux. ");
}
- sb.append("penalty");
- sb.append(" p=");
- sb.append(valueOf(this.penalty));
- if (this.isFlagged) {
- sb.append(" [flagged]");
+ buffer.append("penalty");
+ buffer.append(" p=");
+ buffer.append(valueOf(this.penalty));
+ if (this.penaltyFlagged) {
+ buffer.append(" [flagged]");
}
- sb.append(" w=");
- sb.append(getW());
+ buffer.append(" w=");
+ buffer.append(getWidth());
if (isForcedBreak()) {
- sb.append(" (forced break, ")
+ buffer.append(" (forced break, ")
.append(getBreakClassName(this.breakClass))
.append(")");
} else if (this.penalty >= 0 && this.breakClass != -1) {
//penalty corresponding to a keep constraint
- sb.append(" (keep constraint, ")
+ buffer.append(" (keep constraint, ")
.append(getBreakClassName(this.breakClass))
.append(")");
}
- return sb.toString();
+ return buffer.toString();
}
}
Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/KnuthSequence.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/KnuthSequence.java?rev=829138&r1=829137&r2=829138&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/KnuthSequence.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/KnuthSequence.java Fri Oct 23 17:27:14 2009
@@ -26,9 +26,12 @@
import java.util.ListIterator;
/**
- * Represents a list of Knuth elements.
+ * Represents a list of {@link KnuthElement Knuth elements}.
*/
public abstract class KnuthSequence extends ArrayList {
+
+ //TODO: do not extend ArrayList
+
/**
* Creates a new and empty list.
*/
Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java?rev=829138&r1=829137&r2=829138&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java Fri Oct 23 17:27:14 2009
@@ -96,7 +96,7 @@
//Controls whether a single part should be forced if possible (ex. block-container)
private boolean favorSinglePart = false;
- private boolean ipdChange;
+ private int ipdDifference;
private KnuthNode bestNodeForIPDChange;
//Used to keep track of switches in keep-context
@@ -320,7 +320,7 @@
* will not have considered it a legal break, but it could still
* be one.
*/
- if (penalty.getP() == KnuthPenalty.INFINITE) {
+ if (penalty.getPenalty() == KnuthPenalty.INFINITE) {
int breakClass = penalty.getBreakClass();
if (breakClass == Constants.EN_PAGE
|| breakClass == Constants.EN_COLUMN) {
@@ -363,7 +363,7 @@
noteListIterator.hasNext();) {
final KnuthElement element = (KnuthElement) noteListIterator.next();
if (element.isBox() || element.isGlue()) {
- noteLength += element.getW();
+ noteLength += element.getWidth();
}
}
int prevLength = (lengthList == null || lengthList.isEmpty())
@@ -445,22 +445,22 @@
return true;
} else {
KnuthPenalty p = (KnuthPenalty) element;
- if (p.getP() <= 0) {
+ if (p.getPenalty() <= 0) {
return true;
} else {
int context = p.getBreakClass();
switch (context) {
case Constants.EN_LINE:
case Constants.EN_COLUMN:
- return p.getP() < KnuthPenalty.INFINITE;
+ return p.getPenalty() < KnuthPenalty.INFINITE;
case Constants.EN_PAGE:
- return p.getP() < KnuthPenalty.INFINITE
+ return p.getPenalty() < KnuthPenalty.INFINITE
|| !pageProvider.endPage(line - 1);
case Constants.EN_AUTO:
log.debug("keep is not auto but context is");
return true;
default:
- if (p.getP() < KnuthPenalty.INFINITE) {
+ if (p.getPenalty() < KnuthPenalty.INFINITE) {
log.debug("Non recognized keep context:" + context);
return true;
} else {
@@ -479,7 +479,7 @@
int footnoteSplit = 0;
boolean canDeferOldFootnotes;
if (element.isPenalty()) {
- actualWidth += element.getW();
+ actualWidth += element.getWidth();
}
if (footnotesPending) {
// compute the total length of the footnotes not yet inserted
@@ -588,7 +588,7 @@
index++) {
if (par.getElement(index).isGlue() && par.getElement(index - 1).isBox()
|| par.getElement(index).isPenalty()
- && ((KnuthElement) par.getElement(index)).getP() < KnuthElement.INFINITE) {
+ && ((KnuthElement) par.getElement(index)).getPenalty() < KnuthElement.INFINITE) {
// break found
break;
}
@@ -711,7 +711,7 @@
element = (KnuthElement) noteListIterator.next();
if (element.isBox()) {
// element is a box
- splitLength += element.getW();
+ splitLength += element.getWidth();
boxPreceding = true;
} else if (element.isGlue()) {
// element is a glue
@@ -721,10 +721,10 @@
break;
}
boxPreceding = false;
- splitLength += element.getW();
+ splitLength += element.getWidth();
} else {
// element is a penalty
- if (element.getP() < KnuthElement.INFINITE) {
+ if (element.getPenalty() < KnuthElement.INFINITE) {
// end of the sub-sequence
index = noteListIterator.previousIndex();
break;
@@ -792,7 +792,7 @@
double f = Math.abs(r);
f = 1 + 100 * f * f * f;
if (element.isPenalty()) {
- double penalty = element.getP();
+ double penalty = element.getPenalty();
if (penalty >= 0) {
f += penalty;
demerits = f * f;
@@ -805,9 +805,9 @@
demerits = f * f;
}
- if (element.isPenalty() && ((KnuthPenalty) element).isFlagged()
+ if (element.isPenalty() && ((KnuthPenalty) element).isPenaltyFlagged()
&& getElement(activeNode.position).isPenalty()
- && ((KnuthPenalty) getElement(activeNode.position)).isFlagged()) {
+ && ((KnuthPenalty) getElement(activeNode.position)).isPenaltyFlagged()) {
// add demerit for consecutive breaks at flagged penalties
demerits += repeatedFlaggedDemerit;
}
@@ -1077,8 +1077,8 @@
}
/** {@inheritDoc} */
- protected boolean ipdChanged() {
- return ipdChange;
+ protected int getIPDdifference() {
+ return ipdDifference;
}
/** {@inheritDoc} */
@@ -1104,9 +1104,9 @@
* @param node the active node to add
*/
protected void addNode(int line, KnuthNode node) {
- if (node.position < par.size() - 1 && line > 0 && ipdChange(line - 1)) {
+ if (node.position < par.size() - 1 && line > 0
+ && (ipdDifference = compareIPDs(line - 1)) != 0) {
log.trace("IPD changes at page " + line);
- ipdChange = true;
if (bestNodeForIPDChange == null
|| node.totalDemerits < bestNodeForIPDChange.totalDemerits) {
bestNodeForIPDChange = node;
@@ -1117,7 +1117,7 @@
* The whole sequence could actually fit on the last page before
* the IPD change. No need to do any special handling.
*/
- ipdChange = false;
+ ipdDifference = 0;
}
super.addNode(line, node);
}
@@ -1127,12 +1127,11 @@
return bestNodeForIPDChange;
}
- /** {@inheritDoc} */
- protected boolean ipdChange(int line) {
+ private int compareIPDs(int line) {
if (pageProvider == null) {
- return false;
+ return 0;
}
- return pageProvider.ipdChange(line);
+ return pageProvider.compareIPDs(line);
}
}
Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/PageProvider.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/PageProvider.java?rev=829138&r1=829137&r2=829138&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/PageProvider.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/PageProvider.java Fri Oct 23 17:27:14 2009
@@ -161,12 +161,13 @@
}
/**
- * Returns true if the part following the given one has a different IPD.
+ * Compares the IPD of the given part with the following one.
*
* @param index index of the current part
- * @return true if the following part has a different IPD, false otherwise
+ * @return a negative integer, zero or a positive integer as the current IPD is less
+ * than, equal to or greater than the IPD of the following part
*/
- public boolean ipdChange(int index) {
+ public int compareIPDs(int index) {
int columnCount = 0;
int colIndex = startColumnOfCurrentElementList + index;
int pageIndex = -1;
@@ -179,11 +180,11 @@
} while (colIndex >= columnCount);
if (colIndex + 1 < columnCount) {
// Next part is a column on same page => same IPD
- return false;
+ return 0;
} else {
Page nextPage = getPage(false, pageIndex + 1, RELTO_CURRENT_ELEMENT_LIST);
return page.getPageViewport().getBodyRegion().getIPD()
- != nextPage.getPageViewport().getBodyRegion().getIPD();
+ - nextPage.getPageViewport().getBodyRegion().getIPD();
}
}
Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/inline/ContentLayoutManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/inline/ContentLayoutManager.java?rev=829138&r1=829137&r2=829138&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/inline/ContentLayoutManager.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/inline/ContentLayoutManager.java Fri Oct 23 17:27:14 2009
@@ -266,12 +266,12 @@
KnuthSequence ks = (KnuthSequence)obj;
for (Iterator it = ks.iterator(); it.hasNext(); ) {
contentElement = (KnuthElement)it.next();
- stackSize += contentElement.getW();
+ stackSize += contentElement.getWidth();
contentList.add(contentElement);
}
} else {
contentElement = (KnuthElement)obj;
- stackSize += contentElement.getW();
+ stackSize += contentElement.getWidth();
contentList.add(contentElement);
}
}
Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java?rev=829138&r1=829137&r2=829138&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java Fri Oct 23 17:27:14 2009
@@ -680,7 +680,7 @@
assert lastElement != null;
previousIsBox = lastElement.isBox()
&& !((KnuthElement) lastElement).isAuxiliary()
- && ((KnuthElement) lastElement).getW() != 0;
+ && ((KnuthElement) lastElement).getWidth() != 0;
// if last paragraph is open, add the new elements to the paragraph
// else this is the last paragraph
@@ -705,7 +705,7 @@
// finish last paragraph if it was closed with a linefeed
if (lastElement.isPenalty()
- && ((KnuthPenalty) lastElement).getP() == -KnuthPenalty.INFINITE) {
+ && ((KnuthPenalty) lastElement).getPenalty() == -KnuthPenalty.INFINITE) {
// a penalty item whose value is -inf
// represents a preserved linefeed,
// which forces a line break
@@ -1172,7 +1172,7 @@
LeafPosition pos = (LeafPosition)lastElement.getPosition();
int totalAdj = adj;
//if (lastElement.isPenalty()) {
- // totalAdj += lastElement.getW();
+ // totalAdj += lastElement.getWidth();
//}
//int lineNumberDifference = (int)((double) totalAdj / constantLineHeight);
int lineNumberDifference = (int) Math.round((double) totalAdj / constantLineHeight
Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java?rev=829138&r1=829137&r2=829138&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java Fri Oct 23 17:27:14 2009
@@ -57,6 +57,8 @@
*/
public class TextLayoutManager extends LeafNodeLayoutManager {
+ //TODO: remove all final modifiers at local variables
+
/**
* Store information about each potential text area.
* Index of character which ends the area, IPD of area, including
@@ -703,39 +705,39 @@
}
private AreaInfo processWord(final int alignment, final KnuthSequence sequence,
- AreaInfo prevAi, final char ch, final boolean breakOpportunity,
+ AreaInfo prevAreaInfo, final char ch, final boolean breakOpportunity,
final boolean checkEndsWithHyphen) {
- AreaInfo ai;
+
//Word boundary found, process widths and kerning
int lastIndex = this.nextStart;
while (lastIndex > 0
- && this.foText.charAt(lastIndex - 1) == CharUtilities.SOFT_HYPHEN) {
+ && foText.charAt(lastIndex - 1) == CharUtilities.SOFT_HYPHEN) {
lastIndex--;
}
final boolean endsWithHyphen = checkEndsWithHyphen
- && this.foText.charAt(lastIndex) == CharUtilities.SOFT_HYPHEN;
+ && foText.charAt(lastIndex) == CharUtilities.SOFT_HYPHEN;
final Font font = FontSelector
- .selectFontForCharactersInText(this.foText,
- this.thisStart, lastIndex, this.foText, this);
+ .selectFontForCharactersInText(foText,
+ this.thisStart, lastIndex, foText, this);
final int wordLength = lastIndex - this.thisStart;
final boolean kerning = font.hasKerning();
final MinOptMax wordIPD = new MinOptMax(0);
for (int i = this.thisStart; i < lastIndex; i++) {
- final char c = this.foText.charAt(i);
+ final char currentChar = foText.charAt(i);
//character width
- final int charWidth = font.getCharWidth(c);
+ final int charWidth = font.getCharWidth(currentChar);
wordIPD.add(charWidth);
//kerning
if (kerning) {
int kern = 0;
if (i > this.thisStart) {
- final char previous = this.foText.charAt(i - 1);
- kern = font.getKernValue(previous, c) * font.getFontSize() / 1000;
- } else if (prevAi != null && !prevAi.isSpace && prevAi.breakIndex > 0) {
- final char previous = this.foText.charAt(prevAi.breakIndex - 1);
- kern = font.getKernValue(previous, c) * font.getFontSize() / 1000;
+ final char previousChar = foText.charAt(i - 1);
+ kern = font.getKernValue(previousChar, currentChar);
+ } else if (prevAreaInfo != null && !prevAreaInfo.isSpace && prevAreaInfo.breakIndex > 0) {
+ final char previousChar = foText.charAt(prevAreaInfo.breakIndex - 1);
+ kern = font.getKernValue(previousChar, currentChar);
}
if (kern != 0) {
this.addToLetterAdjust(i, kern);
@@ -748,11 +750,10 @@
&& !TextLayoutManager.isSpace(ch)
&& lastIndex > 0
&& endsWithHyphen) {
- final int kern = font.getKernValue(
- this.foText.charAt(lastIndex - 1), ch)
- * font.getFontSize() / 1000;
+ final int kern = font.getKernValue(foText.charAt(lastIndex - 1), ch);
if (kern != 0) {
this.addToLetterAdjust(lastIndex, kern);
+ //TODO: add kern to wordIPD?
}
}
int iLetterSpaces = wordLength - 1;
@@ -765,20 +766,20 @@
wordIPD.add(MinOptMax.multiply(this.letterSpaceIPD, iLetterSpaces));
// create the AreaInfo object
- ai = new AreaInfo(this.thisStart, lastIndex, 0,
+ AreaInfo areaInfo = new AreaInfo(this.thisStart, lastIndex, 0,
iLetterSpaces, wordIPD,
endsWithHyphen,
false, breakOpportunity, font);
- prevAi = ai;
- this.vecAreaInfo.add(ai);
+ prevAreaInfo = areaInfo;
+ this.vecAreaInfo.add(areaInfo);
this.tempStart = this.nextStart;
//add the elements
- this.addElementsForAWordFragment(sequence, alignment, ai,
+ this.addElementsForAWordFragment(sequence, alignment, areaInfo,
this.vecAreaInfo.size() - 1, this.letterSpaceIPD);
- ai = null;
this.thisStart = this.nextStart;
- return prevAi;
+
+ return prevAreaInfo;
}
/** {@inheritDoc} */
Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java?rev=829138&r1=829137&r2=829138&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java Fri Oct 23 17:27:14 2009
@@ -298,14 +298,14 @@
int stepPenalty = 0;
KnuthElement endEl = (KnuthElement)elementLists[0].get(end[0]);
if (endEl instanceof KnuthPenalty) {
- additionalPenaltyHeight = endEl.getW();
- stepPenalty = Math.max(stepPenalty, endEl.getP());
+ additionalPenaltyHeight = endEl.getWidth();
+ stepPenalty = Math.max(stepPenalty, endEl.getPenalty());
}
endEl = (KnuthElement)elementLists[1].get(end[1]);
if (endEl instanceof KnuthPenalty) {
additionalPenaltyHeight = Math.max(
- additionalPenaltyHeight, endEl.getW());
- stepPenalty = Math.max(stepPenalty, endEl.getP());
+ additionalPenaltyHeight, endEl.getWidth());
+ stepPenalty = Math.max(stepPenalty, endEl.getPenalty());
}
int boxHeight = step - addedBoxHeight - penaltyHeight;
@@ -367,7 +367,7 @@
end[i]++;
KnuthElement el = (KnuthElement)elementLists[i].get(end[i]);
if (el.isPenalty()) {
- if (el.getP() < KnuthElement.INFINITE) {
+ if (el.getPenalty() < KnuthElement.INFINITE) {
//First legal break point
break;
}
@@ -379,9 +379,9 @@
break;
}
}
- partialHeights[i] += el.getW();
+ partialHeights[i] += el.getWidth();
} else {
- partialHeights[i] += el.getW();
+ partialHeights[i] += el.getWidth();
}
}
if (end[i] < start[i]) {
Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/table/ActiveCell.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/table/ActiveCell.java?rev=829138&r1=829137&r2=829138&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/table/ActiveCell.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/table/ActiveCell.java Fri Oct 23 17:27:14 2009
@@ -158,9 +158,9 @@
private int contentLength;
FillerPenalty(KnuthPenalty p, int length) {
- super(length, p.getP(), p.isFlagged(), p.getBreakClass(),
+ super(length, p.getPenalty(), p.isPenaltyFlagged(), p.getBreakClass(),
p.getPosition(), p.isAuxiliary());
- contentLength = p.getW();
+ contentLength = p.getWidth();
}
FillerPenalty(int length) {
@@ -190,7 +190,7 @@
} else if (el instanceof FillerBox) {
return 0;
} else {
- return el.getW();
+ return el.getWidth();
}
}
@@ -248,17 +248,17 @@
KnuthElement el = (KnuthElement) iter.next();
if (el.isBox()) {
prevIsBox = true;
- cumulateLength += el.getW();
+ cumulateLength += el.getWidth();
} else if (el.isGlue()) {
if (prevIsBox) {
elementList.add(iter.nextIndex() - 1,
new FillerPenalty(minBPD - cumulateLength));
}
prevIsBox = false;
- cumulateLength += el.getW();
+ cumulateLength += el.getWidth();
} else {
prevIsBox = false;
- if (cumulateLength + el.getW() < minBPD) {
+ if (cumulateLength + el.getWidth() < minBPD) {
iter.set(new FillerPenalty((KnuthPenalty) el, minBPD - cumulateLength));
}
}
@@ -314,7 +314,7 @@
KnuthElement el = (KnuthElement) knuthIter.next();
if (el.isPenalty()) {
prevIsBox = false;
- if (el.getP() < KnuthElement.INFINITE
+ if (el.getPenalty() < KnuthElement.INFINITE
|| ((KnuthPenalty) el).getBreakClass() == Constants.EN_PAGE) {
// TODO too much is being done in that test, only to handle
// keep.within-column properly.
@@ -322,8 +322,8 @@
// First legal break point
breakFound = true;
KnuthPenalty p = (KnuthPenalty) el;
- afterNextStep.penaltyLength = p.getW();
- afterNextStep.penaltyValue = p.getP();
+ afterNextStep.penaltyLength = p.getWidth();
+ afterNextStep.penaltyValue = p.getPenalty();
if (p.isForcedBreak()) {
afterNextStep.breakClass = p.getBreakClass();
}
@@ -333,9 +333,9 @@
// Second legal break point
breakFound = true;
} else {
- afterNextStep.contentLength += el.getW();
+ afterNextStep.contentLength += el.getWidth();
if (!boxFound) {
- afterNextStep.condBeforeContentLength += el.getW();
+ afterNextStep.condBeforeContentLength += el.getWidth();
}
}
prevIsBox = false;
@@ -348,7 +348,7 @@
}
prevIsBox = true;
boxFound = true;
- afterNextStep.contentLength += el.getW();
+ afterNextStep.contentLength += el.getWidth();
}
}
afterNextStep.end = knuthIter.nextIndex() - 1;
Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/table/RowPainter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/table/RowPainter.java?rev=829138&r1=829137&r2=829138&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/table/RowPainter.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/table/RowPainter.java Fri Oct 23 17:27:14 2009
@@ -361,7 +361,7 @@
while (iter.nextIndex() < endIndex) {
KnuthElement el = (KnuthElement) iter.next();
if (el.isBox() || el.isGlue()) {
- len += el.getW();
+ len += el.getWidth();
}
}
len += ActiveCell.getElementContentLength((KnuthElement) iter.next());
Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java?rev=829138&r1=829137&r2=829138&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java Fri Oct 23 17:27:14 2009
@@ -202,7 +202,7 @@
if (lastItem.isForcedBreak()) {
KnuthPenalty p = (KnuthPenalty) lastItem;
primaryGridUnit.setBreakAfter(p.getBreakClass());
- p.setP(0);
+ p.setPenalty(0);
}
setFinished(true);
Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/pdf/PDFFontNonBase14.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/pdf/PDFFontNonBase14.java?rev=829138&r1=829137&r2=829138&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/pdf/PDFFontNonBase14.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/pdf/PDFFontNonBase14.java Fri Oct 23 17:27:14 2009
@@ -76,7 +76,7 @@
if (getDocumentSafely().getProfile().isFontEmbeddingRequired()) {
if (this.getDescriptor().getFontFile() == null) {
throw new PDFConformanceException("For " + getDocumentSafely().getProfile()
- + ", all fonts have to be embedded!");
+ + ", all fonts have to be embedded! Offending font: " + getBaseFont());
}
}
}
Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/render/afp/AFPCustomizable.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/render/afp/AFPCustomizable.java?rev=829138&r1=829137&r2=829138&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/render/afp/AFPCustomizable.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/render/afp/AFPCustomizable.java Fri Oct 23 17:27:14 2009
@@ -51,6 +51,14 @@
void setNativeImagesSupported(boolean nativeImages);
/**
+ * Controls whether CMYK images (IOCA FS45) are enabled. By default, support is disabled
+ * for wider compatibility. When disabled, any CMYK image is converted to the selected
+ * color format.
+ * @param value true to enabled CMYK images
+ */
+ void setCMYKImagesSupported(boolean value);
+
+ /**
* Sets the shading mode for painting filled rectangles.
* @param shadingMode the shading mode
*/
Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java?rev=829138&r1=829137&r2=829138&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java Fri Oct 23 17:27:14 2009
@@ -357,6 +357,11 @@
}
/** {@inheritDoc} */
+ public void setCMYKImagesSupported(boolean value) {
+ paintingState.setCMYKImagesSupported(value);
+ }
+
+ /** {@inheritDoc} */
public void setShadingMode(AFPShadingMode shadingMode) {
this.shadingMode = shadingMode;
}
Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/render/afp/AFPImageHandlerRawStream.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/render/afp/AFPImageHandlerRawStream.java?rev=829138&r1=829137&r2=829138&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/render/afp/AFPImageHandlerRawStream.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/render/afp/AFPImageHandlerRawStream.java Fri Oct 23 17:27:14 2009
@@ -24,6 +24,7 @@
import org.apache.xmlgraphics.image.loader.impl.ImageRawEPS;
import org.apache.xmlgraphics.image.loader.impl.ImageRawJPEG;
import org.apache.xmlgraphics.image.loader.impl.ImageRawStream;
+import org.apache.xmlgraphics.util.MimeConstants;
import org.apache.fop.afp.AFPDataObjectInfo;
import org.apache.fop.render.RenderingContext;
@@ -35,6 +36,7 @@
private static final ImageFlavor[] FLAVORS = new ImageFlavor[] {
ImageFlavor.RAW_JPEG,
+ ImageFlavor.RAW_TIFF,
ImageFlavor.RAW_EPS,
};
@@ -63,7 +65,12 @@
if (targetContext instanceof AFPRenderingContext) {
AFPRenderingContext afpContext = (AFPRenderingContext)targetContext;
return (afpContext.getPaintingState().isNativeImagesSupported())
- && (image == null || image instanceof ImageRawJPEG || image instanceof ImageRawEPS);
+ && (image == null
+ || image instanceof ImageRawJPEG
+ || image instanceof ImageRawEPS
+ || ((image instanceof ImageRawStream)
+ && (MimeConstants.MIME_TIFF.equals(
+ ((ImageRawStream)image).getMimeType()))));
}
return false;
}
Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/render/afp/AFPImageHandlerRenderedImage.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/render/afp/AFPImageHandlerRenderedImage.java?rev=829138&r1=829137&r2=829138&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/render/afp/AFPImageHandlerRenderedImage.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/render/afp/AFPImageHandlerRenderedImage.java Fri Oct 23 17:27:14 2009
@@ -89,7 +89,11 @@
int resolution = paintingState.getResolution();
int maxPixelSize = paintingState.getBitsPerPixel();
if (paintingState.isColorImages()) {
- maxPixelSize *= 3; //RGB only at the moment
+ if (paintingState.isCMYKImagesSupported()) {
+ maxPixelSize *= 4; //CMYK is maximum
+ } else {
+ maxPixelSize *= 3; //RGB is maximum
+ }
}
RenderedImage renderedImage = imageRendered.getRenderedImage();
@@ -97,6 +101,7 @@
ImageSize intrinsicSize = imageInfo.getSize();
boolean useFS10 = (maxPixelSize == 1) || BitmapImageUtil.isMonochromeImage(renderedImage);
+ int functionSet = useFS10 ? 10 : 11;
boolean usePageSegments = useFS10
&& !imageObjectInfo.getResourceInfo().getLevel().isInline();
@@ -124,11 +129,6 @@
resampledDim.width, resampledDim.height, resolution);
}
}
- if (useFS10) {
- imageObjectInfo.setMimeType(MimeConstants.MIME_AFP_IOCA_FS10);
- } else {
- imageObjectInfo.setMimeType(MimeConstants.MIME_AFP_IOCA_FS11);
- }
imageObjectInfo.setDataHeightRes((int)Math.round(
effIntrinsicSize.getDpiHorizontal() * 10));
@@ -156,9 +156,9 @@
byte[] imageData = null;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
boolean allowDirectEncoding = true;
- if (allowDirectEncoding && pixelSize <= maxPixelSize) {
+ if (allowDirectEncoding && (pixelSize <= maxPixelSize)) {
//Attempt to encode without resampling the image
- ImageEncodingHelper helper = new ImageEncodingHelper(renderedImage);
+ ImageEncodingHelper helper = new ImageEncodingHelper(renderedImage, pixelSize == 32);
ColorModel encodedColorModel = helper.getEncodedColorModel();
boolean directEncode = true;
if (helper.getEncodedColorModel().getPixelSize() > maxPixelSize) {
@@ -180,6 +180,9 @@
log.trace("set subtractive mode");
imageObjectInfo.setSubtractive(true);
}
+ if (pixelSize == 32) {
+ functionSet = 45; //IOCA FS45 required for CMYK
+ }
helper.encode(baos);
imageData = baos.toByteArray();
@@ -191,6 +194,7 @@
//Convert image to 24bit RGB
ImageEncodingHelper.encodeRenderedImageAsRGB(renderedImage, baos);
imageData = baos.toByteArray();
+ imageObjectInfo.setBitsPerPixel(24);
boolean colorImages = paintingState.isColorImages();
imageObjectInfo.setColor(colorImages);
@@ -212,6 +216,20 @@
}
}
+ switch (functionSet) {
+ case 10:
+ imageObjectInfo.setMimeType(MimeConstants.MIME_AFP_IOCA_FS10);
+ break;
+ case 11:
+ imageObjectInfo.setMimeType(MimeConstants.MIME_AFP_IOCA_FS11);
+ break;
+ case 45:
+ imageObjectInfo.setMimeType(MimeConstants.MIME_AFP_IOCA_FS45);
+ break;
+ default:
+ throw new IllegalStateException("Invalid IOCA function set: " + functionSet);
+ }
+
imageObjectInfo.setData(imageData);
// set object area info
Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/render/afp/AFPRenderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/render/afp/AFPRenderer.java?rev=829138&r1=829137&r2=829138&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/render/afp/AFPRenderer.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/render/afp/AFPRenderer.java Fri Oct 23 17:27:14 2009
@@ -90,8 +90,8 @@
import org.apache.fop.render.afp.extensions.AFPExtensionAttachment;
import org.apache.fop.render.afp.extensions.AFPIncludeFormMap;
import org.apache.fop.render.afp.extensions.AFPInvokeMediumMap;
-import org.apache.fop.render.afp.extensions.AFPPageSetup;
import org.apache.fop.render.afp.extensions.AFPPageOverlay;
+import org.apache.fop.render.afp.extensions.AFPPageSetup;
/**
* This is an implementation of a FOP Renderer that renders areas to AFP.
@@ -444,6 +444,7 @@
ImageFlavor.XML_DOM,
/*ImageFlavor.RAW_PNG, */ // PNG not natively supported in AFP
ImageFlavor.RAW_JPEG, ImageFlavor.RAW_CCITTFAX, ImageFlavor.RAW_EPS,
+ ImageFlavor.RAW_TIFF,
ImageFlavor.GRAPHICS2D, ImageFlavor.BUFFERED_IMAGE, ImageFlavor.RENDERED_IMAGE };
private static final ImageFlavor[] FLAVORS = new ImageFlavor[] {
@@ -831,6 +832,11 @@
}
/** {@inheritDoc} */
+ public void setCMYKImagesSupported(boolean value) {
+ paintingState.setCMYKImagesSupported(value);
+ }
+
+ /** {@inheritDoc} */
public void setShadingMode(AFPShadingMode shadingMode) {
this.shadingMode = shadingMode;
}
Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/render/afp/AFPRendererConfigurator.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/render/afp/AFPRendererConfigurator.java?rev=829138&r1=829137&r2=829138&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/render/afp/AFPRendererConfigurator.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/render/afp/AFPRendererConfigurator.java Fri Oct 23 17:27:14 2009
@@ -318,6 +318,9 @@
String imagesMode = imagesCfg.getAttribute("mode", IMAGES_MODE_GRAYSCALE);
if (IMAGES_MODE_COLOR.equals(imagesMode)) {
customizable.setColorImages(true);
+
+ boolean cmyk = imagesCfg.getAttributeAsBoolean("cmyk", false);
+ customizable.setCMYKImagesSupported(cmyk);
} else {
customizable.setColorImages(false);
// default to 8 bits per pixel
Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/render/intermediate/AbstractIFDocumentHandler.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Oct 23 17:27:14 2009
@@ -1 +1 @@
-/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/intermediate/AbstractIFDocumentHandler.java:699793-824832
+/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/intermediate/AbstractIFDocumentHandler.java:699793-829121
Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/render/intermediate/IFContentHandler.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Oct 23 17:27:14 2009
@@ -1 +1 @@
-/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/intermediate/IFContentHandler.java:680381-824832
+/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/intermediate/IFContentHandler.java:680381-829121
Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/render/intermediate/IFPainter.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Oct 23 17:27:14 2009
@@ -1 +1 @@
-/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/intermediate/IFPainter.java:680381-824832
+/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/intermediate/IFPainter.java:680381-829121
Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/render/intermediate/IFRenderer.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Oct 23 17:27:14 2009
@@ -1 +1 @@
-/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/intermediate/IFRenderer.java:680381-824832
+/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/intermediate/IFRenderer.java:680381-829121
Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/render/intermediate/extensions/DocumentNavigationExtensionConstants.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Oct 23 17:27:14 2009
@@ -1 +1 @@
-/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/intermediate/extensions/DocumentNavigationExtensionConstants.java:685127-824832
+/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/intermediate/extensions/DocumentNavigationExtensionConstants.java:685127-829121
Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/render/pcl/PCLDocumentHandler.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Oct 23 17:27:14 2009
@@ -1 +1 @@
-/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLDocumentHandler.java:699793-824832
+/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLDocumentHandler.java:699793-829121
Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/render/pcl/PCLDocumentHandlerMaker.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Oct 23 17:27:14 2009
@@ -1 +1 @@
-/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLDocumentHandlerMaker.java:699793-824832
+/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLDocumentHandlerMaker.java:699793-829121
Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/render/pdf/PDFDocumentHandler.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Oct 23 17:27:14 2009
@@ -1 +1 @@
-/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFDocumentHandler.java:699793-824832
+/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFDocumentHandler.java:699793-829121
Modified: xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/tools/anttasks/Fop.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/tools/anttasks/Fop.java?rev=829138&r1=829137&r2=829138&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/tools/anttasks/Fop.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/tools/anttasks/Fop.java Fri Oct 23 17:27:14 2009
@@ -34,6 +34,7 @@
import java.io.OutputStream;
import java.net.MalformedURLException;
import java.util.List;
+import java.util.Vector;
// FOP
import org.apache.fop.apps.FOPException;
@@ -67,7 +68,10 @@
public class Fop extends Task {
private File foFile;
- private List filesets = new java.util.ArrayList();
+ private File xmlFile;
+ private File xsltFile;
+ private String xsltParams;
+ private List/*<FileSet>*/ filesets = new java.util.ArrayList/*<FileSet>*/();
private File outFile;
private File outDir;
private String format; //MIME type
@@ -112,6 +116,54 @@
}
/**
+ * Gets the input XML file.
+ * @return the input XML file.
+ */
+ public File getXmlFile() {
+ return xmlFile;
+ }
+
+ /**
+ * Sets the input XML file.
+ * @param xmlFile the input XML file.
+ */
+ public void setXmlFile(File xmlFile) {
+ this.xmlFile = xmlFile;
+ }
+
+ /**
+ * Gets the input XSLT file.
+ * @return the input XSLT file.
+ */
+ public File getXsltFile() {
+ return xsltFile;
+ }
+
+ /**
+ * Sets the input XSLT file.
+ * @param xsltFile the input XSLT file.
+ */
+ public void setXsltFile(File xsltFile) {
+ this.xsltFile = xsltFile;
+ }
+
+ /**
+ * Gets the XSLT parameters
+ * @return the XSLT parameters
+ */
+ public String getXsltParams() {
+ return xsltParams;
+ }
+
+ /**
+ * Sets the XSLT parameters
+ * @param xsltParams the XSLT parameters
+ */
+ public void setXsltParams(String xsltParams) {
+ this.xsltParams = xsltParams;
+ }
+
+ /**
* Adds a set of XSL-FO files (nested fileset attribute).
* @param set a fileset
*/
@@ -491,10 +543,39 @@
skippedcount++;
}
}
+ } else if (task.getXmlFile() != null && task.getXsltFile() != null) {
+ if (task.getXmlFile().exists() && task.getXsltFile().exists()) {
+ File outf = task.getOutfile();
+ if (outf == null) {
+ throw new BuildException("outfile is required when fofile is used");
+ }
+ if (task.getOutdir() != null) {
+ outf = new File(task.getOutdir(), outf.getName());
+ }
+ // Render if "force" flag is set OR
+ // OR output file doesn't exist OR
+ // output file is older than input file
+ if (task.getForce() || !outf.exists()
+ || (task.getXmlFile().lastModified() > outf.lastModified() ||
+ task.getXsltFile().lastModified() > outf.lastModified())) {
+ render(task.getXmlFile(), task.getXsltFile(), outf, outputFormat);
+ actioncount++;
+ } else if (outf.exists()
+ && (task.getXmlFile().lastModified() <= outf.lastModified() ||
+ task.getXsltFile().lastModified() <= outf.lastModified())) {
+ skippedcount++;
+ }
+ }
}
GlobPatternMapper mapper = new GlobPatternMapper();
- mapper.setFrom("*.fo");
+
+ String inputExtension = ".fo";
+ File xsltFile = task.getXsltFile();
+ if (xsltFile != null) {
+ inputExtension = ".xml";
+ }
+ mapper.setFrom("*" + inputExtension);
mapper.setTo("*" + newExtension);
// deal with the filesets
@@ -507,16 +588,19 @@
File f = new File(fs.getDir(task.getProject()), files[j]);
File outf = null;
- if (task.getOutdir() != null && files[j].endsWith(".fo")) {
+ if (task.getOutdir() != null && files[j].endsWith(inputExtension)) {
String[] sa = mapper.mapFileName(files[j]);
outf = new File(task.getOutdir(), sa[0]);
} else {
- outf = replaceExtension(f, ".fo", newExtension);
+ outf = replaceExtension(f, inputExtension, newExtension);
if (task.getOutdir() != null) {
outf = new File(task.getOutdir(), outf.getName());
}
}
-
+ File dir = outf.getParentFile();
+ if (!dir.exists()) {
+ dir.mkdirs();
+ }
try {
if (task.getRelativebase()) {
this.baseURL = f.getParentFile().toURI().toURL().
@@ -536,7 +620,11 @@
// output file is older than input file
if (task.getForce() || !outf.exists()
|| (f.lastModified() > outf.lastModified() )) {
- render(f, outf, outputFormat);
+ if (xsltFile != null) {
+ render(f, xsltFile, outf, outputFormat);
+ } else {
+ render(f, outf, outputFormat);
+ }
actioncount++;
} else if (outf.exists() && (f.lastModified() <= outf.lastModified() )) {
skippedcount++;
@@ -554,10 +642,7 @@
}
}
- private void render(File foFile, File outFile,
- String outputFormat) throws FOPException {
- InputHandler inputHandler = new InputHandler(foFile);
-
+ private void renderInputHandler(InputHandler inputHandler, File outFile, String outputFormat) throws Exception {
OutputStream out = null;
try {
out = new java.io.FileOutputStream(outFile);
@@ -565,11 +650,6 @@
} catch (Exception ex) {
throw new BuildException("Failed to open " + outFile, ex);
}
-
- if (task.getLogFiles()) {
- task.log(foFile + " -> " + outFile, Project.MSG_INFO);
- }
-
boolean success = false;
try {
FOUserAgent userAgent = fopFactory.newFOUserAgent();
@@ -580,7 +660,7 @@
if (task.getThrowexceptions()) {
throw new BuildException(ex);
}
- logger.error("Error rendering fo file: " + foFile, ex);
+ throw ex;
} finally {
try {
out.close();
@@ -593,5 +673,31 @@
}
}
+ private void render(File foFile, File outFile,
+ String outputFormat) throws FOPException {
+ InputHandler inputHandler = new InputHandler(foFile);
+ try {
+ renderInputHandler(inputHandler, outFile, outputFormat);
+ } catch (Exception ex) {
+ logger.error("Error rendering fo file: " + foFile, ex);
+ }
+ if (task.getLogFiles()) {
+ task.log(foFile + " -> " + outFile, Project.MSG_INFO);
+ }
+ }
+
+ private void render(File xmlFile, File xsltFile, File outFile, String outputFormat) {
+ //TODO: implement support for XSLT params
+ final Vector xsltParams = null;
+ InputHandler inputHandler = new InputHandler(xmlFile, xsltFile, xsltParams);
+ try {
+ renderInputHandler(inputHandler, outFile, outputFormat);
+ } catch (Exception ex) {
+ logger.error("Error rendering xml/xslt files: " + xmlFile + ", " + xsltFile, ex);
+ }
+ if (task.getLogFiles()) {
+ task.log("xml: " + xmlFile + ", xslt: " + xsltFile + " -> " + outFile, Project.MSG_INFO);
+ }
+ }
}
Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/sandbox/org/apache/fop/render/svg/AbstractSVGDocumentHandler.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Oct 23 17:27:14 2009
@@ -1 +1 @@
-/xmlgraphics/fop/trunk/src/sandbox/org/apache/fop/render/svg/AbstractSVGDocumentHandler.java:699793-824832
+/xmlgraphics/fop/trunk/src/sandbox/org/apache/fop/render/svg/AbstractSVGDocumentHandler.java:699793-829121
Propchange: xmlgraphics/fop/branches/Temp_Accessibility/src/sandbox/org/apache/fop/render/svg/SVGDocumentHandler.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Oct 23 17:27:14 2009
@@ -1 +1 @@
-/xmlgraphics/fop/trunk/src/sandbox/org/apache/fop/render/svg/SVGDocumentHandler.java:699793-824832
+/xmlgraphics/fop/trunk/src/sandbox/org/apache/fop/render/svg/SVGDocumentHandler.java:699793-829121
Modified: xmlgraphics/fop/branches/Temp_Accessibility/status.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/status.xml?rev=829138&r1=829137&r2=829138&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/status.xml (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/status.xml Fri Oct 23 17:27:14 2009
@@ -61,6 +61,18 @@
<action context="Renderers" dev="JM" type="add" fixes-bug="46705" due-to="Jost Klopfstein">
Added basic accessibility and Tagged PDF support.
</action>
+ <action context="Code" dev="JM" type="add">
+ Added support for encoding CMYK bitmap images (IOCA FS45) and TIFF images as embedded objects.
+ </action>
+ <action context="Code" dev="AC" type="add">
+ Added support for xmlfile and xsltfile parameters in FOP's Ant Task.
+ </action>
+ <action context="Renderers" dev="AC" type="fix" fixes-bug="47941">
+ BugFix: Maintain valid AFP by providing TLE truncation on Attribute Value Triplet values that are greater than 250 chars in length.
+ </action>
+ <action context="Fonts" dev="JM" type="fix" fixes-bug="47711" due-to="Nicolas Peninguy">
+ Fixed generation of CIDSet object in PDF output.
+ </action>
<action context="Layout" dev="VH" type="fix">
Fixed handling of percentage values for provisional-label-separation.
</action>
Modified: xmlgraphics/fop/branches/Temp_Accessibility/test/java/org/apache/fop/layoutengine/ElementListCheck.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/test/java/org/apache/fop/layoutengine/ElementListCheck.java?rev=829138&r1=829137&r2=829138&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/test/java/org/apache/fop/layoutengine/ElementListCheck.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/test/java/org/apache/fop/layoutengine/ElementListCheck.java Fri Oct 23 17:27:14 2009
@@ -83,10 +83,10 @@
}
if (domEl.getAttribute("w").length() > 0) {
int w = Integer.parseInt(domEl.getAttribute("w"));
- if (w != knuthEl.getW()) {
+ if (w != knuthEl.getWidth()) {
fail("Expected w=" + w
+ " at position " + pos
- + " but got: " + knuthEl.getW());
+ + " but got: " + knuthEl.getWidth());
}
}
if ("true".equals(domEl.getAttribute("aux"))) {
@@ -110,24 +110,24 @@
KnuthPenalty pen = (KnuthPenalty)knuthEl;
if (domEl.getAttribute("w").length() > 0) {
int w = Integer.parseInt(domEl.getAttribute("w"));
- if (w != knuthEl.getW()) {
+ if (w != knuthEl.getWidth()) {
fail("Expected w=" + w
+ " at position " + pos
- + " but got: " + knuthEl.getW());
+ + " but got: " + knuthEl.getWidth());
}
}
if (domEl.getAttribute("p").length() > 0) {
if ("<0".equals(domEl.getAttribute("p"))) {
- if (knuthEl.getP() >= 0) {
+ if (knuthEl.getPenalty() >= 0) {
fail("Expected p<0"
+ " at position " + pos
- + " but got: " + knuthEl.getP());
+ + " but got: " + knuthEl.getPenalty());
}
} else if (">0".equals(domEl.getAttribute("p"))) {
- if (knuthEl.getP() <= 0) {
+ if (knuthEl.getPenalty() <= 0) {
fail("Expected p>0"
+ " at position " + pos
- + " but got: " + knuthEl.getP());
+ + " but got: " + knuthEl.getPenalty());
}
} else {
int p;
@@ -142,20 +142,20 @@
} else {
p = Integer.parseInt(domEl.getAttribute("p"));
}
- if (p != knuthEl.getP()) {
+ if (p != knuthEl.getPenalty()) {
fail("Expected p=" + p
+ " at position " + pos
- + " but got: " + knuthEl.getP());
+ + " but got: " + knuthEl.getPenalty());
}
}
}
if ("true".equals(domEl.getAttribute("flagged"))) {
- if (!pen.isFlagged()) {
+ if (!pen.isPenaltyFlagged()) {
fail("Expected flagged penalty"
+ " at position " + pos);
}
} else if ("false".equals(domEl.getAttribute("flagged"))) {
- if (pen.isFlagged()) {
+ if (pen.isPenaltyFlagged()) {
fail("Expected non-flagged penalty"
+ " at position " + pos);
}
@@ -180,26 +180,26 @@
KnuthGlue glue = (KnuthGlue)knuthEl;
if (domEl.getAttribute("w").length() > 0) {
int w = Integer.parseInt(domEl.getAttribute("w"));
- if (w != knuthEl.getW()) {
+ if (w != knuthEl.getWidth()) {
fail("Expected w=" + w
+ " at position " + pos
- + " but got: " + knuthEl.getW());
+ + " but got: " + knuthEl.getWidth());
}
}
if (domEl.getAttribute("y").length() > 0) {
int stretch = Integer.parseInt(domEl.getAttribute("y"));
- if (stretch != knuthEl.getY()) {
+ if (stretch != knuthEl.getStretch()) {
fail("Expected y=" + stretch
+ " (stretch) at position " + pos
- + " but got: " + knuthEl.getY());
+ + " but got: " + knuthEl.getStretch());
}
}
if (domEl.getAttribute("z").length() > 0) {
int shrink = Integer.parseInt(domEl.getAttribute("z"));
- if (shrink != knuthEl.getZ()) {
+ if (shrink != knuthEl.getShrink()) {
fail("Expected z=" + shrink
+ " (shrink) at position " + pos
- + " but got: " + knuthEl.getZ());
+ + " but got: " + knuthEl.getShrink());
}
}
} else {
Modified: xmlgraphics/fop/branches/Temp_Accessibility/test/java/org/apache/fop/util/ElementListUtilsTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/test/java/org/apache/fop/util/ElementListUtilsTestCase.java?rev=829138&r1=829137&r2=829138&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_Accessibility/test/java/org/apache/fop/util/ElementListUtilsTestCase.java (original)
+++ xmlgraphics/fop/branches/Temp_Accessibility/test/java/org/apache/fop/util/ElementListUtilsTestCase.java Fri Oct 23 17:27:14 2009
@@ -55,9 +55,9 @@
assertFalse(res);
- assertEquals(KnuthElement.INFINITE, ((KnuthPenalty)lst.get(1)).getP());
- assertEquals(KnuthElement.INFINITE, ((KnuthPenalty)lst.get(3)).getP());
- assertEquals(0, ((KnuthPenalty)lst.get(5)).getP());
+ assertEquals(KnuthElement.INFINITE, ((KnuthPenalty)lst.get(1)).getPenalty());
+ assertEquals(KnuthElement.INFINITE, ((KnuthPenalty)lst.get(3)).getPenalty());
+ assertEquals(0, ((KnuthPenalty)lst.get(5)).getPenalty());
}
/**
@@ -82,11 +82,11 @@
assertFalse(res);
//Must insert an INFINITE penalty
- assertEquals(KnuthElement.INFINITE, ((KnuthPenalty)lst.get(1)).getP());
- assertEquals(0, ((KnuthGlue)lst.get(2)).getW());
- assertEquals(KnuthElement.INFINITE, ((KnuthPenalty)lst.get(4)).getP());
- assertEquals(0, ((KnuthGlue)lst.get(5)).getW());
- assertEquals(0, ((KnuthGlue)lst.get(7)).getW());
+ assertEquals(KnuthElement.INFINITE, ((KnuthPenalty)lst.get(1)).getPenalty());
+ assertEquals(0, ((KnuthGlue)lst.get(2)).getWidth());
+ assertEquals(KnuthElement.INFINITE, ((KnuthPenalty)lst.get(4)).getPenalty());
+ assertEquals(0, ((KnuthGlue)lst.get(5)).getWidth());
+ assertEquals(0, ((KnuthGlue)lst.get(7)).getWidth());
}
/**
@@ -110,9 +110,9 @@
assertFalse(res);
- assertEquals(0, ((KnuthPenalty)lst.get(1)).getP());
- assertEquals(KnuthElement.INFINITE, ((KnuthPenalty)lst.get(3)).getP());
- assertEquals(KnuthElement.INFINITE, ((KnuthPenalty)lst.get(5)).getP());
+ assertEquals(0, ((KnuthPenalty)lst.get(1)).getPenalty());
+ assertEquals(KnuthElement.INFINITE, ((KnuthPenalty)lst.get(3)).getPenalty());
+ assertEquals(KnuthElement.INFINITE, ((KnuthPenalty)lst.get(5)).getPenalty());
}
/**
@@ -137,10 +137,10 @@
assertFalse(res);
//Must insert an INFINITE penalty
- assertEquals(0, ((KnuthPenalty)lst.get(1)).getP());
- assertEquals(KnuthElement.INFINITE, ((KnuthPenalty)lst.get(3)).getP());
- assertEquals(KnuthElement.INFINITE, ((KnuthPenalty)lst.get(5)).getP());
- assertEquals(0, ((KnuthGlue)lst.get(6)).getW());
+ assertEquals(0, ((KnuthPenalty)lst.get(1)).getPenalty());
+ assertEquals(KnuthElement.INFINITE, ((KnuthPenalty)lst.get(3)).getPenalty());
+ assertEquals(KnuthElement.INFINITE, ((KnuthPenalty)lst.get(5)).getPenalty());
+ assertEquals(0, ((KnuthGlue)lst.get(6)).getWidth());
}
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org