[FOray-commit] SF.net SVN: foray: [8325] trunk/foray
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2006-10-07 15:44:22
|
Revision: 8325
http://svn.sourceforge.net/foray/?rev=8325&view=rev
Author: victormote
Date: 2006-10-07 08:44:06 -0700 (Sat, 07 Oct 2006)
Log Message:
-----------
Make all instance variables private and enforce the checkstyle rule to that effect.
Modified Paths:
--------------
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/AbstractTableBodyPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/BlockPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FONodePL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FOTextPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FObjPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/ListBlockPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/RowSpanMgr.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/StaticContentPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TablePL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableRowPL.java
trunk/foray/scripts/checkstyle-suppressions.xml
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/AbstractTableBodyPL.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/AbstractTableBodyPL.java 2006-10-07 15:33:50 UTC (rev 8324)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/AbstractTableBodyPL.java 2006-10-07 15:44:06 UTC (rev 8325)
@@ -132,7 +132,7 @@
if (getProgress() == FONodePL.START) {
if (area instanceof NormalBlockArea) {
- layout.completeCurrentLineInBlock((NormalBlockArea) area);
+ getLayout().completeCurrentLineInBlock((NormalBlockArea) area);
}
if (rowSpanMgr == null) {
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/BlockPL.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/BlockPL.java 2006-10-07 15:33:50 UTC (rev 8324)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/BlockPL.java 2006-10-07 15:44:06 UTC (rev 8325)
@@ -74,7 +74,8 @@
breakStatusBeforeChecked = true;
// no break if first in area tree, or leading in context
// area
- final int breakBeforeStatus = layout.checkBreakBefore(node, area);
+ final int breakBeforeStatus = getLayout().checkBreakBefore(node,
+ area);
if (breakBeforeStatus != Status.OK) {
return breakBeforeStatus;
}
@@ -100,7 +101,7 @@
noLayoutCount = 0;
if (area instanceof NormalBlockArea) {
- layout.completeCurrentLineInBlock((NormalBlockArea) area);
+ getLayout().completeCurrentLineInBlock((NormalBlockArea) area);
}
setProgress(0);
}
@@ -130,8 +131,8 @@
anythingLaidOut = true;
}
- layout.completeCurrentLineInBlock(blockArea);
- layout.setLineBreaker(null);
+ getLayout().completeCurrentLineInBlock(blockArea);
+ getLayout().setLineBreaker(null);
// no break if last in area tree, or trailing in context
// area
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FONodePL.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FONodePL.java 2006-10-07 15:33:50 UTC (rev 8324)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FONodePL.java 2006-10-07 15:44:06 UTC (rev 8325)
@@ -64,9 +64,9 @@
* for FObjs it is the child number
* for FOText it is the character number
*/
- protected int progress = START;
+ private int progress = START;
- protected PioneerLS layout;
+ private PioneerLS layout;
/** The real FONode which this proxy represents. */
private FONode realFONode;
@@ -275,4 +275,11 @@
return this.realFONode;
}
+ /**
+ * @return Returns the layout.
+ */
+ public PioneerLS getLayout() {
+ return this.layout;
+ }
+
}
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FOTextPL.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FOTextPL.java 2006-10-07 15:33:50 UTC (rev 8324)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FOTextPL.java 2006-10-07 15:44:06 UTC (rev 8325)
@@ -86,7 +86,7 @@
final NormalBlockArea ba = la.ancestorWritableNormalBlockArea();
start = addTextItemToLine(la, lineText, start, end, retrieveMarker);
while (start != -1) {
- final BlockPL blockPL = this.layout.getBlockPL(ba);
+ final BlockPL blockPL = getLayout().getBlockPL(ba);
la = ba.createNextLineArea(false);
blockPL.setCurrentLineArea(la);
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FObjPL.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FObjPL.java 2006-10-07 15:33:50 UTC (rev 8324)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FObjPL.java 2006-10-07 15:44:06 UTC (rev 8325)
@@ -60,14 +60,14 @@
ArrayList snapshot = inputSnapshot;
snapshot = super.getProgressSnapshot(snapshot);
// terminate if no kids or child not yet accessed
- if (this.progress < 0) {
+ if (getProgress() < 0) {
return snapshot;
}
final List children = getChildren();
if (children.isEmpty()) {
return snapshot;
}
- final FONode node = (FONode) children.get(this.progress);
+ final FONode node = (FONode) children.get(getProgress());
final FONodePL proxy = getLayoutProxy(node);
return proxy.getProgressSnapshot(snapshot);
}
@@ -75,16 +75,16 @@
public void rollback(final ArrayList snapshot) {
super.rollback(snapshot);
final List children = getChildren();
- if ((this.progress == -1)
+ if ((getProgress() == -1)
|| children.isEmpty()
- || this.progress <= START) {
+ || getProgress() <= START) {
return;
}
- for (int i = this.progress + 1; i < children.size(); i++) {
+ for (int i = getProgress() + 1; i < children.size(); i++) {
final FONode fo = (FONode) children.get(i);
getLayoutProxy(fo).resetProgress();
}
- final FONode node = (FONode) children.get(this.progress);
+ final FONode node = (FONode) children.get(getProgress());
getLayoutProxy(node).rollback(snapshot);
}
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/ListBlockPL.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/ListBlockPL.java 2006-10-07 15:33:50 UTC (rev 8324)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/ListBlockPL.java 2006-10-07 15:44:06 UTC (rev 8325)
@@ -57,7 +57,7 @@
listBlockPL.setProgress(0);
if (area instanceof NormalBlockArea) {
- layout.completeCurrentLineInBlock((NormalBlockArea) area);
+ getLayout().completeCurrentLineInBlock((NormalBlockArea) area);
}
}
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/RowSpanMgr.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/RowSpanMgr.java 2006-10-07 15:33:50 UTC (rev 8324)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/RowSpanMgr.java 2006-10-07 15:44:06 UTC (rev 8325)
@@ -40,20 +40,18 @@
* Inner class storing information for one span item.
*/
class SpanInfo {
- int cellHeight;
- int totalRowHeight;
- int rowsRemaining;
+ private int cellHeight;
+ private int totalRowHeight;
+ private int rowsRemaining;
// int numCols; // both V and H span
- TableCell cell;
- PioneerLS layout;
+ private TableCell cell;
SpanInfo(final TableCell cell, final int cellHeight,
- final int rowsSpanned, final PioneerLS layout) {
+ final int rowsSpanned) {
this.cell = cell;
this.cellHeight = cellHeight;
this.totalRowHeight = 0;
this.rowsRemaining = rowsSpanned;
- this.layout = layout;
}
/**
@@ -96,11 +94,10 @@
public void addRowSpan(final TableCell cell, final int firstCol,
final int numCols, final int cellHeight, final int rowsSpanned,
final PioneerLS layout) {
- spanInfo[firstCol - 1] = new SpanInfo(cell, cellHeight, rowsSpanned,
- layout);
+ spanInfo[firstCol - 1] = new SpanInfo(cell, cellHeight, rowsSpanned);
for (int i = 0; i < numCols - 1; i++) {
spanInfo[firstCol + i] = new SpanInfo(null, cellHeight,
- rowsSpanned, layout); // copy!
+ rowsSpanned); // copy!
}
}
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/StaticContentPL.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/StaticContentPL.java 2006-10-07 15:33:50 UTC (rev 8324)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/StaticContentPL.java 2006-10-07 15:44:06 UTC (rev 8325)
@@ -56,8 +56,8 @@
if (Status.isIncomplete(status)) {
/* in fact all should be laid out and clip, error etc depending
* on 'overflow' */
- layout.getLogger().warn("Some static content could not fit in "
- + "the area.");
+ getLayout().getLogger().warn("Some static content could not "
+ + "fit in the area.");
setProgress(i);
if ((i != 0) && (status == Status.AREA_FULL_NONE)) {
status = Status.AREA_FULL_SOME;
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TablePL.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TablePL.java 2006-10-07 15:33:50 UTC (rev 8324)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TablePL.java 2006-10-07 15:44:06 UTC (rev 8325)
@@ -67,11 +67,11 @@
if (getProgress() == FONodePL.START) {
if (node.traitTableLayout() == Constants.FOVAL_AUTO) {
- layout.getLogger().warn("table-layout=auto is not supported, "
- + "using fixed!");
+ getLayout().getLogger().warn("table-layout=auto is not "
+ + "supported, using fixed!");
}
if (area instanceof NormalBlockArea) {
- layout.completeCurrentLineInBlock((NormalBlockArea) area);
+ getLayout().completeCurrentLineInBlock((NormalBlockArea) area);
}
setProgress(0);
@@ -97,7 +97,7 @@
boolean addedFooter = false;
if (node.numberOfColumns() == 0) {
- layout.getLogger().warn("current implementation of tables "
+ getLayout().getLogger().warn("current implementation of tables "
+ "requires a table-column for each column, "
+ "indicating column-width");
}
@@ -220,8 +220,8 @@
// from the last table body and place it on the
// next page so that it can have a footer at
// the end of the table.
- layout.getLogger().warn("footer could not fit on page, moving "
- + "last body row to next page");
+ getLayout().getLogger().warn("footer could not fit on page, "
+ + "moving last body row to next page");
area.incrementProgressionDimension(areaContainer.crBPD());
final TableFooterPL tableFooterPL
= (TableFooterPL) this.getLayoutProxy(tf);
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableRowPL.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableRowPL.java 2006-10-07 15:33:50 UTC (rev 8324)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableRowPL.java 2006-10-07 15:44:06 UTC (rev 8325)
@@ -95,7 +95,7 @@
cellColNum = colNum;
} else if (cellColNum > columns.length) {
// Explicit colomn number specification out of range, skip it.
- layout.getLogger().error("Cell (#" + i + ") explicitly "
+ getLayout().getLogger().error("Cell (#" + i + ") explicitly "
+ "positioned beyond number of columns, dropped:\n"
+ cell.getContextMessage());
continue;
@@ -103,15 +103,15 @@
// see if it fits and doesn't overwrite anything
if (cellColNum + numCols - 1 > columns.length) {
// Too many columns spanned.
- layout.getLogger().error("Cell (#" + i + ") spans columns "
+ getLayout().getLogger().error("Cell (#" + i + ") spans columns "
+ "beyond available number, clipped:\n"
+ cell.getContextMessage());
numCols = columns.length - cellColNum + 1;
}
// Check for overwriting other cells (returns false)
if (cellArray.storeCell(cell, cellColNum, numCols) == false) {
- layout.getLogger().error("Cell (#" + i + ") overwrites other "
- + "cells:\n"
+ getLayout().getLogger().error("Cell (#" + i + ") overwrites "
+ + "other cells:\n"
+ cell.getContextMessage());
}
if (cellColNum > colNum) {
@@ -120,7 +120,7 @@
} else if (cellColNum < colNum) {
// Cells out of order
colNum = cellColNum; // CR "to the letter"!
- layout.getLogger().debug("Cell positioned out of order:\n"
+ getLayout().getLogger().debug("Cell positioned out of order:\n"
+ cell.getContextMessage());
}
colNum += numCols; // next cell in this column
@@ -150,7 +150,7 @@
// laid out yet (with an id created already)
}
setProgress(0);
- final int breakStatus = layout.checkBreakBefore(node, area);
+ final int breakStatus = getLayout().checkBreakBefore(node, area);
if (breakStatus != Status.OK) {
return breakStatus;
}
@@ -230,7 +230,8 @@
final int h = cellPL.getHeight(area);
if (rowSpan > 1) { // pass cell fo or area???
rowSpanMgr.addRowSpan(cell, iColIndex,
- cell.traitNumberColumnsSpanned(), h, rowSpan, layout);
+ cell.traitNumberColumnsSpanned(), h, rowSpan,
+ getLayout());
} else if (h > largestCellHeight) {
largestCellHeight = h;
}
Modified: trunk/foray/scripts/checkstyle-suppressions.xml
===================================================================
--- trunk/foray/scripts/checkstyle-suppressions.xml 2006-10-07 15:33:50 UTC (rev 8324)
+++ trunk/foray/scripts/checkstyle-suppressions.xml 2006-10-07 15:44:06 UTC (rev 8325)
@@ -52,8 +52,6 @@
<suppress checks="VisibilityModifier"
files="org.foray.pdf.*"/>
<suppress checks="VisibilityModifier"
- files="org.foray.pioneer.*"/>
- <suppress checks="VisibilityModifier"
files="org.foray.render.*"/>
<!-- Semi-permanent exemptions. -->
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|