[FOray-commit] SF.net SVN: foray: [8338] trunk/foray
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2006-10-07 19:07:09
|
Revision: 8338
http://svn.sourceforge.net/foray/?rev=8338&view=rev
Author: victormote
Date: 2006-10-07 12:07:03 -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-areatree/src/java/org/foray/area/AreaNode.java
trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/NormalBlockArea.java
trunk/foray/scripts/checkstyle-suppressions.xml
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java 2006-10-07 18:54:19 UTC (rev 8337)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java 2006-10-07 19:07:03 UTC (rev 8338)
@@ -52,7 +52,7 @@
public abstract class AreaNode extends OrderedTreeNode
implements org.axsl.areaR.AreaNode, org.axsl.areaW.AreaNode {
- protected ArrayList children = new ArrayList();
+ private ArrayList children = new ArrayList();
/** The "generated-by" trait, as defined in Section 6.1.1. */
private FOLinkage generatedBy;
@@ -506,4 +506,11 @@
this.generatedBy = newLinkage;
}
+ /**
+ * Removes the references to the child nodes from this Area.
+ */
+ protected void resetChildren() {
+ this.children = null;
+ }
+
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2006-10-07 18:54:19 UTC (rev 8337)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2006-10-07 19:07:03 UTC (rev 8338)
@@ -106,8 +106,8 @@
}
this.optimized = true;
// Resolve the page-number-citations.
- for (int i = 0; i < children.size(); i++) {
- final Object o = children.get(i);
+ for (int i = 0; i < getChildren().size(); i++) {
+ final Object o = getChildren().get(i);
if (o instanceof PageNumberCitationArea) {
final PageNumberCitationArea pia = (PageNumberCitationArea) o;
pia.resolve();
@@ -157,8 +157,8 @@
if (leaderSpaceAvailable == 0) {
return;
}
- for (int i = 0; i < children.size(); i++) {
- final Object object = children.get(i);
+ for (int i = 0; i < getChildren().size(); i++) {
+ final Object object = getChildren().get(i);
if (object instanceof LeaderArea) {
final LeaderArea leader = (LeaderArea) object;
boolean prorating = false;
@@ -182,8 +182,8 @@
private int computeLeaderCapacity(final int unusedSpace) {
// First, compute how much capacity the leaders have.
int leaderSpaceAvailable = 0;
- for (int i = 0; i < children.size(); i++) {
- final Object object = children.get(i);
+ for (int i = 0; i < getChildren().size(); i++) {
+ final Object object = getChildren().get(i);
if (object instanceof LeaderArea) {
final LeaderArea leader = (LeaderArea) object;
if (unusedSpace > 0) {
@@ -239,8 +239,8 @@
if (wordSpacingCapacity == 0) {
return;
}
- for (int i = 0; i < children.size(); i++) {
- final Object object = children.get(i);
+ for (int i = 0; i < getChildren().size(); i++) {
+ final Object object = getChildren().get(i);
if (object instanceof TextArea) {
final TextArea text = (TextArea) object;
boolean prorating = false;
@@ -261,8 +261,8 @@
*/
private int computeWordSpacingCapacity(final int unusedSpace) {
int wordSpacingCapacity = 0;
- for (int i = 0; i < children.size(); i++) {
- final Object object = children.get(i);
+ for (int i = 0; i < getChildren().size(); i++) {
+ final Object object = getChildren().get(i);
if (object instanceof TextArea) {
final TextArea text = (TextArea) object;
if (unusedSpace > 0) {
@@ -310,8 +310,8 @@
if (letterSpacingCapacity == 0) {
return;
}
- for (int i = 0; i < children.size(); i++) {
- final Object object = children.get(i);
+ for (int i = 0; i < getChildren().size(); i++) {
+ final Object object = getChildren().get(i);
if (object instanceof TextArea) {
final TextArea text = (TextArea) object;
boolean prorating = false;
@@ -332,8 +332,8 @@
*/
private int computeLetterSpacingCapacity(final int unusedSpace) {
int letterSpacingCapacity = 0;
- for (int i = 0; i < children.size(); i++) {
- final Object object = children.get(i);
+ for (int i = 0; i < getChildren().size(); i++) {
+ final Object object = getChildren().get(i);
if (object instanceof TextArea) {
final TextArea text = (TextArea) object;
if (unusedSpace > 0) {
@@ -385,8 +385,8 @@
* absorb a relatively larger share of the change in word-space.
*/
int totalDenominator = 0;
- for (int i = 0; i < children.size(); i++) {
- final Object object = children.get(i);
+ for (int i = 0; i < getChildren().size(); i++) {
+ final Object object = getChildren().get(i);
if (object instanceof TextArea) {
final TextArea text = (TextArea) object;
final int denominator = text.countSpaces()
@@ -397,8 +397,8 @@
if (totalDenominator == 0) {
return;
}
- for (int i = 0; i < children.size(); i++) {
- final Object object = children.get(i);
+ for (int i = 0; i < getChildren().size(); i++) {
+ final Object object = getChildren().get(i);
if (object instanceof TextArea) {
final TextArea text = (TextArea) object;
final int numSpaces = text.countSpaces();
@@ -419,8 +419,8 @@
*/
public void verticalAlign() {
int maxHeight = this.getProgressionDimension();
- for (int i = 0; i < children.size(); i++) {
- final Object o = children.get(i);
+ for (int i = 0; i < getChildren().size(); i++) {
+ final Object o = getChildren().get(i);
if (o instanceof AbstractInlineArea) {
final AbstractInlineArea ia = (AbstractInlineArea) o;
if (ia.crBPD() > maxHeight) {
@@ -434,7 +434,7 @@
}
public boolean isEmpty() {
- return !(children.size() > 0);
+ return !(getChildren().size() > 0);
}
/**
@@ -669,7 +669,7 @@
* dependencies between nodes in the tree.
*/
public void cleanup() {
- this.children = null;
+ resetChildren();
setProgressionDimension(0);
this.getAreaNodeParent().removeChild(this);
}
@@ -789,7 +789,7 @@
}
public boolean hasAnyContent() {
- return this.children.size() > 0;
+ return getChildren().size() > 0;
}
public static org.axsl.areaW.ForeignObjectArea makeForeignObjectArea(
@@ -897,7 +897,7 @@
/* If the final text will be empty, don't create the TextArea. */
final char[] rawText = foText.getAreaTreeText(context);
- final boolean isFirstItemOnline = parentArea.children.size() == 0;
+ final boolean isFirstItemOnline = parentArea.getChildren().size() == 0;
final int ignoreAtStart = TextArea.ignoreAtStart(rawText, startOffset,
sizeInChars, isFirstItemOnline,
parentArea.traitWhiteSpaceTreatment());
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/NormalBlockArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/NormalBlockArea.java 2006-10-07 18:54:19 UTC (rev 8337)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/NormalBlockArea.java 2006-10-07 19:07:03 UTC (rev 8338)
@@ -163,14 +163,14 @@
}
public LineArea getPreviousLineArea(final LineArea lineArea) {
- if (this.children == null) {
+ if (this.getChildren() == null) {
return null;
}
- final int index = children.indexOf(lineArea);
+ final int index = getChildren().indexOf(lineArea);
if (index <= 0) {
return null;
}
- final Object previousObject = children.get(index - 1);
+ final Object previousObject = getChildren().get(index - 1);
if (previousObject instanceof LineArea) {
return (LineArea) previousObject;
}
Modified: trunk/foray/scripts/checkstyle-suppressions.xml
===================================================================
--- trunk/foray/scripts/checkstyle-suppressions.xml 2006-10-07 18:54:19 UTC (rev 8337)
+++ trunk/foray/scripts/checkstyle-suppressions.xml 2006-10-07 19:07:03 UTC (rev 8338)
@@ -46,8 +46,6 @@
files="org.foray.text.*"/>
<suppress checks="VisibilityModifier"
- files="org.foray.area.*"/>
- <suppress checks="VisibilityModifier"
files="org.foray.fotree.*"/>
<!-- Semi-permanent exemptions. -->
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|