foray-commit Mailing List for FOray
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
(139) |
Apr
(98) |
May
(250) |
Jun
(394) |
Jul
(84) |
Aug
(13) |
Sep
(420) |
Oct
(186) |
Nov
(1) |
Dec
(3) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(108) |
Feb
(202) |
Mar
(291) |
Apr
(247) |
May
(374) |
Jun
(227) |
Jul
(231) |
Aug
(60) |
Sep
(31) |
Oct
(45) |
Nov
(18) |
Dec
|
| 2008 |
Jan
(38) |
Feb
(71) |
Mar
(142) |
Apr
|
May
(59) |
Jun
(6) |
Jul
(10) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2009 |
Jan
(12) |
Feb
(4) |
Mar
(88) |
Apr
(121) |
May
(17) |
Jun
(30) |
Jul
|
Aug
(5) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2010 |
Jan
(11) |
Feb
(76) |
Mar
(11) |
Apr
|
May
(11) |
Jun
|
Jul
|
Aug
(44) |
Sep
(14) |
Oct
(7) |
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(9) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(10) |
Nov
|
Dec
|
| 2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
(4) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(168) |
| 2017 |
Jan
(77) |
Feb
(11) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
(6) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
|
Feb
(88) |
Mar
(118) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(6) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(141) |
| 2021 |
Jan
(170) |
Feb
(20) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
(62) |
Nov
(189) |
Dec
(162) |
| 2022 |
Jan
(201) |
Feb
(118) |
Mar
(8) |
Apr
|
May
(2) |
Jun
(47) |
Jul
(19) |
Aug
(14) |
Sep
(3) |
Oct
|
Nov
(28) |
Dec
(235) |
| 2023 |
Jan
(112) |
Feb
(23) |
Mar
(2) |
Apr
(2) |
May
|
Jun
(1) |
Jul
|
Aug
(70) |
Sep
(92) |
Oct
(20) |
Nov
(1) |
Dec
(1) |
| 2024 |
Jan
|
Feb
|
Mar
(1) |
Apr
(1) |
May
(14) |
Jun
(11) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2025 |
Jan
(10) |
Feb
(29) |
Mar
|
Apr
(162) |
May
(245) |
Jun
(83) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
1
|
2
(10) |
3
(8) |
4
(1) |
5
(12) |
6
(8) |
7
(9) |
|
8
(1) |
9
(10) |
10
(11) |
11
(5) |
12
(10) |
13
(2) |
14
(4) |
|
15
(2) |
16
(11) |
17
(17) |
18
(18) |
19
(15) |
20
(20) |
21
(7) |
|
22
(1) |
23
(5) |
24
(8) |
25
(8) |
26
(9) |
27
(7) |
28
(7) |
|
29
(4) |
30
(1) |
31
|
|
|
|
|
|
From: <vic...@us...> - 2007-07-30 14:01:32
|
Revision: 10135
http://foray.svn.sourceforge.net/foray/?rev=10135&view=rev
Author: victormote
Date: 2007-07-30 07:01:32 -0700 (Mon, 30 Jul 2007)
Log Message:
-----------
1. Add test for font-size-adjust.
2. Add test for resolved font-family.
Modified Paths:
--------------
trunk/foray/foray-app/src/javatest/org/foray/app/fo/TestFont.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
trunk/foray/resource/test/fo/font-family-001.fo
trunk/foray/resource/test/fo/font-size-001.fo
Modified: trunk/foray/foray-app/src/javatest/org/foray/app/fo/TestFont.java
===================================================================
--- trunk/foray/foray-app/src/javatest/org/foray/app/fo/TestFont.java 2007-07-29 00:58:20 UTC (rev 10134)
+++ trunk/foray/foray-app/src/javatest/org/foray/app/fo/TestFont.java 2007-07-30 14:01:32 UTC (rev 10135)
@@ -34,6 +34,8 @@
import org.foray.fotree.fo.obj.Block;
import org.foray.fotree.fo.obj.Flow;
+import org.axsl.font.Font;
+
/**
* Tests of various font properties at the FO Tree level.
*/
@@ -62,7 +64,10 @@
block = (Block) node;
fontFamilies = block.traitFontFamily(null);
assertEquals(1, fontFamilies.length);
- assertEquals("Courier", fontFamilies[0]);
+ assertEquals("Base14-Courier", fontFamilies[0]);
+
+ final Font font = block.getPrimaryFont(null).getFont();
+ assertEquals("Courier", font.getFontName());
}
/**
@@ -86,6 +91,23 @@
block = (Block) node;
fontSize = block.traitFontSize(null);
assertEquals(8000, fontSize);
+
+ node = flow.getChildAt(2);
+ assertTrue(node instanceof Block);
+ block = (Block) node;
+ final Font font = node.getPrimaryFont(null).getFont();
+ assertEquals("Courier", font.getFamilyName());
+ assertEquals(426, font.getXHeight(1000));
+ final int nominalFontSize = block.traitFontSize(null);
+ /* The nominal font-size is 10 pts. */
+ assertEquals(10000, nominalFontSize);
+ /* The font-size-adjust is .6. */
+ final double fontSizeAdjust = block.traitFontSizeAdjust(null);
+ assertEquals(.6, fontSizeAdjust, .001);
+ /* Actual font size computation, using a basis factor of 1000.
+ * 600 / 426 * 10000 = 14085. */
+ fontSize = block.traitFontSizeActual(null, font);
+ assertEquals(14085, fontSize);
}
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-07-29 00:58:20 UTC (rev 10134)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-07-30 14:01:32 UTC (rev 10135)
@@ -3762,7 +3762,8 @@
return nominalFontSize;
}
final int xHeight = font.getXHeight(nominalFontSize);
- final double fontAspectRatio = xHeight / nominalFontSize;
+ final double fontAspectRatio = (float) xHeight
+ / (float) nominalFontSize;
return (int) Math.round(fontSizeAdjust / fontAspectRatio
* nominalFontSize);
}
Modified: trunk/foray/resource/test/fo/font-family-001.fo
===================================================================
--- trunk/foray/resource/test/fo/font-family-001.fo 2007-07-29 00:58:20 UTC (rev 10134)
+++ trunk/foray/resource/test/fo/font-family-001.fo 2007-07-30 14:01:32 UTC (rev 10135)
@@ -20,7 +20,7 @@
<fo:block>The default font.</fo:block>
<fo:block
- font-family="Courier">font-family: Courier.</fo:block>
+ font-family="Base14-Courier">font-family: Base14-Courier.</fo:block>
</fo:flow>
Modified: trunk/foray/resource/test/fo/font-size-001.fo
===================================================================
--- trunk/foray/resource/test/fo/font-size-001.fo 2007-07-29 00:58:20 UTC (rev 10134)
+++ trunk/foray/resource/test/fo/font-size-001.fo 2007-07-30 14:01:32 UTC (rev 10135)
@@ -22,10 +22,17 @@
flow-name="xsl-region-body">
<fo:block>This block is the default font size and default font.</fo:block>
+
<fo:block
font-family="Courier"
font-size="8pt">This block is Courier, 8 points.</fo:block>
+<fo:block font-family="Base14-Courier" font-size="10pt"
+ font-size-adjust=".6">This block is Base14-Courier, font-size="10 points",
+and font-size-adjust=".6". Since the x-height for Courier is 426, the actual
+font-size for this block should be</fo:block>
+
+
</fo:flow>
</fo:page-sequence>
</fo:root>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-29 00:58:41
|
Revision: 10134
http://foray.svn.sourceforge.net/foray/?rev=10134&view=rev
Author: victormote
Date: 2007-07-28 17:58:20 -0700 (Sat, 28 Jul 2007)
Log Message:
-----------
Conform to axsl change hiding the font-size (computed) property from client applications.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.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/foray-areatree/src/java/org/foray/area/PageNumberArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberCitationArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberCitationLastArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/ScalingValueCitationArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java 2007-07-29 00:49:09 UTC (rev 10133)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java 2007-07-29 00:58:20 UTC (rev 10134)
@@ -612,7 +612,8 @@
* @return The font-size trait.
*/
public int traitFontSize() {
- return traitGeneratedBy().traitFontSize(this);
+ return traitGeneratedBy().traitFontSizeActual(this,
+ this.getPrimaryFont().getFont());
}
/**
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2007-07-29 00:49:09 UTC (rev 10133)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2007-07-29 00:58:20 UTC (rev 10134)
@@ -1507,7 +1507,8 @@
* @return The font-size trait.
*/
public int traitFontSize() {
- return traitGeneratedBy().traitFontSize(this);
+ return traitGeneratedBy().traitFontSizeActual(this,
+ this.getPrimaryFont().getFont());
}
/**
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/NormalBlockArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/NormalBlockArea.java 2007-07-29 00:49:09 UTC (rev 10133)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/NormalBlockArea.java 2007-07-29 00:58:20 UTC (rev 10134)
@@ -38,6 +38,7 @@
import org.axsl.fo.fo.GraftingPoint;
import org.axsl.fo.fo.ListBlock;
import org.axsl.fo.fo.Table;
+import org.axsl.font.FontUse;
import org.axsl.galley.RenderVisitor;
import org.axsl.graphic.Graphic;
@@ -532,7 +533,16 @@
* @return The font-size trait.
*/
public int traitFontSize() {
- return traitGeneratedBy().traitFontSize(this);
+ return traitGeneratedBy().traitFontSizeActual(this,
+ this.getPrimaryFont().getFont());
}
+ /**
+ * Returns the primary font.
+ * @return The primary font.
+ */
+ public FontUse getPrimaryFont() {
+ return traitGeneratedBy().getPrimaryFont(this);
+ }
+
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberArea.java 2007-07-29 00:49:09 UTC (rev 10133)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberArea.java 2007-07-29 00:58:20 UTC (rev 10134)
@@ -349,7 +349,8 @@
* @return The font-size trait.
*/
public int traitFontSize() {
- return traitGeneratedBy().traitFontSize(this);
+ return traitGeneratedBy().traitFontSizeActual(this,
+ this.getPrimaryFont().getFont());
}
/**
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberCitationArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberCitationArea.java 2007-07-29 00:49:09 UTC (rev 10133)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberCitationArea.java 2007-07-29 00:58:20 UTC (rev 10134)
@@ -378,7 +378,8 @@
* @return The font-size trait.
*/
public int traitFontSize() {
- return traitGeneratedBy().traitFontSize(this);
+ return traitGeneratedBy().traitFontSizeActual(this,
+ this.getPrimaryFont().getFont());
}
/**
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberCitationLastArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberCitationLastArea.java 2007-07-29 00:49:09 UTC (rev 10133)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberCitationLastArea.java 2007-07-29 00:58:20 UTC (rev 10134)
@@ -379,7 +379,8 @@
* @return The font-size trait.
*/
public int traitFontSize() {
- return traitGeneratedBy().traitFontSize(this);
+ return traitGeneratedBy().traitFontSizeActual(this,
+ this.getPrimaryFont().getFont());
}
/**
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/ScalingValueCitationArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/ScalingValueCitationArea.java 2007-07-29 00:49:09 UTC (rev 10133)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/ScalingValueCitationArea.java 2007-07-29 00:58:20 UTC (rev 10134)
@@ -364,7 +364,8 @@
* @return The font-size trait.
*/
public int traitFontSize() {
- return traitGeneratedBy().traitFontSize(this);
+ return traitGeneratedBy().traitFontSizeActual(this,
+ this.getPrimaryFont().getFont());
}
/**
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java 2007-07-29 00:49:09 UTC (rev 10133)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java 2007-07-29 00:58:20 UTC (rev 10134)
@@ -737,7 +737,8 @@
*/
public int traitFontSize() {
final CharacterSequence generatedBy = this.traitGeneratedBy();
- final int nominalFontSize = generatedBy.traitFontSize(this);
+ final int nominalFontSize = generatedBy.traitFontSizeActual(this,
+ this.getPrimaryFont().getFont());
if (this.hasFauxSmallCaps) {
final FontUse fontUse = getPrimaryFont();
return fontUse.smallCapsSize(nominalFontSize);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-29 00:49:11
|
Revision: 10133
http://foray.svn.sourceforge.net/foray/?rev=10133&view=rev
Author: victormote
Date: 2007-07-28 17:49:09 -0700 (Sat, 28 Jul 2007)
Log Message:
-----------
Fix bug in inheritance of font-size-adjust.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontSizeAdjust.java
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontSizeAdjust.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontSizeAdjust.java 2007-07-29 00:36:19 UTC (rev 10132)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontSizeAdjust.java 2007-07-29 00:49:09 UTC (rev 10133)
@@ -117,7 +117,7 @@
public static double getValueNoInstance(final FoContext context,
final FObj fobj) {
final FObj parent = fobj.effectiveParent(context);
- if (fobj != null) {
+ if (parent != null) {
return parent.traitFontSizeAdjust(context);
}
return FontSizeAdjust.getInitialValue();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-29 00:36:18
|
Revision: 10132
http://foray.svn.sourceforge.net/foray/?rev=10132&view=rev
Author: victormote
Date: 2007-07-28 17:36:19 -0700 (Sat, 28 Jul 2007)
Log Message:
-----------
Conform to axsl change to parameter type.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-07-29 00:23:08 UTC (rev 10131)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-07-29 00:36:19 UTC (rev 10132)
@@ -3755,10 +3755,16 @@
* {@inheritDoc}
*/
public int traitFontSizeActual(final FoContext context,
- final int xHeight) {
- final double fontAspectRatio = xHeight / traitFontSize(context);
- return (int) Math.round(traitFontSizeAdjust(context) / fontAspectRatio
- * traitFontSize(context));
+ final Font font) {
+ final double fontSizeAdjust = this.traitFontSizeAdjust(context);
+ final int nominalFontSize = this.traitFontSize(context);
+ if (fontSizeAdjust == Double.NEGATIVE_INFINITY) {
+ return nominalFontSize;
+ }
+ final int xHeight = font.getXHeight(nominalFontSize);
+ final double fontAspectRatio = xHeight / nominalFontSize;
+ return (int) Math.round(fontSizeAdjust / fontAspectRatio
+ * nominalFontSize);
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-29 00:23:15
|
Revision: 10131
http://foray.svn.sourceforge.net/foray/?rev=10131&view=rev
Author: victormote
Date: 2007-07-28 17:23:08 -0700 (Sat, 28 Jul 2007)
Log Message:
-----------
Conform to axsl change in the value for font-size-adjust="none".
Modified Paths:
--------------
trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontSizeAdjust.java
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-07-28 22:05:28 UTC (rev 10130)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-07-29 00:23:08 UTC (rev 10131)
@@ -4610,10 +4610,8 @@
// Check the shorthand.
final Font fontProperty = (Font) getProperty(FoProperty.FONT);
if (fontProperty != null) {
- /*
- * If the shorthand exists, the effect of it is to set
- * font-size-adjust to its initial value.
- */
+ /* If the shorthand exists, the effect of it is to set
+ * font-size-adjust to its initial value. */
return FontSizeAdjust.getInitialValue();
}
return FontSizeAdjust.getValueNoInstance(context, fobj);
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontSizeAdjust.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontSizeAdjust.java 2007-07-28 22:05:28 UTC (rev 10130)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontSizeAdjust.java 2007-07-29 00:23:08 UTC (rev 10131)
@@ -101,7 +101,7 @@
return getValueNoInstance(context, fobj);
}
case NONE: {
- return -1;
+ return FontSizeAdjust.getInitialValue();
}
}
}
@@ -120,7 +120,7 @@
if (fobj != null) {
return parent.traitFontSizeAdjust(context);
}
- return -1;
+ return FontSizeAdjust.getInitialValue();
}
/**
@@ -128,7 +128,7 @@
* @return The default value.
*/
public static double getInitialValue() {
- return -1;
+ return Double.NEGATIVE_INFINITY;
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-28 22:05:26
|
Revision: 10130
http://foray.svn.sourceforge.net/foray/?rev=10130&view=rev
Author: victormote
Date: 2007-07-28 15:05:28 -0700 (Sat, 28 Jul 2007)
Log Message:
-----------
Conform to axsl changes making the font-selection traits invisible to client applications.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-07-28 20:50:00 UTC (rev 10129)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-07-28 22:05:28 UTC (rev 10130)
@@ -155,6 +155,7 @@
import org.axsl.fo.fo.prop.CommonAccessibilityPa;
import org.axsl.fo.fo.prop.CommonAuralPa;
import org.axsl.fo.fo.prop.CommonBorderPaddingBgPa;
+import org.axsl.fo.fo.prop.CommonFontExcludedPa;
import org.axsl.fo.fo.prop.CommonFontPa;
import org.axsl.fo.fo.prop.CommonHyphenationPa;
import org.axsl.fo.fo.prop.CommonMarginBlockPa;
@@ -281,6 +282,7 @@
CommonAuralPa,
CommonBorderPaddingBgPa,
CommonFontPa,
+ CommonFontExcludedPa,
CommonHyphenationPa,
CommonMarginBlockPa,
CommonMarginInlinePa,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-28 20:49:58
|
Revision: 10129
http://foray.svn.sourceforge.net/foray/?rev=10129&view=rev
Author: victormote
Date: 2007-07-28 13:50:00 -0700 (Sat, 28 Jul 2007)
Log Message:
-----------
Clean up some content model issues.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/java/org/foray/fotree/ForeignXML.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/axsl/obj/Metadata.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/BookmarkTitle.java
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/ForeignXML.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/ForeignXML.java 2007-07-28 20:36:22 UTC (rev 10128)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/ForeignXML.java 2007-07-28 20:50:00 UTC (rev 10129)
@@ -108,6 +108,7 @@
* {@inheritDoc}
*/
protected void validateAncestry() throws FoTreeException {
+ /* Ancestry validated at construction. */
return;
}
@@ -122,7 +123,7 @@
* {@inheritDoc}
*/
protected void validateDescendants() throws FoTreeException {
- return;
+ this.validateEmptyContent();
}
/**
@@ -290,7 +291,7 @@
* {@inheritDoc}
*/
public void addChild(final FObj child) throws FoTreeException {
- this.getChildren().add(child);
+ this.addChildToEmptyContentModel(child);
}
/**
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/axsl/obj/Metadata.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/axsl/obj/Metadata.java 2007-07-28 20:36:22 UTC (rev 10128)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/axsl/obj/Metadata.java 2007-07-28 20:50:00 UTC (rev 10129)
@@ -59,7 +59,8 @@
private FObj parent;
/** The children of this object. */
- private List<FObj> children = new ArrayList<FObj>();
+ private List<CharacterSequence4a> children =
+ new ArrayList<CharacterSequence4a>(1);
/**
* Constructor.
@@ -186,7 +187,8 @@
/**
* {@inheritDoc}
- * Overrides standard logic as text-transform does not apply to a bookmark.
+ * Overrides standard logic as text-transform does not apply to a metadata
+ * item.
*/
@Override
public TextTransform traitTextTransform(final FoContext context) {
@@ -195,7 +197,7 @@
/**
* {@inheritDoc}
- * Overrides standard logic as white-space-treatment for a bookmark-title
+ * Overrides standard logic as white-space-treatment for a metadata item
* is always the initial value.
*/
@Override
@@ -206,7 +208,7 @@
/**
* {@inheritDoc}
- * Overrides standard logic as linefeed-treatment for a bookmark-title
+ * Overrides standard logic as linefeed-treatment for a metadata item
* is always the initial value.
*/
@Override
@@ -216,7 +218,7 @@
/**
* {@inheritDoc}
- * Overrides standard logic as linefeed-treatment for a bookmark-title
+ * Overrides standard logic as white-space-collapse for a metadata item
* is always the initial value.
*/
@Override
@@ -227,7 +229,7 @@
/**
* {@inheritDoc}
*/
- public List<FObj> getChildren() {
+ public List<CharacterSequence4a> getChildren() {
return this.children;
}
@@ -241,8 +243,9 @@
/**
* {@inheritDoc}
*/
- public void addNonTextNode(final FObj nonTextNode) {
- this.children.add(nonTextNode);
+ public void addNonTextNode(final FObj fobj) throws FoTreeException {
+ fobj.throwException("Violation of parent (" + fobj.getFullName()
+ + ")content model.");
}
/**
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/BookmarkTitle.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/BookmarkTitle.java 2007-07-28 20:36:22 UTC (rev 10128)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/BookmarkTitle.java 2007-07-28 20:50:00 UTC (rev 10129)
@@ -167,7 +167,7 @@
/**
* {@inheritDoc}
- * Overrides standard logic as linefeed-treatment for a bookmark-title
+ * Overrides standard logic as white-space-collapse for a bookmark-title
* is always the initial value.
*/
@Override
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-28 20:36:25
|
Revision: 10128
http://foray.svn.sourceforge.net/foray/?rev=10128&view=rev
Author: victormote
Date: 2007-07-28 13:36:22 -0700 (Sat, 28 Jul 2007)
Log Message:
-----------
Move common methods up to ForeignXML.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/java/org/foray/fotree/ForeignXML.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/svg/obj/SVGElement.java
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/ForeignXML.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/ForeignXML.java 2007-07-28 18:07:02 UTC (rev 10127)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/ForeignXML.java 2007-07-28 20:36:22 UTC (rev 10128)
@@ -28,6 +28,7 @@
package org.foray.fotree;
+import org.axsl.fo.FoContext;
import org.axsl.fo.FoTreeException;
import org.foray.fotree.fo.obj.InstreamForeignObject;
@@ -113,11 +114,32 @@
/**
* {@inheritDoc}
*/
+ protected void validateProperties() throws FoTreeException {
+ return;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected void validateDescendants() throws FoTreeException {
+ return;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
protected void setup() throws FoTreeException {
return;
}
/**
+ * {@inheritDoc}
+ */
+ protected void end() throws FoTreeException {
+ return;
+ }
+
+ /**
* Create and return a DOM {@link Document} instance.
* @return The newly-created DOM {@link Document} instance.
* @throws FoTreeException For errors creating an appropriate DOM document
@@ -267,6 +289,13 @@
/**
* {@inheritDoc}
*/
+ public void addChild(final FObj child) throws FoTreeException {
+ this.getChildren().add(child);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
public PropertyList getPropertyList() {
return this.propertyList;
}
@@ -278,4 +307,32 @@
return null;
}
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isContentInline() {
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isContentBlock() {
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isContentPcdata() {
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
+ return this.getParent().getPrimaryFont(context);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/svg/obj/SVGElement.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/svg/obj/SVGElement.java 2007-07-28 18:07:02 UTC (rev 10127)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/svg/obj/SVGElement.java 2007-07-28 20:36:22 UTC (rev 10128)
@@ -29,13 +29,11 @@
package org.foray.fotree.svg.obj;
import org.foray.common.FOrayConstants;
-import org.foray.fotree.FObj;
import org.foray.fotree.ForeignXML;
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyListUnparsed;
import org.foray.fotree.fo.obj.InstreamForeignObject;
-import org.axsl.fo.FoContext;
import org.axsl.fo.FoTreeException;
import org.axsl.fo.ProxyFactory;
import org.axsl.graphic.GraphicException;
@@ -67,27 +65,6 @@
/**
* {@inheritDoc}
*/
- protected void validateProperties() throws FoTreeException {
- return;
- }
-
- /**
- * {@inheritDoc}
- */
- protected void end() throws FoTreeException {
- return;
- }
-
- /**
- * {@inheritDoc}
- */
- protected void validateDescendants() throws FoTreeException {
- return;
- }
-
- /**
- * {@inheritDoc}
- */
protected Document createDOMDocument() throws FoTreeException {
try {
return this.getGraphicServer().makeSvgDocument();
@@ -154,13 +131,6 @@
}
/**
- * {@inheritDoc}
- */
- public void addChild(final FObj child) throws FoTreeException {
- this.getChildren().add(child);
- }
-
- /**
* Returns the SVG Graphic for the content of this object.
* @return The SVG Graphic for the content of this object.
* @throws GraphicException For errors creating the SVG Graphic from the
@@ -174,32 +144,4 @@
return this.svg;
}
- /**
- * {@inheritDoc}
- */
- public boolean isContentInline() {
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean isContentBlock() {
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean isContentPcdata() {
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- public org.axsl.font.FontUse getPrimaryFont(final FoContext context) {
- return this.getParent().getPrimaryFont(context);
- }
-
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-28 18:07:00
|
Revision: 10127
http://foray.svn.sourceforge.net/foray/?rev=10127&view=rev
Author: victormote
Date: 2007-07-28 11:07:02 -0700 (Sat, 28 Jul 2007)
Log Message:
-----------
Conform to axsl change renaming interface.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/AbstractAncestralInlineArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Character.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/CharacterSequence4a.java
trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FOTextPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AbstractAncestralInlineArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/AbstractAncestralInlineArea.java 2007-07-28 17:59:14 UTC (rev 10126)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/AbstractAncestralInlineArea.java 2007-07-28 18:07:02 UTC (rev 10127)
@@ -31,7 +31,7 @@
import org.axsl.area.AreaTreeException;
import org.axsl.fo.fo.BasicLink;
import org.axsl.fo.fo.BidiOverride;
-import org.axsl.fo.fo.CharacterContent;
+import org.axsl.fo.fo.CharacterSequence;
import org.axsl.fo.fo.ExternalGraphic;
import org.axsl.fo.fo.GraftingPoint;
import org.axsl.fo.fo.IndexPageCitationList;
@@ -80,7 +80,7 @@
/**
* {@inheritDoc}
*/
- public TextArea makeGlyphAreaSequence(final CharacterContent foText,
+ public TextArea makeGlyphAreaSequence(final CharacterSequence foText,
final int startOffset, final int sizeInChars, final int ipd,
final boolean hasDiscretionaryHyphen,
final boolean hasFauxSmallCaps, final boolean isLastItemOnLine,
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2007-07-28 17:59:14 UTC (rev 10126)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2007-07-28 18:07:02 UTC (rev 10127)
@@ -44,7 +44,7 @@
import org.axsl.fo.fo.BasicLink;
import org.axsl.fo.fo.BidiOverride;
import org.axsl.fo.fo.Block;
-import org.axsl.fo.fo.CharacterContent;
+import org.axsl.fo.fo.CharacterSequence;
import org.axsl.fo.fo.ExternalGraphic;
import org.axsl.fo.fo.GraftingPoint;
import org.axsl.fo.fo.IndexPageCitationList;
@@ -966,7 +966,7 @@
* @param context An object that knows how to resolve FO context issues.
* @return True iff a text area should be created for the text item.
*/
- static boolean shouldCreateTextArea(final CharacterContent foText,
+ static boolean shouldCreateTextArea(final CharacterSequence foText,
final Area parentArea, final int startOffset, final int sizeInChars,
final boolean isLastItemOnLine, final FoContext context) {
/* If the raw text is empty, don't create the TextArea. */
@@ -1005,7 +1005,7 @@
/**
* {@inheritDoc}
*/
- public TextArea makeGlyphAreaSequence(final CharacterContent foText,
+ public TextArea makeGlyphAreaSequence(final CharacterSequence foText,
final int startOffset, final int sizeInChars, final int ipd,
final boolean hasDiscretionaryHyphen,
final boolean hasFauxSmallCaps, final boolean isLastItemOnLine,
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java 2007-07-28 17:59:14 UTC (rev 10126)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java 2007-07-28 18:07:02 UTC (rev 10127)
@@ -35,7 +35,7 @@
import org.axsl.common.value.WhiteSpaceTreatment;
import org.axsl.fo.Fo;
import org.axsl.fo.fo.Block;
-import org.axsl.fo.fo.CharacterContent;
+import org.axsl.fo.fo.CharacterSequence;
import org.axsl.fo.fo.GraftingPoint;
import org.axsl.font.Font;
import org.axsl.font.FontUse;
@@ -158,7 +158,7 @@
* will be applied.
* @return The newly-created TextArea.
*/
- static TextArea makeTextArea(final CharacterContent generatedBy,
+ static TextArea makeTextArea(final CharacterSequence generatedBy,
final LineArea parentArea,
final GraftingPoint graftingPoint, final int backingOffset,
final int backingSize, final int progressionDimensionUsed,
@@ -203,7 +203,7 @@
* will be applied.
* @return The newly-created TextArea.
*/
- static TextArea makeTextArea(final CharacterContent generatedBy,
+ static TextArea makeTextArea(final CharacterSequence generatedBy,
final AbstractInlineArea parentArea,
final GraftingPoint graftingPoint, final int backingOffset,
final int backingSize, final int progressionDimensionUsed,
@@ -329,12 +329,12 @@
* Returns the raw value of the text content backing this area.
* @return The text content backing this area.
*/
- public CharacterContent getTextContent() {
+ public CharacterSequence getTextContent() {
/* Do NOT use the traitGeneratedBy() method here, because we need the
* raw value, and this class overrides that method. */
final Fo foNode = this.getLinkage().getFONode();
/* Cast verified at construction. */
- return (CharacterContent) foNode;
+ return (CharacterSequence) foNode;
}
/**
@@ -736,7 +736,7 @@
* Overrides the Area method because it needs to handle faux-small-caps.
*/
public int traitFontSize() {
- final CharacterContent generatedBy = this.traitGeneratedBy();
+ final CharacterSequence generatedBy = this.traitGeneratedBy();
final int nominalFontSize = generatedBy.traitFontSize(this);
if (this.hasFauxSmallCaps) {
final FontUse fontUse = getPrimaryFont();
@@ -755,8 +755,8 @@
/**
* {@inheritDoc}
*/
- public CharacterContent traitGeneratedBy() {
- return (CharacterContent) this.getLinkage().getFONode();
+ public CharacterSequence traitGeneratedBy() {
+ return (CharacterSequence) this.getLinkage().getFONode();
}
/**
@@ -830,8 +830,8 @@
public int traitHyphenationCharacter() {
/* TODO: Clean this method up after we clean up the construction. */
final Fo generatedBy = this.traitGeneratedBy();
- if (generatedBy instanceof CharacterContent) {
- final CharacterContent character = (CharacterContent) generatedBy;
+ if (generatedBy instanceof CharacterSequence) {
+ final CharacterSequence character = (CharacterSequence) generatedBy;
return character.traitHyphenationCharacter(this);
} else {
final NormalBlockArea blockArea = this.ancestorNormalBlockArea();
@@ -846,10 +846,10 @@
* @return The "generated-by" Character, or null if this area was not
* generated by an fo:character.
*/
- private CharacterContent generatedByCharacter() {
+ private CharacterSequence generatedByCharacter() {
final Fo generatedBy = this.traitGeneratedBy();
- if (generatedBy instanceof CharacterContent) {
- return (CharacterContent) generatedBy;
+ if (generatedBy instanceof CharacterSequence) {
+ return (CharacterSequence) generatedBy;
}
return null;
}
@@ -858,7 +858,7 @@
* {@inheritDoc}
*/
public int traitSpaceStartOptimum() {
- final CharacterContent character = this.generatedByCharacter();
+ final CharacterSequence character = this.generatedByCharacter();
if (character == null) {
return 0;
} else {
@@ -870,7 +870,7 @@
* {@inheritDoc}
*/
public int traitSpaceEndOptimum() {
- final CharacterContent character = this.generatedByCharacter();
+ final CharacterSequence character = this.generatedByCharacter();
if (character == null) {
return 0;
} else {
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Character.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Character.java 2007-07-28 17:59:14 UTC (rev 10126)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Character.java 2007-07-28 18:07:02 UTC (rev 10127)
@@ -48,7 +48,8 @@
/**
* A "character" object in XSL-FO.
*/
-public class Character extends FObj implements org.axsl.fo.fo.CharacterContent {
+public class Character extends FObj
+ implements org.axsl.fo.fo.CharacterSequence {
/** The parent of this node. */
private FObj parent;
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/CharacterSequence4a.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/CharacterSequence4a.java 2007-07-28 17:59:14 UTC (rev 10126)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/CharacterSequence4a.java 2007-07-28 18:07:02 UTC (rev 10127)
@@ -44,7 +44,7 @@
import org.axsl.fo.FoContext;
import org.axsl.fo.FoTreeException;
import org.axsl.fo.ProxyFactory;
-import org.axsl.fo.fo.CharacterContent;
+import org.axsl.fo.fo.CharacterSequence;
import org.axsl.fo.fo.GraftingPoint;
import org.axsl.fo.fo.Marker;
import org.axsl.font.Font;
@@ -56,7 +56,7 @@
/**
* A text node in the formatting object tree.
*/
-public class CharacterSequence4a extends FObj implements CharacterContent {
+public class CharacterSequence4a extends FObj implements CharacterSequence {
/** Constant indicating that a given character should be discarded. */
public static final char DISCARD_CHAR = 0xFFFF;
Modified: trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java
===================================================================
--- trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java 2007-07-28 17:59:14 UTC (rev 10126)
+++ trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java 2007-07-28 18:07:02 UTC (rev 10127)
@@ -37,7 +37,7 @@
import org.axsl.area.RegionRefArea;
import org.axsl.fo.FoLineNonText;
import org.axsl.fo.FoLineText;
-import org.axsl.fo.fo.CharacterContent;
+import org.axsl.fo.fo.CharacterSequence;
import org.axsl.fo.fo.ExternalGraphic;
import org.axsl.fo.fo.GraftingPoint;
import org.axsl.fo.fo.InstreamForeignObject;
@@ -149,8 +149,8 @@
if (this.areaStack.size() > 0) {
factory = this.areaStack.peek();
}
- if (textToUse instanceof CharacterContent) {
- final CharacterContent foText = (CharacterContent) textToUse;
+ if (textToUse instanceof CharacterSequence) {
+ final CharacterSequence foText = (CharacterSequence) textToUse;
factory.makeGlyphAreaSequence(foText, startOffset, sizeInChars,
sizeInline,
hasDiscretionaryHyphen, hasFauxSmallCaps, isLastItemOnLine,
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FOTextPL.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FOTextPL.java 2007-07-28 17:59:14 UTC (rev 10126)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FOTextPL.java 2007-07-28 18:07:02 UTC (rev 10127)
@@ -32,23 +32,23 @@
import org.axsl.area.AreaTreeException;
import org.axsl.area.LineArea;
import org.axsl.fo.FoLineText;
-import org.axsl.fo.fo.CharacterContent;
+import org.axsl.fo.fo.CharacterSequence;
import org.axsl.fo.fo.GraftingPoint;
/**
- * Pioneer Layout for {@link CharacterContent}.
+ * Pioneer Layout for {@link CharacterSequence}.
*/
public class FOTextPL extends FONodePL {
/** The real FONode which this proxy represents. */
- private CharacterContent node;
+ private CharacterSequence node;
/**
* Constructor.
* @param text The FO Tree object which is being laid out.
* @param layout The ancestor layout system.
*/
- public FOTextPL(final CharacterContent text, final PioneerLS layout) {
+ public FOTextPL(final CharacterSequence text, final PioneerLS layout) {
super(text, layout);
this.node = text;
}
@@ -103,7 +103,7 @@
/**
* {@inheritDoc}
*/
- public CharacterContent getFONode() {
+ public CharacterSequence getFONode() {
return this.node;
}
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java 2007-07-28 17:59:14 UTC (rev 10126)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java 2007-07-28 18:07:02 UTC (rev 10127)
@@ -46,7 +46,7 @@
import org.axsl.fo.fo.BlockContainer;
import org.axsl.fo.fo.Bookmark;
import org.axsl.fo.fo.BookmarkTitle;
-import org.axsl.fo.fo.CharacterContent;
+import org.axsl.fo.fo.CharacterSequence;
import org.axsl.fo.fo.ColorProfile;
import org.axsl.fo.fo.Declarations;
import org.axsl.fo.fo.ExternalGraphic;
@@ -391,7 +391,7 @@
/**
* {@inheritDoc}
*/
- public FOTextPL makeProxy(final CharacterContent node) {
+ public FOTextPL makeProxy(final CharacterSequence node) {
return new FOTextPL(node, this);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-28 17:59:13
|
Revision: 10126
http://foray.svn.sourceforge.net/foray/?rev=10126&view=rev
Author: victormote
Date: 2007-07-28 10:59:14 -0700 (Sat, 28 Jul 2007)
Log Message:
-----------
Conform to axsl changes renaming an interface and method, and reordering the parameters of that method.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/AbstractAncestralInlineArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java
trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AbstractAncestralInlineArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/AbstractAncestralInlineArea.java 2007-07-28 00:19:46 UTC (rev 10125)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/AbstractAncestralInlineArea.java 2007-07-28 17:59:14 UTC (rev 10126)
@@ -80,8 +80,8 @@
/**
* {@inheritDoc}
*/
- public TextArea makeTextArea(final CharacterContent foText,
- final int ipd, final int startOffset, final int sizeInChars,
+ public TextArea makeGlyphAreaSequence(final CharacterContent foText,
+ final int startOffset, final int sizeInChars, final int ipd,
final boolean hasDiscretionaryHyphen,
final boolean hasFauxSmallCaps, final boolean isLastItemOnLine,
final GraftingPoint graftingPoint) {
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2007-07-28 00:19:46 UTC (rev 10125)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2007-07-28 17:59:14 UTC (rev 10126)
@@ -1005,8 +1005,8 @@
/**
* {@inheritDoc}
*/
- public TextArea makeTextArea(final CharacterContent foText,
- final int ipd, final int startOffset, final int sizeInChars,
+ public TextArea makeGlyphAreaSequence(final CharacterContent foText,
+ final int startOffset, final int sizeInChars, final int ipd,
final boolean hasDiscretionaryHyphen,
final boolean hasFauxSmallCaps, final boolean isLastItemOnLine,
final GraftingPoint graftingPoint) {
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java 2007-07-28 00:19:46 UTC (rev 10125)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java 2007-07-28 17:59:14 UTC (rev 10126)
@@ -64,7 +64,7 @@
* However , a TextSegment always springs from exactly one FOText node.
*/
public final class TextArea extends AbstractInlineArea
- implements org.axsl.galley.TextArea, org.axsl.area.TextArea {
+ implements org.axsl.galley.TextArea, org.axsl.area.GlyphAreaSequence {
/** The parent of this node. The parent can be either a {@link LineArea}
* or another {@link AbstractInlineArea}. */
Modified: trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java
===================================================================
--- trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java 2007-07-28 00:19:46 UTC (rev 10125)
+++ trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java 2007-07-28 17:59:14 UTC (rev 10126)
@@ -151,7 +151,8 @@
}
if (textToUse instanceof CharacterContent) {
final CharacterContent foText = (CharacterContent) textToUse;
- factory.makeTextArea(foText, sizeInline, startOffset, sizeInChars,
+ factory.makeGlyphAreaSequence(foText, startOffset, sizeInChars,
+ sizeInline,
hasDiscretionaryHyphen, hasFauxSmallCaps, isLastItemOnLine,
graftingPoint);
} else {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-28 00:19:43
|
Revision: 10125
http://foray.svn.sourceforge.net/foray/?rev=10125&view=rev
Author: victormote
Date: 2007-07-27 17:19:46 -0700 (Fri, 27 Jul 2007)
Log Message:
-----------
Extract logic common to inline areas with mixed (block and inline) content into an abstract superclass, and make the appropriate layout classes extend it.
Modified Paths:
--------------
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/BasicLinkPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/InlinePL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java
Added Paths:
-----------
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/AbstractMixedInlinePL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/BidiOverridePL.java
Added: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/AbstractMixedInlinePL.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/AbstractMixedInlinePL.java (rev 0)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/AbstractMixedInlinePL.java 2007-07-28 00:19:46 UTC (rev 10125)
@@ -0,0 +1,146 @@
+/*
+ * Copyright 2007 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy: victormote $
+ */
+
+package org.foray.pioneer;
+
+import org.axsl.area.AncestralNormalInlineArea;
+import org.axsl.area.AreaNode;
+import org.axsl.area.AreaTreeException;
+import org.axsl.area.BlockContentFactory;
+import org.axsl.area.LineArea;
+import org.axsl.area.LineContentFactory;
+import org.axsl.area.NormalBlockArea;
+import org.axsl.fo.Fo;
+import org.axsl.fo.fo.GraftingPoint;
+
+/**
+ * Abstract superclass for Pioneer Layout for inline formatting objects that
+ * can contain either block or inline content.
+ */
+public abstract class AbstractMixedInlinePL extends FObjPL {
+
+ /**
+ * Constructor.
+ * @param realFObj The FO Tree object which is being laid out.
+ * @param layout The ancestor layout system.
+ */
+ public AbstractMixedInlinePL(final Fo realFObj,
+ final PioneerLS layout) {
+ super(realFObj, layout);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Status layout(final AreaNode areaNode,
+ final GraftingPoint graftingPoint) throws AreaTreeException {
+ final Fo foNode = getFONode();
+ if (getProgress() == FONodePL.START) {
+ setProgress(0);
+ }
+
+ Status status = Status.OK;
+ LineContentFactory lineContentFactory = null;
+ for (int i = getProgress(); i < foNode.getChildCount(); i++) {
+ final Fo fo = foNode.getChildAt(i);
+ final FONodePL layoutProxy = getLayoutProxy(fo);
+ if (fo.isBlockLevelFo()) {
+ /* Remove the inline factory so that we know that we need to
+ * create a new one if there is any subsequent inline
+ * content.*/
+ lineContentFactory = null;
+ /* Since this is block content, it cannot be laid out in a
+ * line. We need to find the ancestor BlockContentFactory
+ * and lay out the item in it. */
+ final BlockContentFactory blockContentFactory =
+ areaNode.ancestorBlockContentFactory();
+ status = layoutProxy.layout(blockContentFactory, graftingPoint);
+ } else {
+ if (lineContentFactory == null) {
+ lineContentFactory = getLineContentFactory(areaNode);
+ if (lineContentFactory == null) {
+ /* Not enough room on the page for this. */
+ return Status.AREA_FULL_NONE;
+ }
+ final AncestralNormalInlineArea inlineArea =
+ makeNormalInlineArea(lineContentFactory,
+ graftingPoint);
+ this.getLayout().pushInlineStack(inlineArea);
+ status = layoutProxy.layout(areaNode, graftingPoint);
+ this.getLayout().popInlineStack();
+ }
+ }
+ if (status.isIncomplete()) {
+ setProgress(i);
+ return status;
+ }
+ }
+ return status;
+ }
+
+ /**
+ * Creates the subclass-specific area into which the child objects will be
+ * laid out.
+ * @param lineContentFactory The line content factory that should be used
+ * to create the new area.
+ * @param graftingPoint The grafting point, if any, which controls the
+ * new area.
+ * @return The newly-created area.
+ */
+ protected abstract AncestralNormalInlineArea makeNormalInlineArea(
+ LineContentFactory lineContentFactory, GraftingPoint graftingPoint);
+
+ /**
+ * Returns either a line area or an inline area that is capable of
+ * containing the inline content.
+ * @param areaNode The parent AreaTree node.
+ * @return The area into which the line content should be placed, or null
+ * if there is no room on the page for a line to contain it.
+ * @throws AreaTreeException If <code>areaNode cannot contain line
+ * content.</code>
+ */
+ private LineContentFactory getLineContentFactory(final AreaNode areaNode)
+ throws AreaTreeException {
+ LineContentFactory factory = null;
+ if (areaNode instanceof NormalBlockArea) {
+ final LineArea lineArea = activeLineArea(areaNode.nearestArea());
+ if (lineArea == null) {
+ return null;
+ } else {
+ factory = lineArea;
+ }
+ } else if (areaNode instanceof LineContentFactory) {
+ factory = (LineContentFactory) areaNode;
+ } else {
+ throw new AreaTreeException("AreaNode " + areaNode.getAreaName()
+ + " cannot create an InlineArea.");
+ }
+ return factory;
+ }
+
+}
Property changes on: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/AbstractMixedInlinePL.java
___________________________________________________________________
Name: svn:keywords
+ "Author Id Rev Date URL"
Name: svn:eol-style
+ native
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/BasicLinkPL.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/BasicLinkPL.java 2007-07-28 00:15:41 UTC (rev 10124)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/BasicLinkPL.java 2007-07-28 00:19:46 UTC (rev 10125)
@@ -28,15 +28,15 @@
package org.foray.pioneer;
-import org.axsl.area.AreaNode;
-import org.axsl.area.AreaTreeException;
+import org.axsl.area.AncestralNormalInlineArea;
+import org.axsl.area.LineContentFactory;
import org.axsl.fo.fo.BasicLink;
import org.axsl.fo.fo.GraftingPoint;
/**
* Pioneer Layout for a {@link BasicLink}.
*/
-public class BasicLinkPL extends FObjPL {
+public class BasicLinkPL extends AbstractMixedInlinePL {
/** The real FONode which this proxy represents. */
private BasicLink realFONode;
@@ -61,9 +61,13 @@
/**
* {@inheritDoc}
*/
- public Status layout(final AreaNode areaNode,
- final GraftingPoint graftingPoint) throws AreaTreeException {
- return this.standardLayout(areaNode, graftingPoint);
+ protected AncestralNormalInlineArea makeNormalInlineArea(
+ final LineContentFactory lineContentFactory,
+ final GraftingPoint graftingPoint) {
+ final AncestralNormalInlineArea linkArea =
+ lineContentFactory.makeBasicLinkArea(this.realFONode,
+ graftingPoint);
+ return linkArea;
}
}
Added: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/BidiOverridePL.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/BidiOverridePL.java (rev 0)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/BidiOverridePL.java 2007-07-28 00:19:46 UTC (rev 10125)
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2007 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy: victormote $
+ */
+
+package org.foray.pioneer;
+
+import org.axsl.area.AncestralNormalInlineArea;
+import org.axsl.area.LineContentFactory;
+import org.axsl.fo.fo.BidiOverride;
+import org.axsl.fo.fo.GraftingPoint;
+
+/**
+ * Pioneer Layout for a {@link BidiOverride}.
+ */
+public class BidiOverridePL extends AbstractMixedInlinePL {
+
+ /** The real FONode which this proxy represents. */
+ private BidiOverride realFONode;
+
+ /**
+ * Constructor.
+ * @param realFObj The FO Tree object which is being laid out.
+ * @param layout The ancestor layout system.
+ */
+ public BidiOverridePL(final BidiOverride realFObj, final PioneerLS layout) {
+ super(realFObj, layout);
+ this.realFONode = realFObj;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public BidiOverride getFONode() {
+ return this.realFONode;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected AncestralNormalInlineArea makeNormalInlineArea(
+ final LineContentFactory lineContentFactory,
+ final GraftingPoint graftingPoint) {
+ final AncestralNormalInlineArea bidiArea =
+ lineContentFactory.makeBidiOverrideArea(this.realFONode,
+ graftingPoint);
+ return bidiArea;
+ }
+
+}
Property changes on: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/BidiOverridePL.java
___________________________________________________________________
Name: svn:keywords
+ "Author Id Rev Date URL"
Name: svn:eol-style
+ native
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/InlinePL.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/InlinePL.java 2007-07-28 00:15:41 UTC (rev 10124)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/InlinePL.java 2007-07-28 00:19:46 UTC (rev 10125)
@@ -29,20 +29,14 @@
package org.foray.pioneer;
import org.axsl.area.AncestralNormalInlineArea;
-import org.axsl.area.AreaNode;
-import org.axsl.area.AreaTreeException;
-import org.axsl.area.BlockContentFactory;
-import org.axsl.area.LineArea;
import org.axsl.area.LineContentFactory;
-import org.axsl.area.NormalBlockArea;
-import org.axsl.fo.Fo;
import org.axsl.fo.fo.GraftingPoint;
import org.axsl.fo.fo.Inline;
/**
* Pioneer Layout for a {@link Inline}.
*/
-public class InlinePL extends FObjPL {
+public class InlinePL extends AbstractMixedInlinePL {
/** The real FONode which this proxy represents. */
private Inline realFONode;
@@ -67,78 +61,13 @@
/**
* {@inheritDoc}
*/
- public Status layout(final AreaNode areaNode,
- final GraftingPoint graftingPoint) throws AreaTreeException {
- final Inline foNode = getFONode();
- if (getProgress() == FONodePL.START) {
- setProgress(0);
- }
-
- Status status = Status.OK;
- LineContentFactory lineContentFactory = null;
- for (int i = getProgress(); i < foNode.getChildCount(); i++) {
- final Fo fo = foNode.getChildAt(i);
- final FONodePL layoutProxy = getLayoutProxy(fo);
- if (fo.isBlockLevelFo()) {
- /* Remove the inline factory so that we know that we need to
- * create a new one if there is any subsequent inline
- * content.*/
- lineContentFactory = null;
- /* Since this is block content, it cannot be laid out in a
- * line. We need to find the ancestor BlockContentFactory
- * and lay out the item in it. */
- final BlockContentFactory blockContentFactory =
- areaNode.ancestorBlockContentFactory();
- status = layoutProxy.layout(blockContentFactory, graftingPoint);
- } else {
- if (lineContentFactory == null) {
- lineContentFactory = getLineContentFactory(areaNode);
- if (lineContentFactory == null) {
- /* Not enough room on the page for this. */
- return Status.AREA_FULL_NONE;
- }
- final AncestralNormalInlineArea inlineArea =
- lineContentFactory.makeInlineArea(this.realFONode,
- graftingPoint);
- this.getLayout().pushInlineStack(inlineArea);
- status = layoutProxy.layout(areaNode, graftingPoint);
- this.getLayout().popInlineStack();
- }
- }
- if (status.isIncomplete()) {
- setProgress(i);
- return status;
- }
- }
- return status;
+ protected AncestralNormalInlineArea makeNormalInlineArea(
+ final LineContentFactory lineContentFactory,
+ final GraftingPoint graftingPoint) {
+ final AncestralNormalInlineArea inlineArea =
+ lineContentFactory.makeInlineArea(this.realFONode,
+ graftingPoint);
+ return inlineArea;
}
- /**
- * Returns either a line area or an inline area that is capable of
- * containing the inline content.
- * @param areaNode The parent AreaTree node.
- * @return The area into which the line content should be placed, or null
- * if there is no room on the page for a line to contain it.
- * @throws AreaTreeException If <code>areaNode cannot contain line
- * content.</code>
- */
- private LineContentFactory getLineContentFactory(final AreaNode areaNode)
- throws AreaTreeException {
- LineContentFactory factory = null;
- if (areaNode instanceof NormalBlockArea) {
- final LineArea lineArea = activeLineArea(areaNode.nearestArea());
- if (lineArea == null) {
- return null;
- } else {
- factory = lineArea;
- }
- } else if (areaNode instanceof LineContentFactory) {
- factory = (LineContentFactory) areaNode;
- } else {
- throw new AreaTreeException("AreaNode " + areaNode.getAreaName()
- + " cannot create an InlineArea.");
- }
- return factory;
- }
-
}
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java 2007-07-28 00:15:41 UTC (rev 10124)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java 2007-07-28 00:19:46 UTC (rev 10125)
@@ -405,8 +405,8 @@
/**
* {@inheritDoc}
*/
- public NoLayoutPL makeProxy(final BidiOverride node) {
- return new NoLayoutPL(node, this);
+ public BidiOverridePL makeProxy(final BidiOverride node) {
+ return new BidiOverridePL(node, this);
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-28 00:15:39
|
Revision: 10124
http://foray.svn.sourceforge.net/foray/?rev=10124&view=rev
Author: victormote
Date: 2007-07-27 17:15:41 -0700 (Fri, 27 Jul 2007)
Log Message:
-----------
Return and use the correct "generated-by" class. Implement the right aXSL interface.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/BasicLinkArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/BidiOverrideArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/IndexPageCitationListArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberCitationLastArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/ScalingValueCitationArea.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/BasicLinkArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/BasicLinkArea.java 2007-07-27 23:18:31 UTC (rev 10123)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/BasicLinkArea.java 2007-07-28 00:15:41 UTC (rev 10124)
@@ -29,13 +29,10 @@
package org.foray.area;
import org.axsl.area.AreaTreeException;
-import org.axsl.common.value.BackgroundRepeat;
import org.axsl.common.value.BorderStyle;
import org.axsl.fo.fo.BasicLink;
import org.axsl.fo.fo.GraftingPoint;
-import org.axsl.fo.fo.Inline;
import org.axsl.galley.RenderVisitor;
-import org.axsl.graphic.Graphic;
import java.awt.Color;
@@ -43,7 +40,7 @@
* A normal inline-area generated by the fo:basic-link.
*/
public final class BasicLinkArea extends AbstractAncestralInlineArea
- implements org.axsl.galley.InlineArea,
+ implements org.axsl.galley.GeneralInlineArea,
org.axsl.area.AncestralNormalInlineArea {
/** The parent of this node. The parent can be either a {@link LineArea}
@@ -127,13 +124,6 @@
/**
* {@inheritDoc}
*/
- public Graphic getGraphic() {
- return this.traitBackgroundImage();
- }
-
- /**
- * {@inheritDoc}
- */
protected boolean optimize() {
this.optimizeChildren();
return false;
@@ -149,8 +139,8 @@
/**
* {@inheritDoc}
*/
- public Inline traitGeneratedBy() {
- return (Inline) this.getLinkage().getFONode();
+ public BasicLink traitGeneratedBy() {
+ return (BasicLink) this.getLinkage().getFONode();
}
/**
@@ -168,55 +158,6 @@
}
/**
- * {@inheritDoc}
- */
- public Graphic traitBackgroundImage() {
- return this.traitGeneratedBy().traitBackgroundImage(this);
- }
-
- /**
- * {@inheritDoc}
- */
- public Color traitBackgroundColor() {
- return traitGeneratedBy().traitBackgroundColor(this);
- }
-
- /**
- * {@inheritDoc}
- */
- public BackgroundRepeat traitBackgroundRepeat() {
- return traitGeneratedBy().traitBackgroundRepeat(this);
- }
-
- /**
- * {@inheritDoc}
- */
- public Color traitBorderBeforeColor() {
- return traitGeneratedBy().traitBorderBeforeColor(this);
- }
-
- /**
- * {@inheritDoc}
- */
- public Color traitBorderStartColor() {
- return traitGeneratedBy().traitBorderStartColor(this);
- }
-
- /**
- * {@inheritDoc}
- */
- public Color traitBorderEndColor() {
- return traitGeneratedBy().traitBorderEndColor(this);
- }
-
- /**
- * {@inheritDoc}
- */
- public Color traitBorderAfterColor() {
- return traitGeneratedBy().traitBorderAfterColor(this);
- }
-
- /**
* Returns the border style for the "start" edge of this Area.
* @return The border style for the "start" edge of this Area.
*/
@@ -322,56 +263,57 @@
* {@inheritDoc}
*/
public boolean traitUnderlineScore() {
- return traitGeneratedBy().traitUnderlineScore(this);
+ return false;
}
/**
* {@inheritDoc}
*/
public boolean traitOverlineScore() {
- return traitGeneratedBy().traitOverlineScore(this);
+ return false;
}
/**
* {@inheritDoc}
*/
public boolean traitThroughScore() {
- return traitGeneratedBy().traitThroughScore(this);
+ return false;
}
/**
* {@inheritDoc}
*/
public Color traitUnderlineScoreColor() {
- return traitGeneratedBy().traitUnderlineScoreColor(this);
+ return null;
}
/**
* {@inheritDoc}
*/
public Color traitOverlineScoreColor() {
- return traitGeneratedBy().traitOverlineScoreColor(this);
+ return null;
}
/**
* {@inheritDoc}
*/
public Color traitThroughScoreColor() {
- return traitGeneratedBy().traitThroughScoreColor(this);
+ return null;
}
/**
* {@inheritDoc}
*/
public int traitIPDimensionOpt() {
- return traitGeneratedBy().traitIpDimensionOpt(this);
+ return -1;
}
/**
* {@inheritDoc}
*/
public Color traitColor() {
- return traitGeneratedBy().traitColor(this);
+ /* Color is irrelevant. */
+ return Color.BLACK;
}
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/BidiOverrideArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/BidiOverrideArea.java 2007-07-27 23:18:31 UTC (rev 10123)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/BidiOverrideArea.java 2007-07-28 00:15:41 UTC (rev 10124)
@@ -29,13 +29,9 @@
package org.foray.area;
import org.axsl.area.AreaTreeException;
-import org.axsl.common.value.BackgroundRepeat;
-import org.axsl.common.value.BorderStyle;
import org.axsl.fo.fo.BidiOverride;
import org.axsl.fo.fo.GraftingPoint;
-import org.axsl.fo.fo.Inline;
import org.axsl.galley.RenderVisitor;
-import org.axsl.graphic.Graphic;
import java.awt.Color;
@@ -43,7 +39,7 @@
* A normal inline-area generated by the fo:bidi-override object.
*/
public final class BidiOverrideArea extends AbstractAncestralInlineArea
- implements org.axsl.galley.InlineArea,
+ implements org.axsl.galley.GeneralInlineArea,
org.axsl.area.AncestralNormalInlineArea {
/** The parent of this node. The parent can be either a {@link LineArea}
@@ -127,13 +123,6 @@
/**
* {@inheritDoc}
*/
- public Graphic getGraphic() {
- return this.traitBackgroundImage();
- }
-
- /**
- * {@inheritDoc}
- */
protected boolean optimize() {
this.optimizeChildren();
return false;
@@ -149,8 +138,8 @@
/**
* {@inheritDoc}
*/
- public Inline traitGeneratedBy() {
- return (Inline) this.getLinkage().getFONode();
+ public BidiOverride traitGeneratedBy() {
+ return (BidiOverride) this.getLinkage().getFONode();
}
/**
@@ -170,201 +159,120 @@
/**
* {@inheritDoc}
*/
- public Graphic traitBackgroundImage() {
- return this.traitGeneratedBy().traitBackgroundImage(this);
- }
-
- /**
- * {@inheritDoc}
- */
- public Color traitBackgroundColor() {
- return traitGeneratedBy().traitBackgroundColor(this);
- }
-
- /**
- * {@inheritDoc}
- */
- public BackgroundRepeat traitBackgroundRepeat() {
- return traitGeneratedBy().traitBackgroundRepeat(this);
- }
-
- /**
- * {@inheritDoc}
- */
- public Color traitBorderBeforeColor() {
- return traitGeneratedBy().traitBorderBeforeColor(this);
- }
-
- /**
- * {@inheritDoc}
- */
- public Color traitBorderStartColor() {
- return traitGeneratedBy().traitBorderStartColor(this);
- }
-
- /**
- * {@inheritDoc}
- */
- public Color traitBorderEndColor() {
- return traitGeneratedBy().traitBorderEndColor(this);
- }
-
- /**
- * {@inheritDoc}
- */
- public Color traitBorderAfterColor() {
- return traitGeneratedBy().traitBorderAfterColor(this);
- }
-
- /**
- * Returns the border style for the "start" edge of this Area.
- * @return The border style for the "start" edge of this Area.
- */
- public BorderStyle traitBorderStartStyle() {
- return traitGeneratedBy().traitBorderStartStyle(this);
- }
-
- /**
- * Returns the border style for the "end" edge of this Area.
- * @return The border style for the "end" edge of this Area.
- */
- public BorderStyle traitBorderEndStyle() {
- return traitGeneratedBy().traitBorderEndStyle(this);
- }
-
- /**
- * Returns the border style for the "before" edge of this Area.
- * @return The border style for the "before" edge of this Area.
- */
- public BorderStyle traitBorderBeforeStyle() {
- return traitGeneratedBy().traitBorderBeforeStyle(this);
- }
-
- /**
- * Returns the border style for the "after" edge of this Area.
- * @return The border style for the "after" edge of this Area.
- */
- public BorderStyle traitBorderAfterStyle() {
- return traitGeneratedBy().traitBorderAfterStyle(this);
- }
-
- /**
- * {@inheritDoc}
- */
public int traitBorderStartWidth() {
- return traitGeneratedBy().traitBorderStartWidth(this);
+ return 0;
}
/**
* {@inheritDoc}
*/
public int traitBorderEndWidth() {
- return traitGeneratedBy().traitBorderEndWidth(this);
+ return 0;
}
/**
* {@inheritDoc}
*/
public int traitBorderBeforeWidth() {
- return traitGeneratedBy().traitBorderBeforeWidth(this);
+ return 0;
}
/**
* {@inheritDoc}
*/
public int traitBorderAfterWidth() {
- return traitGeneratedBy().traitBorderAfterWidth(this);
+ return 0;
}
/**
* {@inheritDoc}
*/
public int traitPaddingStart() {
- return traitGeneratedBy().traitPaddingStart(this);
+ return 0;
}
/**
* {@inheritDoc}
*/
public int traitPaddingEnd() {
- return traitGeneratedBy().traitPaddingEnd(this);
+ return 0;
}
/**
* {@inheritDoc}
*/
public int traitPaddingBefore() {
- return traitGeneratedBy().traitPaddingBefore(this);
+ return 0;
}
/**
* {@inheritDoc}
*/
public int traitPaddingAfter() {
- return traitGeneratedBy().traitPaddingAfter(this);
+ return 0;
}
/**
* {@inheritDoc}
*/
public int traitSpaceStartOptimum() {
- return traitGeneratedBy().traitSpaceStartOptimum(this);
+ return 0;
}
/**
* {@inheritDoc}
*/
public int traitSpaceEndOptimum() {
- return traitGeneratedBy().traitSpaceEndOptimum(this);
+ return 0;
}
/**
* {@inheritDoc}
*/
public boolean traitUnderlineScore() {
- return traitGeneratedBy().traitUnderlineScore(this);
+ return false;
}
/**
* {@inheritDoc}
*/
public boolean traitOverlineScore() {
- return traitGeneratedBy().traitOverlineScore(this);
+ return false;
}
/**
* {@inheritDoc}
*/
public boolean traitThroughScore() {
- return traitGeneratedBy().traitThroughScore(this);
+ return false;
}
/**
* {@inheritDoc}
*/
public Color traitUnderlineScoreColor() {
- return traitGeneratedBy().traitUnderlineScoreColor(this);
+ return null;
}
/**
* {@inheritDoc}
*/
public Color traitOverlineScoreColor() {
- return traitGeneratedBy().traitOverlineScoreColor(this);
+ return null;
}
/**
* {@inheritDoc}
*/
public Color traitThroughScoreColor() {
- return traitGeneratedBy().traitThroughScoreColor(this);
+ return null;
}
/**
* {@inheritDoc}
*/
public int traitIPDimensionOpt() {
- return traitGeneratedBy().traitIpDimensionOpt(this);
+ return -1;
}
/**
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/IndexPageCitationListArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/IndexPageCitationListArea.java 2007-07-27 23:18:31 UTC (rev 10123)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/IndexPageCitationListArea.java 2007-07-28 00:15:41 UTC (rev 10124)
@@ -29,13 +29,9 @@
package org.foray.area;
import org.axsl.area.AreaTreeException;
-import org.axsl.common.value.BackgroundRepeat;
-import org.axsl.common.value.BorderStyle;
import org.axsl.fo.fo.GraftingPoint;
import org.axsl.fo.fo.IndexPageCitationList;
-import org.axsl.fo.fo.Inline;
import org.axsl.galley.RenderVisitor;
-import org.axsl.graphic.Graphic;
import java.awt.Color;
@@ -43,7 +39,7 @@
* A normal inline-area generated by the fo:index-page-citation-list object.
*/
public final class IndexPageCitationListArea extends AbstractAncestralInlineArea
- implements org.axsl.galley.InlineArea,
+ implements org.axsl.galley.GeneralInlineArea,
org.axsl.area.AncestralNormalInlineArea {
/** The parent of this node. The parent can be either a {@link LineArea}
@@ -131,13 +127,6 @@
/**
* {@inheritDoc}
*/
- public Graphic getGraphic() {
- return this.traitBackgroundImage();
- }
-
- /**
- * {@inheritDoc}
- */
protected boolean optimize() {
this.optimizeChildren();
return false;
@@ -153,8 +142,8 @@
/**
* {@inheritDoc}
*/
- public Inline traitGeneratedBy() {
- return (Inline) this.getLinkage().getFONode();
+ public IndexPageCitationList traitGeneratedBy() {
+ return (IndexPageCitationList) this.getLinkage().getFONode();
}
/**
@@ -174,208 +163,128 @@
/**
* {@inheritDoc}
*/
- public Graphic traitBackgroundImage() {
- return this.traitGeneratedBy().traitBackgroundImage(this);
- }
-
- /**
- * {@inheritDoc}
- */
- public Color traitBackgroundColor() {
- return traitGeneratedBy().traitBackgroundColor(this);
- }
-
- /**
- * {@inheritDoc}
- */
- public BackgroundRepeat traitBackgroundRepeat() {
- return traitGeneratedBy().traitBackgroundRepeat(this);
- }
-
- /**
- * {@inheritDoc}
- */
- public Color traitBorderBeforeColor() {
- return traitGeneratedBy().traitBorderBeforeColor(this);
- }
-
- /**
- * {@inheritDoc}
- */
- public Color traitBorderStartColor() {
- return traitGeneratedBy().traitBorderStartColor(this);
- }
-
- /**
- * {@inheritDoc}
- */
- public Color traitBorderEndColor() {
- return traitGeneratedBy().traitBorderEndColor(this);
- }
-
- /**
- * {@inheritDoc}
- */
- public Color traitBorderAfterColor() {
- return traitGeneratedBy().traitBorderAfterColor(this);
- }
-
- /**
- * Returns the border style for the "start" edge of this Area.
- * @return The border style for the "start" edge of this Area.
- */
- public BorderStyle traitBorderStartStyle() {
- return traitGeneratedBy().traitBorderStartStyle(this);
- }
-
- /**
- * Returns the border style for the "end" edge of this Area.
- * @return The border style for the "end" edge of this Area.
- */
- public BorderStyle traitBorderEndStyle() {
- return traitGeneratedBy().traitBorderEndStyle(this);
- }
-
- /**
- * Returns the border style for the "before" edge of this Area.
- * @return The border style for the "before" edge of this Area.
- */
- public BorderStyle traitBorderBeforeStyle() {
- return traitGeneratedBy().traitBorderBeforeStyle(this);
- }
-
- /**
- * Returns the border style for the "after" edge of this Area.
- * @return The border style for the "after" edge of this Area.
- */
- public BorderStyle traitBorderAfterStyle() {
- return traitGeneratedBy().traitBorderAfterStyle(this);
- }
-
- /**
- * {@inheritDoc}
- */
public int traitBorderStartWidth() {
- return traitGeneratedBy().traitBorderStartWidth(this);
+ return 0;
}
/**
* {@inheritDoc}
*/
public int traitBorderEndWidth() {
- return traitGeneratedBy().traitBorderEndWidth(this);
+ return 0;
}
/**
* {@inheritDoc}
*/
public int traitBorderBeforeWidth() {
- return traitGeneratedBy().traitBorderBeforeWidth(this);
+ return 0;
}
/**
* {@inheritDoc}
*/
public int traitBorderAfterWidth() {
- return traitGeneratedBy().traitBorderAfterWidth(this);
+ return 0;
}
/**
* {@inheritDoc}
*/
public int traitPaddingStart() {
- return traitGeneratedBy().traitPaddingStart(this);
+ return 0;
}
/**
* {@inheritDoc}
*/
public int traitPaddingEnd() {
- return traitGeneratedBy().traitPaddingEnd(this);
+ return 0;
}
/**
* {@inheritDoc}
*/
public int traitPaddingBefore() {
- return traitGeneratedBy().traitPaddingBefore(this);
+ return 0;
}
/**
* {@inheritDoc}
*/
public int traitPaddingAfter() {
- return traitGeneratedBy().traitPaddingAfter(this);
+ return 0;
}
/**
* {@inheritDoc}
*/
public int traitSpaceStartOptimum() {
- return traitGeneratedBy().traitSpaceStartOptimum(this);
+ return -1;
}
/**
* {@inheritDoc}
*/
public int traitSpaceEndOptimum() {
- return traitGeneratedBy().traitSpaceEndOptimum(this);
+ return -1;
}
/**
* {@inheritDoc}
*/
public boolean traitUnderlineScore() {
- return traitGeneratedBy().traitUnderlineScore(this);
+ return false;
}
/**
* {@inheritDoc}
*/
public boolean traitOverlineScore() {
- return traitGeneratedBy().traitOverlineScore(this);
+ return false;
}
/**
* {@inheritDoc}
*/
public boolean traitThroughScore() {
- return traitGeneratedBy().traitThroughScore(this);
+ return false;
}
/**
* {@inheritDoc}
*/
public Color traitUnderlineScoreColor() {
- return traitGeneratedBy().traitUnderlineScoreColor(this);
+ return null;
}
/**
* {@inheritDoc}
*/
public Color traitOverlineScoreColor() {
- return traitGeneratedBy().traitOverlineScoreColor(this);
+ return null;
}
/**
* {@inheritDoc}
*/
public Color traitThroughScoreColor() {
- return traitGeneratedBy().traitThroughScoreColor(this);
+ return null;
}
/**
* {@inheritDoc}
*/
public int traitIPDimensionOpt() {
- return traitGeneratedBy().traitIpDimensionOpt(this);
+ return -1;
}
/**
* {@inheritDoc}
*/
public Color traitColor() {
- return traitGeneratedBy().traitColor(this);
+ /* Color is irrelevant. */
+ return Color.BLACK;
}
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberCitationLastArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberCitationLastArea.java 2007-07-27 23:18:31 UTC (rev 10123)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberCitationLastArea.java 2007-07-28 00:15:41 UTC (rev 10124)
@@ -31,7 +31,6 @@
import org.axsl.area.AreaTreeException;
import org.axsl.fo.Fo;
import org.axsl.fo.fo.GraftingPoint;
-import org.axsl.fo.fo.PageNumberCitation;
import org.axsl.fo.fo.PageNumberCitationLast;
import org.axsl.font.Font;
import org.axsl.font.FontUse;
@@ -186,8 +185,8 @@
/**
* {@inheritDoc}
*/
- public PageNumberCitation traitGeneratedBy() {
- return (PageNumberCitation) this.getLinkage().getFONode();
+ public PageNumberCitationLast traitGeneratedBy() {
+ return (PageNumberCitationLast) this.getLinkage().getFONode();
}
/**
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/ScalingValueCitationArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/ScalingValueCitationArea.java 2007-07-27 23:18:31 UTC (rev 10123)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/ScalingValueCitationArea.java 2007-07-28 00:15:41 UTC (rev 10124)
@@ -31,7 +31,6 @@
import org.axsl.area.AreaTreeException;
import org.axsl.fo.Fo;
import org.axsl.fo.fo.GraftingPoint;
-import org.axsl.fo.fo.PageNumber;
import org.axsl.fo.fo.ScalingValueCitation;
import org.axsl.font.Font;
import org.axsl.font.FontUse;
@@ -179,8 +178,8 @@
/**
* {@inheritDoc}
*/
- public PageNumber traitGeneratedBy() {
- return (PageNumber) this.getLinkage().getFONode();
+ public ScalingValueCitation traitGeneratedBy() {
+ return (ScalingValueCitation) this.getLinkage().getFONode();
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-27 23:18:28
|
Revision: 10123
http://foray.svn.sourceforge.net/foray/?rev=10123&view=rev
Author: victormote
Date: 2007-07-27 16:18:31 -0700 (Fri, 27 Jul 2007)
Log Message:
-----------
Cosmetic change only. Make order of methods consistent.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2007-07-27 22:54:08 UTC (rev 10122)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2007-07-27 23:18:31 UTC (rev 10123)
@@ -1005,14 +1005,20 @@
/**
* {@inheritDoc}
*/
- public ForeignObjectArea makeForeignObjectArea(
- final InstreamForeignObject ifo, final int ipd,
+ public TextArea makeTextArea(final CharacterContent foText,
+ final int ipd, final int startOffset, final int sizeInChars,
+ final boolean hasDiscretionaryHyphen,
+ final boolean hasFauxSmallCaps, final boolean isLastItemOnLine,
final GraftingPoint graftingPoint) {
- final ForeignObjectArea newForeignArea
- = ForeignObjectArea.makeForeignObjectArea(ifo, this,
- graftingPoint, ipd);
- this.children.add(newForeignArea);
- return newForeignArea;
+ if (shouldCreateTextArea(foText, this, startOffset, sizeInChars,
+ isLastItemOnLine, this)) {
+ final TextArea newTextArea = TextArea.makeTextArea(foText, this,
+ graftingPoint, startOffset, sizeInChars, ipd,
+ hasDiscretionaryHyphen, hasFauxSmallCaps);
+ this.children.add(newTextArea);
+ return newTextArea;
+ }
+ return null;
}
/**
@@ -1031,12 +1037,14 @@
/**
* {@inheritDoc}
*/
- public LeaderArea makeLeaderArea(final Leader leader, final int ipd,
- final GraftingPoint graftingPoint) throws AreaTreeException {
- final LeaderArea newLeaderArea = LeaderArea.makeLeaderArea(leader, this,
- graftingPoint, ipd);
- this.children.add(newLeaderArea);
- return newLeaderArea;
+ public ForeignObjectArea makeForeignObjectArea(
+ final InstreamForeignObject ifo, final int ipd,
+ final GraftingPoint graftingPoint) {
+ final ForeignObjectArea newForeignArea
+ = ForeignObjectArea.makeForeignObjectArea(ifo, this,
+ graftingPoint, ipd);
+ this.children.add(newForeignArea);
+ return newForeignArea;
}
/**
@@ -1066,6 +1074,17 @@
/**
* {@inheritDoc}
*/
+ public LeaderArea makeLeaderArea(final Leader leader, final int ipd,
+ final GraftingPoint graftingPoint) throws AreaTreeException {
+ final LeaderArea newLeaderArea = LeaderArea.makeLeaderArea(leader, this,
+ graftingPoint, ipd);
+ this.children.add(newLeaderArea);
+ return newLeaderArea;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
public PageNumberArea makePageNumberArea(
final PageNumber pageNumber, final int ipd,
final GraftingPoint graftingPoint) {
@@ -1118,25 +1137,6 @@
/**
* {@inheritDoc}
*/
- public TextArea makeTextArea(final CharacterContent foText,
- final int ipd, final int startOffset, final int sizeInChars,
- final boolean hasDiscretionaryHyphen,
- final boolean hasFauxSmallCaps, final boolean isLastItemOnLine,
- final GraftingPoint graftingPoint) {
- if (shouldCreateTextArea(foText, this, startOffset, sizeInChars,
- isLastItemOnLine, this)) {
- final TextArea newTextArea = TextArea.makeTextArea(foText, this,
- graftingPoint, startOffset, sizeInChars, ipd,
- hasDiscretionaryHyphen, hasFauxSmallCaps);
- this.children.add(newTextArea);
- return newTextArea;
- }
- return null;
- }
-
- /**
- * {@inheritDoc}
- */
public BasicLinkArea makeBasicLinkArea(final BasicLink basicLink,
final GraftingPoint graftingPoint) {
final BasicLinkArea newLinkArea = BasicLinkArea.makeBasicLinkArea(
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-27 22:54:06
|
Revision: 10122
http://foray.svn.sourceforge.net/foray/?rev=10122&view=rev
Author: victormote
Date: 2007-07-27 15:54:08 -0700 (Fri, 27 Jul 2007)
Log Message:
-----------
1. Conform to axsl changes adding missing factory methods for inline content.
2. Add classes needed for above.
3. Create abstract superclass for inline area classes that contain (create) other areas.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/InlineArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberCitationArea.java
Added Paths:
-----------
trunk/foray/foray-areatree/src/java/org/foray/area/AbstractAncestralInlineArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/BasicLinkArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/BidiOverrideArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/IndexPageCitationListArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberCitationLastArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/ScalingValueCitationArea.java
Added: trunk/foray/foray-areatree/src/java/org/foray/area/AbstractAncestralInlineArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/AbstractAncestralInlineArea.java (rev 0)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/AbstractAncestralInlineArea.java 2007-07-27 22:54:08 UTC (rev 10122)
@@ -0,0 +1,237 @@
+/*
+ * Copyright 2007 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+
+package org.foray.area;
+
+import org.axsl.area.AreaTreeException;
+import org.axsl.fo.fo.BasicLink;
+import org.axsl.fo.fo.BidiOverride;
+import org.axsl.fo.fo.CharacterContent;
+import org.axsl.fo.fo.ExternalGraphic;
+import org.axsl.fo.fo.GraftingPoint;
+import org.axsl.fo.fo.IndexPageCitationList;
+import org.axsl.fo.fo.Inline;
+import org.axsl.fo.fo.InlineContainer;
+import org.axsl.fo.fo.InstreamForeignObject;
+import org.axsl.fo.fo.Leader;
+import org.axsl.fo.fo.PageNumber;
+import org.axsl.fo.fo.PageNumberCitation;
+import org.axsl.fo.fo.PageNumberCitationLast;
+import org.axsl.fo.fo.ScalingValueCitation;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Abstract superclass for inline area classes that can create children.
+ */
+public abstract class AbstractAncestralInlineArea extends AbstractInlineArea
+ implements org.axsl.area.AncestralNormalInlineArea {
+
+ /** The children of this node. */
+ private List<AbstractInlineArea> children
+ = new ArrayList<AbstractInlineArea>();
+
+ /**
+ * {@inheritDoc}
+ */
+ public List<AbstractInlineArea> getChildren() {
+ return this.children;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public BidiOverrideArea makeBidiOverrideArea(
+ final BidiOverride bidiOverride,
+ final GraftingPoint graftingPoint) {
+ final BidiOverrideArea newBidiArea =
+ BidiOverrideArea.makeBidiOverrideArea(bidiOverride, this,
+ graftingPoint);
+ this.children.add(newBidiArea);
+ return newBidiArea;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public TextArea makeTextArea(final CharacterContent foText,
+ final int ipd, final int startOffset, final int sizeInChars,
+ final boolean hasDiscretionaryHyphen,
+ final boolean hasFauxSmallCaps, final boolean isLastItemOnLine,
+ final GraftingPoint graftingPoint) {
+ if (LineArea.shouldCreateTextArea(foText, this, startOffset,
+ sizeInChars, isLastItemOnLine, this)) {
+ final TextArea newTextArea = TextArea.makeTextArea(foText, this,
+ graftingPoint, startOffset, sizeInChars, ipd,
+ hasDiscretionaryHyphen, hasFauxSmallCaps);
+ this.children.add(newTextArea);
+ return newTextArea;
+ }
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public ExternalGraphicArea makeExternalGraphicArea(
+ final ExternalGraphic ifo, final int ipd,
+ final GraftingPoint graftingPoint) {
+ final ExternalGraphicArea newEgArea
+ = ExternalGraphicArea.makeExternalGraphicArea(ifo, this,
+ graftingPoint, ipd);
+ this.children.add(newEgArea);
+ return newEgArea;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public ForeignObjectArea makeForeignObjectArea(
+ final InstreamForeignObject ifo, final int ipd,
+ final GraftingPoint graftingPoint) {
+ final ForeignObjectArea newForeignArea
+ = ForeignObjectArea.makeForeignObjectArea(ifo, this,
+ graftingPoint, ipd);
+ this.children.add(newForeignArea);
+ return newForeignArea;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public InlineArea makeInlineArea(final Inline inline,
+ final GraftingPoint graftingPoint) {
+ final InlineArea newInlineArea = InlineArea.makeInlineArea(inline, this,
+ graftingPoint);
+ this.children.add(newInlineArea);
+ return newInlineArea;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public InlineContainerArea makeInlineContainerArea(
+ final InlineContainer inlineContainer,
+ final GraftingPoint graftingPoint) {
+ final InlineContainerArea newInlineContainerArea =
+ InlineContainerArea.makeInlineContainerArea(inlineContainer,
+ this, graftingPoint);
+ this.children.add(newInlineContainerArea);
+ return newInlineContainerArea;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public LeaderArea makeLeaderArea(
+ final Leader leader, final int ipd,
+ final GraftingPoint graftingPoint) throws AreaTreeException {
+ final LeaderArea newLeaderArea = LeaderArea.makeLeaderArea(leader, this,
+ graftingPoint, ipd);
+ this.children.add(newLeaderArea);
+ return newLeaderArea;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public PageNumberArea makePageNumberArea(
+ final PageNumber pageNumber, final int ipd,
+ final GraftingPoint graftingPoint) {
+ final PageNumberArea newPageNumberArea
+ = PageNumberArea.makePageNumberArea(pageNumber, this,
+ graftingPoint, ipd);
+ this.children.add(newPageNumberArea);
+ return newPageNumberArea;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public PageNumberCitationArea makePageNumberCitationArea(
+ final PageNumberCitation citation, final int ipd,
+ final GraftingPoint graftingPoint) {
+ final PageNumberCitationArea newCitationArea =
+ PageNumberCitationArea.makePageNumberCitationArea(citation,
+ this, graftingPoint, ipd);
+ this.children.add(newCitationArea);
+ return newCitationArea;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public PageNumberCitationLastArea makePageNumberCitationLastArea(
+ final PageNumberCitationLast citation, final int ipd,
+ final GraftingPoint graftingPoint) {
+ final PageNumberCitationLastArea newCitationArea =
+ PageNumberCitationLastArea.makePageNumberCitationLastArea(
+ citation, this, graftingPoint, ipd);
+ this.children.add(newCitationArea);
+ return newCitationArea;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public ScalingValueCitationArea makeScalingValueCitationArea(
+ final ScalingValueCitation citation, final int ipd,
+ final GraftingPoint graftingPoint) {
+ final ScalingValueCitationArea newCitationArea =
+ ScalingValueCitationArea.makeScalingValueCitationArea(
+ citation, this, graftingPoint, ipd);
+ this.children.add(newCitationArea);
+ return newCitationArea;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public BasicLinkArea makeBasicLinkArea(final BasicLink basicLink,
+ final GraftingPoint graftingPoint) {
+ final BasicLinkArea newLinkArea = BasicLinkArea.makeBasicLinkArea(
+ basicLink, this, graftingPoint);
+ this.children.add(newLinkArea);
+ return newLinkArea;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public IndexPageCitationListArea makeIndexPageCitationListArea(
+ final IndexPageCitationList indexPcl,
+ final GraftingPoint graftingPoint) {
+ final IndexPageCitationListArea newIpclArea =
+ IndexPageCitationListArea.makeIndexPageCitationListArea(
+ indexPcl, this, graftingPoint);
+ this.children.add(newIpclArea);
+ return newIpclArea;
+ }
+
+}
Property changes on: trunk/foray/foray-areatree/src/java/org/foray/area/AbstractAncestralInlineArea.java
___________________________________________________________________
Name: svn:keywords
+ "Author Id Rev Date URL"
Name: svn:eol-style
+ native
Added: trunk/foray/foray-areatree/src/java/org/foray/area/BasicLinkArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/BasicLinkArea.java (rev 0)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/BasicLinkArea.java 2007-07-27 22:54:08 UTC (rev 10122)
@@ -0,0 +1,377 @@
+/*
+ * Copyright 2004 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy: victormote $
+ */
+
+package org.foray.area;
+
+import org.axsl.area.AreaTreeException;
+import org.axsl.common.value.BackgroundRepeat;
+import org.axsl.common.value.BorderStyle;
+import org.axsl.fo.fo.BasicLink;
+import org.axsl.fo.fo.GraftingPoint;
+import org.axsl.fo.fo.Inline;
+import org.axsl.galley.RenderVisitor;
+import org.axsl.graphic.Graphic;
+
+import java.awt.Color;
+
+/**
+ * A normal inline-area generated by the fo:basic-link.
+ */
+public final class BasicLinkArea extends AbstractAncestralInlineArea
+ implements org.axsl.galley.InlineArea,
+ org.axsl.area.AncestralNormalInlineArea {
+
+ /** The parent of this node. The parent can be either a {@link LineArea}
+ * or another {@link AbstractInlineArea}. */
+ private Area parent;
+
+ /** The "generated-by" trait, as defined in Section 6.1.1. */
+ private FOLinkage generatedBy;
+
+ /**
+ * Private Constructor for a LineArea parent.
+ * @param parentArea The parent area.
+ */
+ private BasicLinkArea(final LineArea parentArea) {
+ this.parent = parentArea;
+ }
+
+ /**
+ * Private Constructor for an AbstractInlineArea parent.
+ * @param parentArea The parent area.
+ */
+ private BasicLinkArea(final AbstractInlineArea parentArea) {
+ this.parent = parentArea;
+ }
+
+ /**
+ * Package-visible factory method for a LineArea parent.
+ * @param generatedBy The FO node generating this area.
+ * @param parentArea The parent area.
+ * @param graftingPoint The ancestor retrieve-marker, if any, for this
+ * area.
+ * @return The new instance.
+ */
+ static BasicLinkArea makeBasicLinkArea(final BasicLink generatedBy,
+ final LineArea parentArea, final GraftingPoint graftingPoint) {
+ final BasicLinkArea newLinkArea = new BasicLinkArea(parentArea);
+ newLinkArea.generatedBy = newLinkArea.linkage(generatedBy,
+ graftingPoint);
+ newLinkArea.registerWithLinkage(graftingPoint);
+ final int initialPD = newLinkArea.computeInitialPD();
+ newLinkArea.setProgressionDimension(initialPD);
+ newLinkArea.initializeAnteriorSpace();
+ return newLinkArea;
+ }
+
+ /**
+ * Package-visible factory method for an AbstractInlineArea parent.
+ * @param generatedBy The FO node generating this area.
+ * @param parentArea The parent area.
+ * @param graftingPoint The ancestor retrieve-marker, if any, for this
+ * area.
+ * @return The new instance.
+ */
+ static BasicLinkArea makeBasicLinkArea(final BasicLink generatedBy,
+ final AbstractInlineArea parentArea,
+ final GraftingPoint graftingPoint) {
+ final BasicLinkArea newLinkArea = new BasicLinkArea(parentArea);
+ newLinkArea.generatedBy = newLinkArea.linkage(generatedBy,
+ graftingPoint);
+ newLinkArea.registerWithLinkage(graftingPoint);
+ final int initialPD = newLinkArea.computeInitialPD();
+ newLinkArea.setProgressionDimension(initialPD);
+ newLinkArea.initializeAnteriorSpace();
+ return newLinkArea;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getAreaName() {
+ return "basic-link";
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void render(final RenderVisitor visitor) {
+ visitor.render(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Graphic getGraphic() {
+ return this.traitBackgroundImage();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected boolean optimize() {
+ this.optimizeChildren();
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public FOLinkage getLinkage() {
+ return this.generatedBy;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Inline traitGeneratedBy() {
+ return (Inline) this.getLinkage().getFONode();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Area getParent() {
+ return this.parent;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setParent(final AreaNode node) throws AreaTreeException {
+ this.parent = this.validateNewParent(node);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Graphic traitBackgroundImage() {
+ return this.traitGeneratedBy().traitBackgroundImage(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Color traitBackgroundColor() {
+ return traitGeneratedBy().traitBackgroundColor(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public BackgroundRepeat traitBackgroundRepeat() {
+ return traitGeneratedBy().traitBackgroundRepeat(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Color traitBorderBeforeColor() {
+ return traitGeneratedBy().traitBorderBeforeColor(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Color traitBorderStartColor() {
+ return traitGeneratedBy().traitBorderStartColor(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Color traitBorderEndColor() {
+ return traitGeneratedBy().traitBorderEndColor(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Color traitBorderAfterColor() {
+ return traitGeneratedBy().traitBorderAfterColor(this);
+ }
+
+ /**
+ * Returns the border style for the "start" edge of this Area.
+ * @return The border style for the "start" edge of this Area.
+ */
+ public BorderStyle traitBorderStartStyle() {
+ return traitGeneratedBy().traitBorderStartStyle(this);
+ }
+
+ /**
+ * Returns the border style for the "end" edge of this Area.
+ * @return The border style for the "end" edge of this Area.
+ */
+ public BorderStyle traitBorderEndStyle() {
+ return traitGeneratedBy().traitBorderEndStyle(this);
+ }
+
+ /**
+ * Returns the border style for the "before" edge of this Area.
+ * @return The border style for the "before" edge of this Area.
+ */
+ public BorderStyle traitBorderBeforeStyle() {
+ return traitGeneratedBy().traitBorderBeforeStyle(this);
+ }
+
+ /**
+ * Returns the border style for the "after" edge of this Area.
+ * @return The border style for the "after" edge of this Area.
+ */
+ public BorderStyle traitBorderAfterStyle() {
+ return traitGeneratedBy().traitBorderAfterStyle(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int traitBorderStartWidth() {
+ return traitGeneratedBy().traitBorderStartWidth(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int traitBorderEndWidth() {
+ return traitGeneratedBy().traitBorderEndWidth(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int traitBorderBeforeWidth() {
+ return traitGeneratedBy().traitBorderBeforeWidth(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int traitBorderAfterWidth() {
+ return traitGeneratedBy().traitBorderAfterWidth(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int traitPaddingStart() {
+ return traitGeneratedBy().traitPaddingStart(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int traitPaddingEnd() {
+ return traitGeneratedBy().traitPaddingEnd(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int traitPaddingBefore() {
+ return traitGeneratedBy().traitPaddingBefore(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int traitPaddingAfter() {
+ return traitGeneratedBy().traitPaddingAfter(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int traitSpaceStartOptimum() {
+ return traitGeneratedBy().traitSpaceStartOptimum(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int traitSpaceEndOptimum() {
+ return traitGeneratedBy().traitSpaceEndOptimum(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean traitUnderlineScore() {
+ return traitGeneratedBy().traitUnderlineScore(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean traitOverlineScore() {
+ return traitGeneratedBy().traitOverlineScore(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean traitThroughScore() {
+ return traitGeneratedBy().traitThroughScore(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Color traitUnderlineScoreColor() {
+ return traitGeneratedBy().traitUnderlineScoreColor(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Color traitOverlineScoreColor() {
+ return traitGeneratedBy().traitOverlineScoreColor(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Color traitThroughScoreColor() {
+ return traitGeneratedBy().traitThroughScoreColor(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int traitIPDimensionOpt() {
+ return traitGeneratedBy().traitIpDimensionOpt(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Color traitColor() {
+ return traitGeneratedBy().traitColor(this);
+ }
+
+}
Property changes on: trunk/foray/foray-areatree/src/java/org/foray/area/BasicLinkArea.java
___________________________________________________________________
Name: svn:keywords
+ "Author Id Rev Date URL"
Name: svn:eol-style
+ native
Added: trunk/foray/foray-areatree/src/java/org/foray/area/BidiOverrideArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/BidiOverrideArea.java (rev 0)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/BidiOverrideArea.java 2007-07-27 22:54:08 UTC (rev 10122)
@@ -0,0 +1,377 @@
+/*
+ * Copyright 2004 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy: victormote $
+ */
+
+package org.foray.area;
+
+import org.axsl.area.AreaTreeException;
+import org.axsl.common.value.BackgroundRepeat;
+import org.axsl.common.value.BorderStyle;
+import org.axsl.fo.fo.BidiOverride;
+import org.axsl.fo.fo.GraftingPoint;
+import org.axsl.fo.fo.Inline;
+import org.axsl.galley.RenderVisitor;
+import org.axsl.graphic.Graphic;
+
+import java.awt.Color;
+
+/**
+ * A normal inline-area generated by the fo:bidi-override object.
+ */
+public final class BidiOverrideArea extends AbstractAncestralInlineArea
+ implements org.axsl.galley.InlineArea,
+ org.axsl.area.AncestralNormalInlineArea {
+
+ /** The parent of this node. The parent can be either a {@link LineArea}
+ * or another {@link AbstractInlineArea}. */
+ private Area parent;
+
+ /** The "generated-by" trait, as defined in Section 6.1.1. */
+ private FOLinkage generatedBy;
+
+ /**
+ * Private Constructor for a LineArea parent.
+ * @param parentArea The parent area.
+ */
+ private BidiOverrideArea(final LineArea parentArea) {
+ this.parent = parentArea;
+ }
+
+ /**
+ * Private Constructor for an AbstractInlineArea parent.
+ * @param parentArea The parent area.
+ */
+ private BidiOverrideArea(final AbstractInlineArea parentArea) {
+ this.parent = parentArea;
+ }
+
+ /**
+ * Package-visible factory method for a LineArea parent.
+ * @param generatedBy The FO node generating this area.
+ * @param parentArea The parent area.
+ * @param graftingPoint The ancestor retrieve-marker, if any, for this
+ * area.
+ * @return The new instance.
+ */
+ static BidiOverrideArea makeBidiOverrideArea(final BidiOverride generatedBy,
+ final LineArea parentArea, final GraftingPoint graftingPoint) {
+ final BidiOverrideArea newBidiArea = new BidiOverrideArea(parentArea);
+ newBidiArea.generatedBy = newBidiArea.linkage(generatedBy,
+ graftingPoint);
+ newBidiArea.registerWithLinkage(graftingPoint);
+ final int initialPD = newBidiArea.computeInitialPD();
+ newBidiArea.setProgressionDimension(initialPD);
+ newBidiArea.initializeAnteriorSpace();
+ return newBidiArea;
+ }
+
+ /**
+ * Package-visible factory method for an AbstractInlineArea parent.
+ * @param generatedBy The FO node generating this area.
+ * @param parentArea The parent area.
+ * @param graftingPoint The ancestor retrieve-marker, if any, for this
+ * area.
+ * @return The new instance.
+ */
+ static BidiOverrideArea makeBidiOverrideArea(final BidiOverride generatedBy,
+ final AbstractInlineArea parentArea,
+ final GraftingPoint graftingPoint) {
+ final BidiOverrideArea newBidiArea = new BidiOverrideArea(parentArea);
+ newBidiArea.generatedBy = newBidiArea.linkage(generatedBy,
+ graftingPoint);
+ newBidiArea.registerWithLinkage(graftingPoint);
+ final int initialPD = newBidiArea.computeInitialPD();
+ newBidiArea.setProgressionDimension(initialPD);
+ newBidiArea.initializeAnteriorSpace();
+ return newBidiArea;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getAreaName() {
+ return "bidi-override";
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void render(final RenderVisitor visitor) {
+ visitor.render(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Graphic getGraphic() {
+ return this.traitBackgroundImage();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected boolean optimize() {
+ this.optimizeChildren();
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public FOLinkage getLinkage() {
+ return this.generatedBy;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Inline traitGeneratedBy() {
+ return (Inline) this.getLinkage().getFONode();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Area getParent() {
+ return this.parent;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setParent(final AreaNode node) throws AreaTreeException {
+ this.parent = this.validateNewParent(node);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Graphic traitBackgroundImage() {
+ return this.traitGeneratedBy().traitBackgroundImage(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Color traitBackgroundColor() {
+ return traitGeneratedBy().traitBackgroundColor(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public BackgroundRepeat traitBackgroundRepeat() {
+ return traitGeneratedBy().traitBackgroundRepeat(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Color traitBorderBeforeColor() {
+ return traitGeneratedBy().traitBorderBeforeColor(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Color traitBorderStartColor() {
+ return traitGeneratedBy().traitBorderStartColor(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Color traitBorderEndColor() {
+ return traitGeneratedBy().traitBorderEndColor(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Color traitBorderAfterColor() {
+ return traitGeneratedBy().traitBorderAfterColor(this);
+ }
+
+ /**
+ * Returns the border style for the "start" edge of this Area.
+ * @return The border style for the "start" edge of this Area.
+ */
+ public BorderStyle traitBorderStartStyle() {
+ return traitGeneratedBy().traitBorderStartStyle(this);
+ }
+
+ /**
+ * Returns the border style for the "end" edge of this Area.
+ * @return The border style for the "end" edge of this Area.
+ */
+ public BorderStyle traitBorderEndStyle() {
+ return traitGeneratedBy().traitBorderEndStyle(this);
+ }
+
+ /**
+ * Returns the border style for the "before" edge of this Area.
+ * @return The border style for the "before" edge of this Area.
+ */
+ public BorderStyle traitBorderBeforeStyle() {
+ return traitGeneratedBy().traitBorderBeforeStyle(this);
+ }
+
+ /**
+ * Returns the border style for the "after" edge of this Area.
+ * @return The border style for the "after" edge of this Area.
+ */
+ public BorderStyle traitBorderAfterStyle() {
+ return traitGeneratedBy().traitBorderAfterStyle(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int traitBorderStartWidth() {
+ return traitGeneratedBy().traitBorderStartWidth(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int traitBorderEndWidth() {
+ return traitGeneratedBy().traitBorderEndWidth(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int traitBorderBeforeWidth() {
+ return traitGeneratedBy().traitBorderBeforeWidth(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int traitBorderAfterWidth() {
+ return traitGeneratedBy().traitBorderAfterWidth(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int traitPaddingStart() {
+ return traitGeneratedBy().traitPaddingStart(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int traitPaddingEnd() {
+ return traitGeneratedBy().traitPaddingEnd(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int traitPaddingBefore() {
+ return traitGeneratedBy().traitPaddingBefore(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int traitPaddingAfter() {
+ return traitGeneratedBy().traitPaddingAfter(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int traitSpaceStartOptimum() {
+ return traitGeneratedBy().traitSpaceStartOptimum(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int traitSpaceEndOptimum() {
+ return traitGeneratedBy().traitSpaceEndOptimum(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean traitUnderlineScore() {
+ return traitGeneratedBy().traitUnderlineScore(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean traitOverlineScore() {
+ return traitGeneratedBy().traitOverlineScore(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean traitThroughScore() {
+ return traitGeneratedBy().traitThroughScore(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Color traitUnderlineScoreColor() {
+ return traitGeneratedBy().traitUnderlineScoreColor(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Color traitOverlineScoreColor() {
+ return traitGeneratedBy().traitOverlineScoreColor(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Color traitThroughScoreColor() {
+ return traitGeneratedBy().traitThroughScoreColor(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int traitIPDimensionOpt() {
+ return traitGeneratedBy().traitIpDimensionOpt(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Color traitColor() {
+ return traitGeneratedBy().traitColor(this);
+ }
+
+}
Property changes on: trunk/foray/foray-areatree/src/java/org/foray/area/BidiOverrideArea.java
___________________________________________________________________
Name: svn:keywords
+ "Author Id Rev Date URL"
Name: svn:eol-style
+ native
Added: trunk/foray/foray-areatree/src/java/org/foray/area/IndexPageCitationListArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/IndexPageCitationListArea.java (rev 0)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/IndexPageCitationListArea.java 2007-07-27 22:54:08 UTC (rev 10122)
@@ -0,0 +1,381 @@
+/*
+ * Copyright 2004 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy: victormote $
+ */
+
+package org.foray.area;
+
+import org.axsl.area.AreaTreeException;
+import org.axsl.common.value.BackgroundRepeat;
+import org.axsl.common.value.BorderStyle;
+import org.axsl.fo.fo.GraftingPoint;
+import org.axsl.fo.fo.IndexPageCitationList;
+import org.axsl.fo.fo.Inline;
+import org.axsl.galley.RenderVisitor;
+import org.axsl.graphic.Graphic;
+
+import java.awt.Color;
+
+/**
+ * A normal inline-area generated by the fo:index-page-citation-list object.
+ */
+public final class IndexPageCitationListArea extends AbstractAncestralInlineArea
+ implements org.axsl.galley.InlineArea,
+ org.axsl.area.AncestralNormalInlineArea {
+
+ /** The parent of this node. The parent can be either a {@link LineArea}
+ * or another {@link AbstractInlineArea}. */
+ private Area parent;
+
+ /** The "generated-by" trait, as defined in Section 6.1.1. */
+ private FOLinkage generatedBy;
+
+ /**
+ * Private Constructor for a LineArea parent.
+ * @param parentArea The parent area.
+ */
+ private IndexPageCitationListArea(final LineArea parentArea) {
+ this.parent = parentArea;
+ }
+
+ /**
+ * Private Constructor for an AbstractInlineArea parent.
+ * @param parentArea The parent area.
+ */
+ private IndexPageCitationListArea(final AbstractInlineArea parentArea) {
+ this.parent = parentArea;
+ }
+
+ /**
+ * Package-visible factory method for a LineArea parent.
+ * @param generatedBy The FO node generating this area.
+ * @param parentArea The parent area.
+ * @param graftingPoint The ancestor retrieve-marker, if any, for this
+ * area.
+ * @return The new instance.
+ */
+ static IndexPageCitationListArea makeIndexPageCitationListArea(
+ final IndexPageCitationList generatedBy,
+ final LineArea parentArea, final GraftingPoint graftingPoint) {
+ final IndexPageCitationListArea newCitationListArea =
+ new IndexPageCitationListArea(parentArea);
+ newCitationListArea.generatedBy = newCitationListArea.linkage(
+ generatedBy, graftingPoint);
+ newCitationListArea.registerWithLinkage(graftingPoint);
+ final int initialPD = newCitationListArea.computeInitialPD();
+ newCitationListArea.setProgressionDimension(initialPD);
+ newCitationListArea.initializeAnteriorSpace();
+ return newCitationListArea;
+ }
+
+ /**
+ * Package-visible factory method for an AbstractInlineArea parent.
+ * @param generatedBy The FO node generating this area.
+ * @param parentArea The parent area.
+ * @param graftingPoint The ancestor retrieve-marker, if any, for this
+ * area.
+ * @return The new instance.
+ */
+ static IndexPageCitationListArea makeIndexPageCitationListArea(
+ final IndexPageCitationList generatedBy,
+ final AbstractInlineArea parentArea,
+ final GraftingPoint graftingPoint) {
+ final IndexPageCitationListArea newCitationListArea =
+ new IndexPageCitationListArea(parentArea);
+ newCitationListArea.generatedBy = newCitationListArea.linkage(
+ generatedBy, graftingPoint);
+ newCitationListArea.registerWithLinkage(graftingPoint);
+ final int initialPD = newCitationListArea.computeInitialPD();
+ newCitationListArea.setProgressionDimension(initialPD);
+ newCitationListArea.initializeAnteriorSpace();
+ return newCitationListArea;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getAreaName() {
+ return "index-page-citation-list";
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void render(final RenderVisitor visitor) {
+ visitor.render(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Graphic getGraphic() {
+ return this.traitBackgroundImage();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected boolean optimize() {
+ this.optimizeChildren();
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public FOLinkage getLinkage() {
+ return this.generatedBy;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Inline traitGeneratedBy() {
+ return (Inline) this.getLinkage().getFONode();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Area getParent() {
+ return this.parent;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setParent(final AreaNode node) throws AreaTreeException {
+ this.parent = this.validateNewParent(node);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Graphic traitBackgroundImage() {
+ return this.traitGeneratedBy().traitBackgroundImage(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Color traitBackgroundColor() {
+ return traitGeneratedBy().traitBackgroundColor(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public BackgroundRepeat traitBackgroundRepeat() {
+ return traitGeneratedBy().traitBackgroundRepeat(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Color traitBorderBeforeColor() {
+ return traitGeneratedBy().traitBorderBeforeColor(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Color traitBorderStartColor() {
+ return traitGeneratedBy().traitBorderStartColor(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Color traitBorderEndColor() {
+ return traitGeneratedBy().traitBorderEndColor(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Color traitBorderAfterColor() {
+ return traitGeneratedBy().traitBorderAfterColor(this);
+ }
+
+ /**
+ * Returns the border style for the "start" edge of this Area.
+ * @return The border style for the "start" edge of this Area.
+ */
+ public BorderStyle traitBorderStartStyle() {
+ return traitGeneratedBy().traitBorderStartStyle(this);
+ }
+
+ /**
+ * Returns the border style for the "end" edge of this Area.
+ * @return The border style for the "end" edge of this Area.
+ */
+ public BorderStyle traitBorderEndStyle() {
+ return traitGeneratedBy().traitBorderEndStyle(this);
+ }
+
+ /**
+ * Returns the border style for the "before" edge of this Area.
+ * @return The border style for the "before" edge of this Area.
+ */
+ public BorderStyle traitBorderBeforeStyle() {
+ return traitGeneratedBy().traitBorderBeforeStyle(this);
+ }
+
+ /**
+ * Returns the border style for the "after" edge of this Area.
+ * @return The border style for the "after" edge of this Area.
+ */
+ public BorderStyle traitBorderAfterStyle() {
+ return traitGeneratedBy().traitBorderAfterStyle(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int traitBorderStartWidth() {
+ return traitGeneratedBy().traitBorderStartWidth(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int traitBorderEndWidth() {
+ return traitGeneratedBy().traitBorderEndWidth(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int traitBorderBeforeWidth() {
+ return traitGeneratedBy().traitBorderBeforeWidth(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int traitBorderAfterWidth() {
+ return traitGeneratedBy().traitBorderAfterWidth(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int traitPaddingStart() {
+ return traitGeneratedBy().traitPaddingStart(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int traitPaddingEnd() {
+ return traitGeneratedBy().traitPaddingEnd(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int traitPaddingBefore() {
+ return traitGeneratedBy().traitPaddingBefore(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int traitPaddingAfter() {
+ return traitGeneratedBy().traitPaddingAfter(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int traitSpaceStartOptimum() {
+ return traitGeneratedBy().traitSpaceStartOptimum(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int traitSpaceEndOptimum() {
+ return traitGeneratedBy().traitSpaceEndOptimum(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean traitUnderlineScore() {
+ return traitGeneratedBy().traitUnderlineScore(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean traitOverlineScore() {
+ return traitGeneratedBy().traitOverlineScore(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean traitThroughScore() {
+ return traitGeneratedBy().traitThroughScore(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Color traitUnderlineScoreColor() {
+ return traitGeneratedBy().traitUnderlineScoreColor(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Color traitOverlineScoreColor() {
+ return traitGeneratedBy().traitOverlineScoreColor(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Color traitThroughScoreColor() {
+ return traitGeneratedBy().traitThroughScoreColor(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int traitIPDimensionOpt() {
+ return traitGeneratedBy().traitIpDimensionOpt(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Color traitColor() {
+ return traitGeneratedBy().traitColor(this);
+ }
+
+}
Property changes on: trunk/foray/foray-areatree/src/java/org/foray/area/IndexPageCitationListArea.java
___________________________________________________________________
Name: svn:keywords
+ "Author Id Rev Date URL"
Name: svn:eol-style
+ native
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/InlineArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/InlineArea.java 2007-07-27 20:58:47 UTC (rev 10121)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/InlineArea.java 2007-07-27 22:54:08 UTC (rev 10122)
@@ -31,26 +31,17 @@
import org.axsl.area.AreaTreeException;
import org.axsl.common.value.BackgroundRepeat;
import org.axsl.common.value.BorderStyle;
-import org.axsl.fo.fo.CharacterContent;
-import org.axsl.fo.fo.ExternalGraphic;
import org.axsl.fo.fo.GraftingPoint;
import org.axsl.fo.fo.Inline;
-import org.axsl.fo.fo.InlineContainer;
-import org.axsl.fo.fo.InstreamForeignObject;
-import org.axsl.fo.fo.Leader;
-import org.axsl.fo.fo.PageNumber;
-import org.axsl.fo.fo.PageNumberCitation;
import org.axsl.galley.RenderVisitor;
import org.axsl.graphic.Graphic;
import java.awt.Color;
-import java.util.ArrayList;
-import java.util.List;
/**
* Areas generated by the fo:inline object.
*/
-public final class InlineArea extends AbstractInlineArea
+public final class InlineArea extends AbstractAncestralInlineArea
implements org.axsl.galley.InlineArea,
org.axsl.area.AncestralNormalInlineArea {
@@ -61,10 +52,6 @@
/** The "generated-by" trait, as defined in Section 6.1.1. */
private FOLinkage generatedBy;
- /** The children of this node. */
- private List<AbstractInlineArea> children
- = new ArrayList<AbstractInlineArea>();
-
/**
* Private Constructor for a LineArea parent.
* @param parentArea The parent area.
@@ -132,114 +119,6 @@
/**
* {@inheritDoc}
*/
- public ForeignObjectArea makeForeignObjectArea(
- final InstreamForeignObject ifo, final int ipd,
- final GraftingPoint graftingPoint) {
- final ForeignObjectArea newForeignArea
- = ForeignObjectArea.makeForeignObjectArea(ifo, this,
- graftingPoint, ipd);
- this.children.add(newForeignArea);
- return newForeignArea;
- }
-
- /**
- * {@inheritDoc}
- */
- public ExternalGraphicArea makeExternalGraphicArea(
- final ExternalGraphic ifo, final int ipd,
- final GraftingPoint graftingPoint) {
- final ExternalGraphicArea newEgArea
- = ExternalGraphicArea.makeExternalGraphicArea(ifo, this,
- graftingPoint, ipd);
- this.children.add(newEgArea);
- return newEgArea;
- }
-
- /**
- * {@inheritDoc}
- */
- public LeaderArea makeLeaderArea(
- final Leader leader, final int ipd,
- final GraftingPoint graftingPoint) throws AreaTreeException {
- final LeaderArea newLeaderArea = LeaderArea.makeLeaderArea(leader, this,
- graftingPoint, ipd);
- this.children.add(newLeaderArea);
- return newLeaderArea;
- }
-
- /**
- * {@inheritDoc}
- */
- public InlineArea makeInlineArea(final Inline inline,
- final GraftingPoint graftingPoint) {
- final InlineArea newInlineArea = InlineArea.makeInlineArea(inline, this,
- graftingPoint);
- this.children.add(newInlineArea);
- return newInlineArea;
- }
-
- /**
- * {@inheritDoc}
- */
- public InlineContainerArea makeInlineContainerArea(
- final InlineContainer inlineContainer,
- final GraftingPoint graftingPoint) {
- final InlineContainerArea newInlineContainerArea =
- InlineContainerArea.makeInlineContainerArea(inlineContainer,
- this, graftingPoint);
- this.children.add(newInlineContainerArea);
- return newInlineContainerArea;
- }
-
- /**
- * {@inheritDoc}
- */
- public PageNumberArea makePageNumberArea(
- final PageNumber pageNumber, final int ipd,
- final GraftingPoint graftingPoint) {
- final PageNumberArea newPageNumberArea
- = PageNumberArea.makePageNumberArea(pageNumber, this,
- graftingPoint, ipd);
- this.children.add(newPageNumberArea);
- return newPageNumberArea;
- }
-
- /**
- * {@inheritDoc}
- */
- public PageNumberCitationArea makePageNumberCitationArea(
- final PageNumberCitation citation, final int ipd,
- final GraftingPoint graftingPoint) {
- final PageNumberCitationArea newCitationArea =
- PageNumberCitationArea.makePageNumberCitationArea(citation,
- this, graftingPoint, ipd);
- this.children.add(newCitationArea);
- return newCitationArea;
- }
-
- /**
- * {@inheritDoc}
- */
- public TextArea makeTextArea(final CharacterContent foText,
- final int ipd, final int startOffset, final int sizeInChars,
- final boolean hasDiscretionaryHyphen,
- final boolean hasFauxSmallCaps, final boolean isLastItemOnLine,
- final GraftingPoint graftingPoint) {
- if (LineArea.shouldCreateTextArea(foText, this, startOffset,
- sizeInChars, isLastItemOnLine, this)) {
- final TextArea newTextArea = TextArea.makeTextArea(foText, this,
- graftingPoint, startOffset, sizeInChars, ipd,
- hasDiscretionaryHyphen, hasFauxSmallCaps);
- this.children.add(newTextArea);
- return newTextArea;
- }
- return null;
- }
-
-
- /**
- * {@inheritDoc}
- */
public void render(final RenderVisitor visitor) {
visitor.render(this);
}
@@ -254,13 +133,6 @@
/**
* {@inheritDoc}
*/
- public List<AbstractInlineArea> getChildren() {
- return this.children;
- }
-
- /**
- * {@inheritDoc}
- */
protected boolean optimize() {
this.optimizeChildren();
return false;
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java 2007-07-27 20:58:47 UTC (rev 10121)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java 2007-07-27 22:54:08 UTC (rev 10122)
@@ -32,15 +32,8 @@
import org.axsl.common.value.LeaderAlignment;
import org.axsl.common.value.LeaderPattern;
import org.axsl.common.value.RuleStyle;
-import org.axsl.fo.fo.CharacterContent;
-import org.axsl.fo.fo.ExternalGraphic;
import org.axsl.fo.fo.GraftingPoint;
-import org.axsl.fo.fo.Inline;
-import org.axsl.fo.fo.InlineContainer;
-import org.axsl.fo.fo.InstreamForeignObject;
import org.axsl.fo.fo.Leader;
-import org.axsl.fo.fo.PageNumber;
-import org.axsl.fo.fo.PageNumberCitation;
import org.axsl.fo.fo.prop.LeaderAlignmentPa;
import org.axsl.fo.fo.prop.LeaderPatternPa;
import org.axsl.fo.fo.prop.LeaderPatternWidthPa;
@@ -49,8 +42,6 @@
import org.axsl.galley.RenderVisitor;
import java.awt.Color;
-import java.util.ArrayList;
-import java.util.List;
/**
* An Area containing a leader item.
@@ -75,7 +66,7 @@
* {@link #dotLeaderText()} for dot leaders.</li>
* </ul>
*/
-public final class LeaderArea extends AbstractInlineArea
+public final class LeaderArea extends AbstractAncestralInlineArea
implements org.axsl.galley.LeaderArea,
org.axsl.area.AncestralNormalInlineArea {
@@ -86,10 +77,6 @@
/** The "generated-by" trait, as defined in Section 6.1.1. */
private FOLinkage generatedBy;
- /** The children of this node. */
- private List<AbstractInlineArea> children
- = new ArrayList<AbstractInlineArea>();
-
/**
* Private Constructor.
* @param parentArea The parent area.
@@ -426,113 +413,6 @@
/**
* {@inheritDoc}
*/
- public ForeignObjectArea makeForeignObjectArea(
- final InstreamForeignObject ifo, final int ipd,
- final GraftingPoint graftingPoint) {
- final ForeignObjectArea newForeignArea
- = ForeignObjectArea.makeForeignObjectArea(ifo, this,
- graftingPoint, ipd);
- this.children.add(newForeignArea);
- return newForeignArea;
- }
-
- /**
- * {@inheritDoc}
- */
- public ExternalGraphicArea makeExternalGraphicArea(
- final ExternalGraphic ifo, final int ipd,
- final GraftingPoint graftingPoint) {
- final ExternalGraphicArea newEgArea
- = ExternalGraphicArea.makeExternalGraphicArea(ifo, this,
- graftingPoint, ipd);
- this.children.add(newEgArea);
- return newEgArea;
- }
-
- /**
- * {@inheritDoc}
- */
- public LeaderArea makeLeaderArea(
- final Leader leader, final int ipd,
- final GraftingPoint graftingPoint) throws AreaTreeException {
- final LeaderArea newLeaderArea = LeaderArea.makeLeaderArea(leader, this,
- graftingPoint, ipd);
- this.children.add(newLeaderArea);
- return newLeaderArea;
- }
-
- /**
- * {@inheritDoc}
- */
- public InlineArea makeInlineArea(final Inline inline,
- final GraftingPoint graftingPoint) {
- final InlineArea newInlineArea = InlineArea.makeInlineArea(inline, this,
- graftingPoint);
- this.children.add(newInlineArea);
- return newInlineArea;
- }
-
- /**
- * {@inheritDoc}
- */
- public InlineContainerArea makeInlineContainerArea(
- final InlineContainer inlineContainer,
- final GraftingPoint graftingPoint) {
- final InlineContainerArea newInlineContainerArea =
- InlineContainerArea.makeInlineContainerArea(inlineContainer,
- this, graftingPoint);
- this.children.add(newInlineContainerArea);
- return newInlineContainerArea;
- }
-
- /**
- * {@inheritDoc}
- */
- public PageNumberArea makePageNumberArea(
- final PageNumber pageNumber, final int ipd,
- final GraftingPoint graftingPoint) {
- final PageNumberArea newPageNumberArea
- = PageNumberArea.makePageNumberArea(pageNumber, this,
- graftingPoint, ipd);
- this.children.add(newPageNumberArea);
- return newPageNumberArea;
- }
-
- /**
- * {@inheritDoc}
- */
- public PageNumberCitationArea makePageNumberCitationArea(
- final PageNumberCitation citation, final int ipd,
- final GraftingPoint graftingPoint) {
- final PageNumberCitationArea newCitationArea =
- PageNumberCitationArea.makePageNumberCitationArea(citation,
- this, graftingPoint, ipd);
- this.children.add(newCitationArea);
- return newCitationArea;
- }
-
- /**
- * {@inheritDoc}
- */
- public TextArea makeTextArea(final CharacterContent foText,
- final int ipd, final int startOffset, final int sizeInChars,
- final boolean hasDiscretionaryHyphen,
- final boolean hasFauxSmallCaps, final boolean isLastItemOnLine,
- final GraftingPoint graftingPoint) {
- if (LineArea.shouldCreateTextArea(foText, this, startOffset,
- sizeInChars, isLastItemOnLine, this)) {
- final TextArea newTextArea = TextArea.makeTextArea(foText, this,
- graftingPoint, startOffset, sizeInChars, ipd,
- hasDiscretionaryHyphen, hasFauxSmallCaps);
- this.children.add(newTextArea);
- return newTextArea;
- }
- return null;
- }
-
- /**
- * {@inheritDoc}
- */
public void render(final RenderVisitor visitor) {
visitor.render(this);
}
@@ -540,13 +420,6 @@
/**
* {@inheritDoc}
*/
- public List<AbstractInlineArea> getChildren() {
- return this.children;
- }
-
- /**
- * {@inheritDoc}
- */
protected boolean optimize() {
this.optimizeChildren();
return false;
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2007-07-27 20:58:47 UTC (rev 10121)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2007-07-27 22:54:08 UTC (rev 10122)
@@ -41,16 +41,21 @@
import org.axsl.common.value.TextAlignLast;
import org.axsl.common.value.WhiteSpaceTreatment;
import org.axsl.fo.FoContext;
+import org.axsl.fo.fo.BasicLink;
+import org.axsl.fo.fo.BidiOverride;
import org.axsl.fo.fo.Block;
import org.axsl.fo.fo.CharacterContent;
import org.axsl.fo.fo.ExternalGraphic;
import org.axsl.fo.fo.GraftingPoint;
+import org.axsl.fo.fo.IndexPageCitationList;
import org.axsl.fo.fo.Inline;
import org.axsl.fo.fo.InlineContainer;
import org.axsl.fo.fo.InstreamForeignObject;
import org.axsl.fo.fo.Leader;
import org.axsl.fo.fo.PageNumber;
import org.axsl.fo.fo.PageNumberCitation;
+import org.axsl.fo.fo.PageNumberCitationLast;
+import org.axsl.fo.fo.ScalingValueCitation;
import org.axsl.font.Font;
import org.axsl.font.FontUse;
import org.axsl.galley.RenderVisitor;
@@ -987,6 +992,19 @@
/**
* {@inheritDoc}
*/
+ public BidiOverrideArea makeBidiOverrideArea(
+ final BidiOverride bidiOverride,
+ final GraftingPoint graftingPoint) {
+ final BidiOverrideArea newBidiArea =
+ BidiOverrideArea.makeBidiOverrideArea(bidiOverride, this,
+ graftingPoint);
+ this.children.add(newBidiArea);
+ return newBidiArea;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
public ForeignObjectArea makeForeignObjectArea(
final InstreamForeignObject ifo, final int ipd,
final GraftingPoint graftingPoint) {
@@ -1074,6 +1092,32 @@
/**
* {@inheritDoc}
*/
+ public PageNumberCitationLastArea makePageNumberCitationLastArea(
+ final PageNumberCitationLast citation, final int ipd,
+ final GraftingPoint graftingPoint) {
+ final PageNumberCitationLastArea newCitationArea =
+ PageNumberCitationLastArea.makePageNumberCitationLastArea(
+ citation, this, graftingPoint, ipd);
+ this.children.add(newCitationArea);
+ return newCitationArea;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public ScalingValueCitationArea makeScalingValueCitationArea(
+ final ScalingValueCitation citation, final int ipd,
+ final GraftingPoint graftingPoint) {
+ final ScalingValueCitationArea newCitationArea =
+ ScalingValueCitationArea.makeScalingValueCitationArea(
+ citation, this, graftingPoint, ipd);
+ this.children.add(newCitationArea);
+ return newCitationArea;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
public TextArea makeTextArea(final CharacterContent foText,
final int ipd, final int startOffset, final int sizeInChars,
final boolean hasDiscretionaryHyphen,
@@ -1091,6 +1135,30 @@
}
/**
+ * {@inheritDoc}
+ */
+ public BasicLinkArea makeBasicLinkArea(final BasicLink basicLink,
+ final GraftingPoint graftingPoint) {
+ final BasicLinkArea newLinkArea = BasicLinkArea.makeBasicLinkArea(
+ basicLink, this, graftingPoint);
+ this.children.add(newLinkArea);
+ return newLinkArea;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public IndexPageCitationListArea makeIndexPageCitationListArea(
+ final IndexPageCitationList indexPcl,
+ final GraftingPoint graftingPoint) {
+ final IndexPageCitationListArea newIpclArea =
+ IndexPageCitationListArea.makeIndexPageCitationListArea(
+ indexPcl, this, graftingPoint);
+ this.children.add(newIpclArea);
+ return newIpclArea;
+ }
+
+ /**
* Indicates whether this line-area has a half-leading on both its before
* and after edges.
* @return True iff this line-area has space on either side of it.
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberArea.java 2007-07-27 20:58:47 UTC (rev 10121)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberArea.java 2007-07-27 22:54:08 UTC (rev 10122)
@@ -37,15 +37,13 @@
import org.axsl.galley.RenderVisitor;
import java.awt.Color;
-import java.util.Collections;
-import java.util.List;
/**
* The normal inline-area created by an fo:page-number object.
*/
-public final class PageNumberArea extends AbstractInlineArea
+public final class PageNumberArea extends AbstractAncestralInlineArea
implements org.axsl.galley.TextArea,
- org.axsl.area.NormalInlineArea {
+ org.axsl.area.AncestralNormalInlineArea {
/** The parent of this node. The parent can be either a {@link LineArea}
* or another {@link AbstractInlineArea}. */
@@ -150,13 +148,6 @@
/**
* {@inheritDoc}
*/
- public List<AreaNode> getChildren() {
- return Collections.emptyList();
- }
-
- /**
- * {@inheritDoc}
- */
protected boolean optimize() {
this.optimizeChildren();
return false;
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberCitationArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberCitationArea.java 2007-07-27 20:58:47 UTC (rev 10121)
+++ trunk/fo...
[truncated message content] |
|
From: <vic...@us...> - 2007-07-27 20:58:49
|
Revision: 10121
http://foray.svn.sourceforge.net/foray/?rev=10121&view=rev
Author: victormote
Date: 2007-07-27 13:58:47 -0700 (Fri, 27 Jul 2007)
Log Message:
-----------
Conform to axsl changes moving getters for high-level servers and factories from AreaNode to AreaTree and Galley.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java
trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FONodePL.java
trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java
trunk/foray/foray-render/src/java/org/foray/render/ps/PSRenderer.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java 2007-07-27 19:35:18 UTC (rev 10120)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java 2007-07-27 20:58:47 UTC (rev 10121)
@@ -37,8 +37,7 @@
import org.axsl.fo.fo.GraftingPoint;
import org.axsl.fo.fo.Table;
import org.axsl.fo.fo.prop.ColorPa;
-import org.axsl.font.FontConsumer;
-import org.axsl.text.TextServer;
+import org.axsl.galley.Galley;
import org.apache.commons.logging.Log;
@@ -250,6 +249,14 @@
}
/**
+ * Returns the ancestor Galley for this area.
+ * @return The ancestor Galley for this area.
+ */
+ public Galley getGalley() {
+ return getParent().getGalley();
+ }
+
+ /**
* {@inheritDoc}
*/
public Area ancestorArea() {
@@ -380,20 +387,6 @@
}
/**
- * {@inheritDoc}
- */
- public FontConsumer getFontConsumer() {
- return getParent().getFontConsumer();
- }
-
- /**
- * {@inheritDoc}
- */
- public TextServer getTextServer() {
- return getParent().getTextServer();
- }
-
- /**
* Return the logger.
* @return The logger.
*/
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java 2007-07-27 19:35:18 UTC (rev 10120)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java 2007-07-27 20:58:47 UTC (rev 10121)
@@ -39,6 +39,7 @@
import org.axsl.fo.fo.PageSequence;
import org.axsl.fo.fo.Root;
import org.axsl.font.FontConsumer;
+import org.axsl.galley.Galley;
import org.axsl.galley.RenderVisitor;
import org.axsl.text.TextServer;
@@ -230,13 +231,21 @@
/**
* {@inheritDoc}
- * Overrides the method in Area, because this is the object being sought.
+ * Overrides the superclass method, because this is the object being sought.
*/
public AreaTree getAreaTree() {
return this;
}
/**
+ * {@inheritDoc}
+ * Overrides the superclass method, because this is the object being sought.
+ */
+ public Galley getGalley() {
+ return this;
+ }
+
+ /**
* Retrieves the FObj instance that is associated with id.
* @param id The id whose FObj instance is sought.
* @return The FObj instance that is associated with id.
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FONodePL.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FONodePL.java 2007-07-27 19:35:18 UTC (rev 10120)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FONodePL.java 2007-07-27 20:58:47 UTC (rev 10121)
@@ -29,6 +29,7 @@
package org.foray.pioneer;
import org.axsl.area.AreaNode;
+import org.axsl.area.AreaTree;
import org.axsl.area.AreaTreeException;
import org.axsl.area.LineArea;
import org.axsl.area.NormalBlockArea;
@@ -40,7 +41,9 @@
import org.axsl.fo.FoLineText;
import org.axsl.fo.fo.GraftingPoint;
import org.axsl.fo.fo.TableCell;
+import org.axsl.font.FontConsumer;
import org.axsl.text.TextException;
+import org.axsl.text.TextServer;
import org.axsl.text.line.EagerLineBreaker;
import org.apache.commons.logging.Log;
@@ -220,8 +223,11 @@
}
EagerLineBreaker lb = this.layout.getLineBreaker();
if (lb == null) {
- lb = lineArea.getTextServer().provideEagerLineBreaker(null,
- this.layout, lineArea.getFontConsumer());
+ final AreaTree areaTree = lineArea.getAreaTree();
+ final TextServer textServer = areaTree.getTextServer();
+ final FontConsumer fontConsumer = areaTree.getFontConsumer();
+ lb = textServer.provideEagerLineBreaker(null, this.layout,
+ fontConsumer);
}
int status = 0;
final FoLineText contextAware = lineText.getContextWrapper(
@@ -255,8 +261,11 @@
throws AreaTreeException {
EagerLineBreaker lb = this.layout.getLineBreaker();
if (lb == null) {
- lb = lineArea.getTextServer().provideEagerLineBreaker(null,
- this.layout, lineArea.getFontConsumer());
+ final AreaTree areaTree = lineArea.getAreaTree();
+ final TextServer textServer = areaTree.getTextServer();
+ final FontConsumer fontConsumer = areaTree.getFontConsumer();
+ lb = textServer.provideEagerLineBreaker(null,
+ this.layout, fontConsumer);
}
int status = 0;
final FoLineNonText contextAware = nonText.getContextWrapper(
Modified: trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2007-07-27 19:35:18 UTC (rev 10120)
+++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2007-07-27 20:58:47 UTC (rev 10121)
@@ -259,7 +259,7 @@
final Rectangle2D.Float pdfClipRectangle = convertMillipointRectangle(
clipRectangle);
getContentStream().drawGraphic(image, pdfContentRectangle,
- pdfClipRectangle, area.getFontConsumer(), getStrokeSVGText());
+ pdfClipRectangle, this.getFontConsumer(), getStrokeSVGText());
}
/**
Modified: trunk/foray/foray-render/src/java/org/foray/render/ps/PSRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/ps/PSRenderer.java 2007-07-27 19:35:18 UTC (rev 10120)
+++ trunk/foray/foray-render/src/java/org/foray/render/ps/PSRenderer.java 2007-07-27 20:58:47 UTC (rev 10121)
@@ -552,7 +552,7 @@
+ " translate");
this.write(sx * at.getScaleX() + " " + sy * at.getScaleY()
+ " scale");
- svgGraphic.drawPs(this.getOutputStream(), area.getFontConsumer(), false,
+ svgGraphic.drawPs(this.getOutputStream(), this.getFontConsumer(), false,
this.enableComments);
this.write("grestore");
this.comment("% --- SVG Area end");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-27 19:35:15
|
Revision: 10120
http://foray.svn.sourceforge.net/foray/?rev=10120&view=rev
Author: victormote
Date: 2007-07-27 12:35:18 -0700 (Fri, 27 Jul 2007)
Log Message:
-----------
Conform to axsl changes replacing some AreaTree interfaces with more generic interfaces.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/ExternalGraphicArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/ForeignObjectArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/InlineArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberCitationArea.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/InlinePL.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/ExternalGraphicArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/ExternalGraphicArea.java 2007-07-27 16:22:56 UTC (rev 10119)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/ExternalGraphicArea.java 2007-07-27 19:35:18 UTC (rev 10120)
@@ -43,7 +43,7 @@
*/
public final class ExternalGraphicArea extends AbstractInlineArea
implements org.axsl.galley.ExternalGraphicArea,
- org.axsl.area.ExternalGraphicArea {
+ org.axsl.area.NormalInlineArea {
/** The parent of this node. The parent can be either a {@link LineArea}
* or another {@link AbstractInlineArea}. */
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/ForeignObjectArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/ForeignObjectArea.java 2007-07-27 16:22:56 UTC (rev 10119)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/ForeignObjectArea.java 2007-07-27 19:35:18 UTC (rev 10120)
@@ -45,7 +45,7 @@
*/
public final class ForeignObjectArea extends AbstractInlineArea
implements org.axsl.galley.ForeignObjectArea,
- org.axsl.area.ForeignObjectArea {
+ org.axsl.area.NormalInlineArea {
/** The parent of this node. The parent can be either a {@link LineArea}
* or another {@link AbstractInlineArea}. */
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/InlineArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/InlineArea.java 2007-07-27 16:22:56 UTC (rev 10119)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/InlineArea.java 2007-07-27 19:35:18 UTC (rev 10120)
@@ -52,7 +52,7 @@
*/
public final class InlineArea extends AbstractInlineArea
implements org.axsl.galley.InlineArea,
- org.axsl.area.InlineArea {
+ org.axsl.area.AncestralNormalInlineArea {
/** The parent of this node. The parent can be either a {@link LineArea}
* or another {@link AbstractInlineArea}. */
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java 2007-07-27 16:22:56 UTC (rev 10119)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java 2007-07-27 19:35:18 UTC (rev 10120)
@@ -77,7 +77,7 @@
*/
public final class LeaderArea extends AbstractInlineArea
implements org.axsl.galley.LeaderArea,
- org.axsl.area.LeaderArea {
+ org.axsl.area.AncestralNormalInlineArea {
/** The parent of this node. The parent can be either a {@link LineArea}
* or another {@link AbstractInlineArea}. */
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberArea.java 2007-07-27 16:22:56 UTC (rev 10119)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberArea.java 2007-07-27 19:35:18 UTC (rev 10120)
@@ -45,7 +45,7 @@
*/
public final class PageNumberArea extends AbstractInlineArea
implements org.axsl.galley.TextArea,
- org.axsl.area.PageNumberArea {
+ org.axsl.area.NormalInlineArea {
/** The parent of this node. The parent can be either a {@link LineArea}
* or another {@link AbstractInlineArea}. */
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberCitationArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberCitationArea.java 2007-07-27 16:22:56 UTC (rev 10119)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberCitationArea.java 2007-07-27 19:35:18 UTC (rev 10120)
@@ -45,7 +45,7 @@
*/
public final class PageNumberCitationArea extends AbstractInlineArea
implements org.axsl.galley.TextArea,
- org.axsl.area.PageNumberCitationArea {
+ org.axsl.area.NormalInlineArea {
/** The parent of this node. The parent can be either a {@link LineArea}
* or another {@link AbstractInlineArea}. */
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/InlinePL.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/InlinePL.java 2007-07-27 16:22:56 UTC (rev 10119)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/InlinePL.java 2007-07-27 19:35:18 UTC (rev 10120)
@@ -28,10 +28,10 @@
package org.foray.pioneer;
+import org.axsl.area.AncestralNormalInlineArea;
import org.axsl.area.AreaNode;
import org.axsl.area.AreaTreeException;
import org.axsl.area.BlockContentFactory;
-import org.axsl.area.InlineArea;
import org.axsl.area.LineArea;
import org.axsl.area.LineContentFactory;
import org.axsl.area.NormalBlockArea;
@@ -97,7 +97,7 @@
/* Not enough room on the page for this. */
return Status.AREA_FULL_NONE;
}
- final InlineArea inlineArea =
+ final AncestralNormalInlineArea inlineArea =
lineContentFactory.makeInlineArea(this.realFONode,
graftingPoint);
this.getLayout().pushInlineStack(inlineArea);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-27 16:22:58
|
Revision: 10119
http://foray.svn.sourceforge.net/foray/?rev=10119&view=rev
Author: victormote
Date: 2007-07-27 09:22:56 -0700 (Fri, 27 Jul 2007)
Log Message:
-----------
Rework layout logic for "inline" so that it handles block content correctly.
Modified Paths:
--------------
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/InlinePL.java
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/InlinePL.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/InlinePL.java 2007-07-27 16:20:46 UTC (rev 10118)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/InlinePL.java 2007-07-27 16:22:56 UTC (rev 10119)
@@ -29,11 +29,13 @@
package org.foray.pioneer;
import org.axsl.area.AreaNode;
+import org.axsl.area.AreaTreeException;
+import org.axsl.area.BlockContentFactory;
import org.axsl.area.InlineArea;
import org.axsl.area.LineArea;
import org.axsl.area.LineContentFactory;
import org.axsl.area.NormalBlockArea;
-import org.axsl.area.AreaTreeException;
+import org.axsl.fo.Fo;
import org.axsl.fo.fo.GraftingPoint;
import org.axsl.fo.fo.Inline;
@@ -67,12 +69,66 @@
*/
public Status layout(final AreaNode areaNode,
final GraftingPoint graftingPoint) throws AreaTreeException {
+ final Inline foNode = getFONode();
+ if (getProgress() == FONodePL.START) {
+ setProgress(0);
+ }
+
+ Status status = Status.OK;
+ LineContentFactory lineContentFactory = null;
+ for (int i = getProgress(); i < foNode.getChildCount(); i++) {
+ final Fo fo = foNode.getChildAt(i);
+ final FONodePL layoutProxy = getLayoutProxy(fo);
+ if (fo.isBlockLevelFo()) {
+ /* Remove the inline factory so that we know that we need to
+ * create a new one if there is any subsequent inline
+ * content.*/
+ lineContentFactory = null;
+ /* Since this is block content, it cannot be laid out in a
+ * line. We need to find the ancestor BlockContentFactory
+ * and lay out the item in it. */
+ final BlockContentFactory blockContentFactory =
+ areaNode.ancestorBlockContentFactory();
+ status = layoutProxy.layout(blockContentFactory, graftingPoint);
+ } else {
+ if (lineContentFactory == null) {
+ lineContentFactory = getLineContentFactory(areaNode);
+ if (lineContentFactory == null) {
+ /* Not enough room on the page for this. */
+ return Status.AREA_FULL_NONE;
+ }
+ final InlineArea inlineArea =
+ lineContentFactory.makeInlineArea(this.realFONode,
+ graftingPoint);
+ this.getLayout().pushInlineStack(inlineArea);
+ status = layoutProxy.layout(areaNode, graftingPoint);
+ this.getLayout().popInlineStack();
+ }
+ }
+ if (status.isIncomplete()) {
+ setProgress(i);
+ return status;
+ }
+ }
+ return status;
+ }
+
+ /**
+ * Returns either a line area or an inline area that is capable of
+ * containing the inline content.
+ * @param areaNode The parent AreaTree node.
+ * @return The area into which the line content should be placed, or null
+ * if there is no room on the page for a line to contain it.
+ * @throws AreaTreeException If <code>areaNode cannot contain line
+ * content.</code>
+ */
+ private LineContentFactory getLineContentFactory(final AreaNode areaNode)
+ throws AreaTreeException {
LineContentFactory factory = null;
if (areaNode instanceof NormalBlockArea) {
final LineArea lineArea = activeLineArea(areaNode.nearestArea());
if (lineArea == null) {
- // Not enough room on the page for this.
- return Status.AREA_FULL_NONE;
+ return null;
} else {
factory = lineArea;
}
@@ -82,15 +138,7 @@
throw new AreaTreeException("AreaNode " + areaNode.getAreaName()
+ " cannot create an InlineArea.");
}
- final InlineArea inlineArea = factory.makeInlineArea(this.realFONode,
- graftingPoint);
- this.getLayout().pushInlineStack(inlineArea);
- final Status status = this.standardLayout(inlineArea, graftingPoint);
- /* Regardless of the layout status, we can safely pop the stack here, as
- * a new Area will be added to it above if we come through here again
- * for a different line. */
- this.getLayout().popInlineStack();
- return status;
+ return factory;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-27 16:20:43
|
Revision: 10118
http://foray.svn.sourceforge.net/foray/?rev=10118&view=rev
Author: victormote
Date: 2007-07-27 09:20:46 -0700 (Fri, 27 Jul 2007)
Log Message:
-----------
Conform to axsl change requiring new method.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java 2007-07-27 16:12:55 UTC (rev 10117)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java 2007-07-27 16:20:46 UTC (rev 10118)
@@ -32,6 +32,7 @@
import org.foray.common.OrderedTreeNode;
import org.axsl.area.AreaTreeException;
+import org.axsl.area.BlockContentFactory;
import org.axsl.fo.Fo;
import org.axsl.fo.fo.GraftingPoint;
import org.axsl.fo.fo.Table;
@@ -542,6 +543,20 @@
}
/**
+ * {@inheritDoc}
+ */
+ public BlockContentFactory ancestorBlockContentFactory() {
+ final AreaNode parent = getParent();
+ if (parent == null) {
+ return null;
+ }
+ if (parent instanceof BlockContentFactory) {
+ return (BlockContentFactory) parent;
+ }
+ return parent.ancestorBlockContentFactory();
+ }
+
+ /**
* Returns the ancestor page collection for this area.
* @return The ancestor page collection.
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-27 16:12:53
|
Revision: 10117
http://foray.svn.sourceforge.net/foray/?rev=10117&view=rev
Author: victormote
Date: 2007-07-27 09:12:55 -0700 (Fri, 27 Jul 2007)
Log Message:
-----------
Retrieve "none" value for text-decoration properly.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/TextDecoration.java
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/TextDecoration.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/TextDecoration.java 2007-07-26 22:06:26 UTC (rev 10116)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/TextDecoration.java 2007-07-27 16:12:55 UTC (rev 10117)
@@ -216,6 +216,10 @@
}
return fobjParent.getPropertyList().getTextDecoration(
fobjParent, context);
+ } else if (foValue == FoValue.NONE) {
+ /* TODO: Make a variant of DtTextDeco that is immutable so that
+ * we don't have to create a new instance here every time. */
+ return TextDecoration.getTextDecoDT(null);
}
}
if (value() instanceof DtTextDeco) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-26 22:06:23
|
Revision: 10116
http://foray.svn.sourceforge.net/foray/?rev=10116&view=rev
Author: victormote
Date: 2007-07-26 15:06:26 -0700 (Thu, 26 Jul 2007)
Log Message:
-----------
Some minor content model validation improvements.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/InstreamForeignObject.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/MultiPropertySet.java
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/InstreamForeignObject.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/InstreamForeignObject.java 2007-07-26 21:32:41 UTC (rev 10115)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/InstreamForeignObject.java 2007-07-26 22:06:26 UTC (rev 10116)
@@ -53,7 +53,7 @@
private FObj parent;
/** The children of this object. */
- private List<FObj> children = new ArrayList<FObj>();
+ private List<ForeignXML> children = new ArrayList<ForeignXML>(1);
/**
* Constructor.
@@ -98,16 +98,11 @@
* {@inheritDoc}
*/
protected void validateDescendants() throws FoTreeException {
- /*
- * XSL-FO Standard 1.1, Section 6.6.6, Heading "Contents" seems to
- * indicate that only one child is allowed.
- */
+ /* XSL-FO Standard 1.1, Section 6.6.6, Heading "Contents" seems to
+ * indicate that only one child is allowed. */
if (getChildren().size() != 1) {
throwException(getFullName() + " must have exactly one child.");
}
- if (! (getChildren().get(0) instanceof ForeignXML)) {
- throwException(getFullName() + " child must be foreign xml.");
- }
}
/**
@@ -135,8 +130,8 @@
* {@inheritDoc}
*/
public org.axsl.fo.FoForeignXml getForeignXml() {
- // Cast verified in end().
- return (ForeignXML) getChildren().get(0);
+ /* Existence is verified in validateDescendants(). */
+ return getChildren().get(0);
}
/**
@@ -244,7 +239,7 @@
/**
* {@inheritDoc}
*/
- public List<FObj> getChildren() {
+ public List<ForeignXML> getChildren() {
return this.children;
}
@@ -252,7 +247,12 @@
* {@inheritDoc}
*/
public void addChild(final FObj child) throws FoTreeException {
- this.getChildren().add(child);
+ if (! (child instanceof ForeignXML)) {
+ child.throwException(getFullName() + " child must be a supported "
+ + "type of foreign xml.");
+ }
+ final ForeignXML foreignXmlChild = (ForeignXML) child;
+ this.getChildren().add(foreignXmlChild);
}
/**
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/MultiPropertySet.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/MultiPropertySet.java 2007-07-26 21:32:41 UTC (rev 10115)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/MultiPropertySet.java 2007-07-26 22:06:26 UTC (rev 10116)
@@ -36,7 +36,6 @@
import org.axsl.fo.FoTreeException;
import org.axsl.fo.ProxyFactory;
-import java.util.ArrayList;
import java.util.List;
/**
@@ -48,9 +47,6 @@
/** The parent of this node. */
private FObj parent;
- /** The children of this object. */
- private List<FObj> children = new ArrayList<FObj>();
-
/** The property list for this object. */
private PropertyList propertyList;
@@ -98,7 +94,7 @@
* {@inheritDoc}
*/
protected void validateDescendants() throws FoTreeException {
- return;
+ this.validateEmptyContent();
}
/**
@@ -133,14 +129,14 @@
* {@inheritDoc}
*/
public List<FObj> getChildren() {
- return this.children;
+ return EMPTY_CHILD_LIST;
}
/**
* {@inheritDoc}
*/
public void addChild(final FObj child) throws FoTreeException {
- this.getChildren().add(child);
+ this.addChildToEmptyContentModel(child);
}
/**
@@ -182,7 +178,7 @@
* {@inheritDoc}
*/
public FObj getChildAt(final int index) {
- return this.children.get(index);
+ return null;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-26 21:32:39
|
Revision: 10115
http://foray.svn.sourceforge.net/foray/?rev=10115&view=rev
Author: victormote
Date: 2007-07-26 14:32:41 -0700 (Thu, 26 Jul 2007)
Log Message:
-----------
1. Let subclasses handle the getChildAt logic.
2. Clean up some objects that have empty content models.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/ForeignXML.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/axsl/obj/Metadata.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/AbstractFlow.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/AbstractFolioDescriptor.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/AbstractIndexFormatting.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/AbstractPageMaster.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/AbstractPageReference.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/AbstractTablePart.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/BasicLink.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/BidiOverride.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Block.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/BlockContainer.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Bookmark.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/BookmarkTree.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ChangeBarBegin.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ChangeBarEnd.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Character.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/CharacterSequence4a.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ColorProfile.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ConditionalPageMasterReference.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Declarations.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ExternalGraphic.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Float.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/FlowAssignment.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/FlowMap.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/FlowNameSpecifier.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/FlowSourceList.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/FlowTargetList.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Footnote.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/FootnoteBody.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/IndexKeyReference.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/IndexPageCitationList.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/IndexRangeBegin.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/IndexRangeEnd.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/InitialPropertySet.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Inline.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/InlineContainer.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/InstreamForeignObject.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/LayoutMasterSet.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Leader.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ListBlock.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ListItem.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ListItemBody.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ListItemLabel.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Marker.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/MultiCase.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/MultiProperties.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/MultiPropertySet.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/MultiSwitch.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/MultiToggle.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageMasterResolver.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageNumber.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageNumberCitation.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageNumberCitationLast.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageSequence.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageSequenceMaster.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageSequenceWrapper.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Region.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RegionNameSpecifier.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RepeatablePMAlternatives.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RepeatablePMReference.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RetrieveMarker.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RetrieveTableMarker.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Root.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ScalingValueCitation.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/SinglePageMasterReference.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Table.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/TableAndCaption.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/TableCaption.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/TableCell.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/TableColumn.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/TableRow.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Title.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Wrapper.java
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -535,19 +535,6 @@
/**
* {@inheritDoc}
*/
- public FObj getChildAt(final int childIndex) {
- if (childIndex < 0) {
- return null;
- }
- if (childIndex >= getChildren().size()) {
- return null;
- }
- return getChildren().get(childIndex);
- }
-
- /**
- * {@inheritDoc}
- */
public String getContextMessage() {
return getContextMessage(this.getSystemId(), this.getLine(),
this.getColumn());
@@ -620,6 +607,18 @@
}
/**
+ * Throws a standard exception when an attempt is made to add content to
+ * an object that has an empty content model.
+ * @param child The child object which was attempting to be added to this.
+ * @throws FoTreeException Always, as that is the purpose of this method.
+ */
+ public void addChildToEmptyContentModel(final FObj child)
+ throws FoTreeException {
+ child.throwException("Content model of " + this.getName()
+ + " is EMPTY.");
+ }
+
+ /**
* {@inheritDoc}
*/
public int getSequentialIndex() {
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/ForeignXML.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/ForeignXML.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/ForeignXML.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -271,4 +271,11 @@
return this.propertyList;
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return null;
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/axsl/obj/Metadata.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/axsl/obj/Metadata.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/axsl/obj/Metadata.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -273,4 +273,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/AbstractFlow.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/AbstractFlow.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/AbstractFlow.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -130,4 +130,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/AbstractFolioDescriptor.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/AbstractFolioDescriptor.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/AbstractFolioDescriptor.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -158,4 +158,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/AbstractIndexFormatting.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/AbstractIndexFormatting.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/AbstractIndexFormatting.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -153,4 +153,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/AbstractPageMaster.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/AbstractPageMaster.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/AbstractPageMaster.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -143,4 +143,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/AbstractPageReference.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/AbstractPageReference.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/AbstractPageReference.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -37,6 +37,8 @@
import org.axsl.fo.FoTreeException;
import org.axsl.fo.fo.GraftingPoint;
+import java.util.List;
+
/**
* Abstract superclass for page-number, page-number-citation, and
* page-number-citation-last.
@@ -100,6 +102,28 @@
/**
* {@inheritDoc}
*/
+ public List<FObj> getChildren() {
+ return EMPTY_CHILD_LIST;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void addChild(final FObj child) throws FoTreeException {
+ child.throwException("Content model of " + this.getName()
+ + " is EMPTY.");
+ }
+
+ /**
+ * {@inheritDoc}
+ */
public Namespace getNamespace() {
return this.getFoTree().getFONamespace();
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/AbstractTablePart.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/AbstractTablePart.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/AbstractTablePart.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -131,7 +131,7 @@
final int qtyColumns = this.parent.numberOfColumns();
final TableCell[][] cellArray = new TableCell[qtyRows][qtyColumns];
for (int startingRow = 0; startingRow < qtyRows; startingRow++) {
- final TableRow tableRow = (TableRow) this.getChildAt(startingRow);
+ final TableRow tableRow = this.getChildAt(startingRow);
for (int i = 0; i < tableRow.getChildCount(); i++) {
final TableCell tableCell = (TableCell) tableRow.getChildAt(i);
if (tableCell != null) {
@@ -300,4 +300,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public TableRow getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/BasicLink.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/BasicLink.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/BasicLink.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -196,4 +196,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/BidiOverride.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/BidiOverride.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/BidiOverride.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -183,4 +183,11 @@
return this.resolvedFont;
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Block.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Block.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Block.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -196,4 +196,11 @@
return this.resolvedFont;
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/BlockContainer.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/BlockContainer.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/BlockContainer.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -194,4 +194,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Bookmark.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Bookmark.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Bookmark.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -232,4 +232,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/BookmarkTree.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/BookmarkTree.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/BookmarkTree.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -187,4 +187,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ChangeBarBegin.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ChangeBarBegin.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ChangeBarBegin.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -129,16 +129,14 @@
* {@inheritDoc}
*/
public List<FObj> getChildren() {
- return null;
+ return EMPTY_CHILD_LIST;
}
/**
* {@inheritDoc}
*/
public void addChild(final FObj child) throws FoTreeException {
- /* The content model is EMPTY, which is validated at
- * validateDescendants(). */
- return;
+ this.addChildToEmptyContentModel(child);
}
/**
@@ -176,4 +174,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return null;
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ChangeBarEnd.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ChangeBarEnd.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ChangeBarEnd.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -128,16 +128,14 @@
* {@inheritDoc}
*/
public List<FObj> getChildren() {
- return null;
+ return EMPTY_CHILD_LIST;
}
/**
* {@inheritDoc}
*/
public void addChild(final FObj child) throws FoTreeException {
- /* The content model is EMPTY, which is validated at
- * validateDescendants(). */
- return;
+ this.addChildToEmptyContentModel(child);
}
/**
@@ -175,4 +173,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return null;
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Character.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Character.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Character.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -43,7 +43,6 @@
import org.axsl.font.FontUse;
import org.axsl.text.line.LineText;
-import java.util.ArrayList;
import java.util.List;
/**
@@ -54,9 +53,6 @@
/** The parent of this node. */
private FObj parent;
- /** The children of this object. */
- private List<FObj> children = new ArrayList<FObj>();
-
/** The property list for this object. */
private PropertyList propertyList;
@@ -115,7 +111,7 @@
* {@inheritDoc}
*/
protected void validateDescendants() throws FoTreeException {
- return;
+ this.validateEmptyContent();
}
/**
@@ -166,14 +162,15 @@
* {@inheritDoc}
*/
public List<FObj> getChildren() {
- return this.children;
+ return EMPTY_CHILD_LIST;
}
/**
* {@inheritDoc}
*/
public void addChild(final FObj child) throws FoTreeException {
- this.getChildren().add(child);
+ child.throwException("Content model of " + this.getName()
+ + " is EMPTY.");
}
/**
@@ -475,4 +472,11 @@
return this.resolvedFont;
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return null;
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/CharacterSequence4a.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/CharacterSequence4a.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/CharacterSequence4a.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -42,6 +42,7 @@
import org.axsl.common.value.WhiteSpaceTreatment;
import org.axsl.common.value.WrapOption;
import org.axsl.fo.FoContext;
+import org.axsl.fo.FoTreeException;
import org.axsl.fo.ProxyFactory;
import org.axsl.fo.fo.CharacterContent;
import org.axsl.fo.fo.GraftingPoint;
@@ -143,7 +144,7 @@
* {@inheritDoc}
*/
public List<FObj> getChildren() {
- return null;
+ return EMPTY_CHILD_LIST;
}
/**
@@ -1187,8 +1188,8 @@
/**
* {@inheritDoc}
*/
- public void validateDescendants() {
- /* By definition, there are no descendants. */
+ public void validateDescendants() throws FoTreeException {
+ this.validateEmptyContent();
}
/**
@@ -1273,4 +1274,11 @@
return null;
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return null;
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ColorProfile.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ColorProfile.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ColorProfile.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -36,7 +36,6 @@
import org.axsl.fo.FoTreeException;
import org.axsl.fo.ProxyFactory;
-import java.util.ArrayList;
import java.util.List;
/**
@@ -48,9 +47,6 @@
/** The parent of this node. */
private FObj parent;
- /** The children of this object. */
- private List<FObj> children = new ArrayList<FObj>();
-
/** The property list for this object. */
private PropertyList propertyList;
@@ -97,7 +93,7 @@
* {@inheritDoc}
*/
protected void validateDescendants() throws FoTreeException {
- return;
+ this.validateEmptyContent();
}
/**
@@ -132,14 +128,15 @@
* {@inheritDoc}
*/
public List<FObj> getChildren() {
- return this.children;
+ return EMPTY_CHILD_LIST;
}
/**
* {@inheritDoc}
*/
public void addChild(final FObj child) throws FoTreeException {
- this.getChildren().add(child);
+ child.throwException("Content model of " + this.getName()
+ + " is EMPTY.");
}
/**
@@ -177,4 +174,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return null;
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ConditionalPageMasterReference.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ConditionalPageMasterReference.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ConditionalPageMasterReference.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -327,4 +327,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Declarations.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Declarations.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Declarations.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -247,4 +247,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ExternalGraphic.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ExternalGraphic.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ExternalGraphic.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -42,7 +42,6 @@
import org.axsl.graphic.Graphic;
import org.axsl.graphic.GraphicException;
-import java.util.ArrayList;
import java.util.List;
/**
@@ -54,9 +53,6 @@
/** The parent of this node. */
private FObj parent;
- /** The children of this object. */
- private List<FObj> children = new ArrayList<FObj>();
-
/** The resolved Graphic instance encapsulated in this FO.
* This could be recreated each time it is requested, but is cached
* instead, due to the cost of parsing the content. Further, it is
@@ -115,7 +111,7 @@
* {@inheritDoc}
*/
protected void validateDescendants() throws FoTreeException {
- return;
+ this.validateEmptyContent();
}
/**
@@ -286,14 +282,14 @@
* {@inheritDoc}
*/
public List<FObj> getChildren() {
- return this.children;
+ return EMPTY_CHILD_LIST;
}
/**
* {@inheritDoc}
*/
public void addChild(final FObj child) throws FoTreeException {
- this.getChildren().add(child);
+ this.addChildToEmptyContentModel(child);
}
/**
@@ -317,4 +313,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return null;
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Float.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Float.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Float.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -176,4 +176,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/FlowAssignment.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/FlowAssignment.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/FlowAssignment.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -218,4 +218,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/FlowMap.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/FlowMap.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/FlowMap.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -198,4 +198,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FlowAssignment getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/FlowNameSpecifier.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/FlowNameSpecifier.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/FlowNameSpecifier.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -129,16 +129,14 @@
* {@inheritDoc}
*/
public List<FObj> getChildren() {
- return null;
+ return EMPTY_CHILD_LIST;
}
/**
* {@inheritDoc}
*/
public void addChild(final FObj child) throws FoTreeException {
- /* Content model is EMPTY, which will be validated in
- * validateDescendants(). */
- return;
+ this.addChildToEmptyContentModel(child);
}
/**
@@ -176,4 +174,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return null;
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/FlowSourceList.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/FlowSourceList.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/FlowSourceList.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -201,4 +201,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FlowNameSpecifier getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/FlowTargetList.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/FlowTargetList.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/FlowTargetList.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -202,4 +202,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public RegionNameSpecifier getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Footnote.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Footnote.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Footnote.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -201,4 +201,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/FootnoteBody.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/FootnoteBody.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/FootnoteBody.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -177,4 +177,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/IndexKeyReference.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/IndexKeyReference.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/IndexKeyReference.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -180,4 +180,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/IndexPageCitationList.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/IndexPageCitationList.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/IndexPageCitationList.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -180,4 +180,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/IndexRangeBegin.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/IndexRangeBegin.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/IndexRangeBegin.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -179,4 +179,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return null;
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/IndexRangeEnd.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/IndexRangeEnd.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/IndexRangeEnd.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -178,4 +178,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return null;
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/InitialPropertySet.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/InitialPropertySet.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/InitialPropertySet.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -184,4 +184,11 @@
return this.resolvedFont;
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Inline.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Inline.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Inline.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -181,4 +181,11 @@
return this.resolvedFont;
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/InlineContainer.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/InlineContainer.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/InlineContainer.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -186,4 +186,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/InstreamForeignObject.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/InstreamForeignObject.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/InstreamForeignObject.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -276,4 +276,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/LayoutMasterSet.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/LayoutMasterSet.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/LayoutMasterSet.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -461,4 +461,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Leader.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Leader.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Leader.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -267,4 +267,11 @@
return this.resolvedFont;
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ListBlock.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ListBlock.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ListBlock.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -185,4 +185,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ListItem.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ListItem.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ListItem.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -204,4 +204,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ListItemBody.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ListItemBody.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ListItemBody.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -188,4 +188,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ListItemLabel.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ListItemLabel.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ListItemLabel.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -188,4 +188,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Marker.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Marker.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Marker.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -209,4 +209,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/MultiCase.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/MultiCase.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/MultiCase.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -177,4 +177,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/MultiProperties.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/MultiProperties.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/MultiProperties.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -177,4 +177,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/MultiPropertySet.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/MultiPropertySet.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/MultiPropertySet.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -178,4 +178,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/MultiSwitch.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/MultiSwitch.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/MultiSwitch.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -177,4 +177,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/MultiToggle.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/MultiToggle.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/MultiToggle.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -178,4 +178,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageMasterResolver.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageMasterResolver.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageMasterResolver.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -144,8 +144,8 @@
this.currentSubSequenceNumber++;
if (this.currentSubSequenceNumber >= 0
&& this.currentSubSequenceNumber < psm.getChildCount()) {
- final SubSequenceSpecifier specifier = (SubSequenceSpecifier)
- psm.getChildAt(this.currentSubSequenceNumber);
+ final SubSequenceSpecifier specifier = psm.getChildAt(
+ this.currentSubSequenceNumber);
return makeWrapper(specifier);
}
return null;
@@ -309,7 +309,7 @@
for (int i = 0; i < this.wrapped.getChildCount(); i++) {
final ConditionalPageMasterReference cpmr =
- (ConditionalPageMasterReference) this.wrapped.getChildAt(i);
+ this.wrapped.getChildAt(i);
if (cpmr.matchesCriteria(isFirstPage, isLastPage, isOddPage,
isEmptyPage)) {
return cpmr.traitMasterReference();
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageNumber.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageNumber.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageNumber.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -33,11 +33,8 @@
import org.foray.fotree.PropertyList;
import org.axsl.fo.FoContext;
-import org.axsl.fo.FoTreeException;
import org.axsl.fo.ProxyFactory;
-import java.util.List;
-
/**
* A "page-number" object in XSL-FO.
*/
@@ -83,20 +80,6 @@
/**
* {@inheritDoc}
- */
- public List<FObj> getChildren() {
- return EMPTY_CHILD_LIST;
- }
-
- /**
- * {@inheritDoc}
- */
- public void addChild(final FObj child) throws FoTreeException {
- this.getChildren().add(child);
- }
-
- /**
- * {@inheritDoc}
* Overrides the superclass because this class has no children but
* encapsulates its underlying text.
*/
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageNumberCitation.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageNumberCitation.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageNumberCitation.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -33,11 +33,8 @@
import org.foray.fotree.PropertyList;
import org.axsl.fo.FoContext;
-import org.axsl.fo.FoTreeException;
import org.axsl.fo.ProxyFactory;
-import java.util.List;
-
/**
* A "page-number-citation" object in XSL-FO.
* @see "XSL-FO Standard 1.0, Section 6.6.11."
@@ -85,20 +82,6 @@
/**
* {@inheritDoc}
- */
- public List<FObj> getChildren() {
- return EMPTY_CHILD_LIST;
- }
-
- /**
- * {@inheritDoc}
- */
- public void addChild(final FObj child) throws FoTreeException {
- this.getChildren().add(child);
- }
-
- /**
- * {@inheritDoc}
* Overrides the superclass because this class has no children but
* encapsulates its underlying text.
*/
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageNumberCitationLast.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageNumberCitationLast.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageNumberCitationLast.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -33,11 +33,8 @@
import org.foray.fotree.PropertyList;
import org.axsl.fo.FoContext;
-import org.axsl.fo.FoTreeException;
import org.axsl.fo.ProxyFactory;
-import java.util.List;
-
/**
* A "page-number-citation-last" object in XSL-FO.
* @see "XSL-FO Recommendation 1.1, Section 6.6.12."
@@ -85,22 +82,6 @@
/**
* {@inheritDoc}
- */
- public List<FObj> getChildren() {
- return EMPTY_CHILD_LIST;
- }
-
- /**
- * {@inheritDoc}
- */
- public void addChild(final FObj child) throws FoTreeException {
- /* Content model is EMPTY, which is validated at
- * validateDescendants(). */
- return;
- }
-
- /**
- * {@inheritDoc}
* Overrides the superclass because this class has no children but
* encapsulates its underlying text.
*/
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageSequence.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageSequence.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageSequence.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -379,4 +379,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageSequenceMaster.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageSequenceMaster.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageSequenceMaster.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -171,8 +171,7 @@
*/
public void validatePageExistence() throws FoTreeException {
for (int i = 0; i < this.getChildCount(); i++) {
- final SubSequenceSpecifier specifier = (SubSequenceSpecifier)
- this.getChildAt(i);
+ final SubSequenceSpecifier specifier = this.getChildAt(i);
specifier.validatePageExistence();
}
}
@@ -258,4 +257,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public SubSequenceSpecifier getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageSequenceWrapper.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageSequenceWrapper.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageSequenceWrapper.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -188,4 +188,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Region.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Region.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Region.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -266,4 +266,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RegionNameSpecifier.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RegionNameSpecifier.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RegionNameSpecifier.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -176,4 +176,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return null;
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RepeatablePMAlternatives.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RepeatablePMAlternatives.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RepeatablePMAlternatives.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -120,8 +120,7 @@
*/
public void validatePageExistence() throws FoTreeException {
for (int i = 0; i < this.getChildCount(); i++) {
- final ConditionalPageMasterReference child =
- (ConditionalPageMasterReference) this.getChildAt(i);
+ final ConditionalPageMasterReference child = this.getChildAt(i);
child.validatePageExistence();
}
}
@@ -152,4 +151,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public ConditionalPageMasterReference getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RepeatablePMReference.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RepeatablePMReference.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RepeatablePMReference.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -134,8 +134,7 @@
* {@inheritDoc}
*/
public void addChild(final FObj child) throws FoTreeException {
- /* The content-model is EMPTY, which will be validated at
- * validateAncestry(). */
+ this.addChildToEmptyContentModel(child);
return;
}
@@ -146,4 +145,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return null;
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RetrieveMarker.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RetrieveMarker.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RetrieveMarker.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -39,7 +39,6 @@
import org.axsl.fo.FoTreeException;
import org.axsl.fo.ProxyFactory;
-import java.util.ArrayList;
import java.util.List;
/**
@@ -51,9 +50,6 @@
/** The parent of this node. */
private FObj parent;
- /** The children of this object. */
- private List<FObj> children = new ArrayList<FObj>();
-
/** The property list for this object. */
private PropertyList propertyList;
@@ -217,7 +213,7 @@
* {@inheritDoc}
*/
public List<FObj> getChildren() {
- return this.children;
+ return EMPTY_CHILD_LIST;
}
/**
@@ -241,4 +237,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return null;
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RetrieveTableMarker.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RetrieveTableMarker.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RetrieveTableMarker.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -177,4 +177,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return null;
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Root.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Root.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Root.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -517,4 +517,11 @@
return null;
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ScalingValueCitation.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ScalingValueCitation.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ScalingValueCitation.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -37,8 +37,6 @@
import org.axsl.fo.FoTreeException;
import org.axsl.fo.ProxyFactory;
-import java.util.List;
-
/**
* A "scaling-value-citation" object in XSL-FO.
* @see "XSL-FO Recommendation 1.1, Section 6.6.15."
@@ -136,22 +134,6 @@
/**
* {@inheritDoc}
*/
- public List<FObj> getChildren() {
- return null;
- }
-
- /**
- * {@inheritDoc}
- */
- public void addChild(final FObj child) throws FoTreeException {
- /* The content model is EMPTY, which is validated at
- * validateDescendants(). */
- return;
- }
-
- /**
- * {@inheritDoc}
- */
public boolean isContentBlock() {
return false;
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/SinglePageMasterReference.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/SinglePageMasterReference.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/SinglePageMasterReference.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -134,9 +134,7 @@
* {@inheritDoc}
*/
public void addChild(final FObj child) throws FoTreeException {
- /* The content-model is EMPTY, which will be validated at
- * validateAncestry(). */
- return;
+ this.addChildToEmptyContentModel(child);
}
/**
@@ -146,4 +144,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return null;
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Table.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Table.java 2007-07-26 20:23:29 UTC (rev 10114)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Table.java 2007-07-26 21:32:41 UTC (rev 10115)
@@ -440,4 +440,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public FObj getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/TableAndCaption.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/TableAndCaption.java 2007-07-26 20:23:29 UTC (rev 10114...
[truncated message content] |
|
From: <vic...@us...> - 2007-07-26 20:23:32
|
Revision: 10114
http://foray.svn.sourceforge.net/foray/?rev=10114&view=rev
Author: victormote
Date: 2007-07-26 13:23:29 -0700 (Thu, 26 Jul 2007)
Log Message:
-----------
Conform to axsl changes removing unnecessary convenience method.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkTitleArea.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/BookmarkTitle.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkTitleArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkTitleArea.java 2007-07-26 19:44:15 UTC (rev 10113)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkTitleArea.java 2007-07-26 20:23:29 UTC (rev 10114)
@@ -71,9 +71,9 @@
* @return The text for this bookmark title.
*/
public String getTitleText() {
- // Cast verified at construction.
final BookmarkTitle generatedBy = traitGeneratedBy();
- return new String(generatedBy.getContent());
+ final char[] text = generatedBy.getChildAt(0).getAreaTreeText(null);
+ return new String(text);
}
/**
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/BookmarkTitle.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/BookmarkTitle.java 2007-07-26 19:44:15 UTC (rev 10113)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/BookmarkTitle.java 2007-07-26 20:23:29 UTC (rev 10114)
@@ -53,7 +53,8 @@
private FObj parent;
/** The children of this object. */
- private List<FObj> children = new ArrayList<FObj>();
+ private List<CharacterSequence4a> children =
+ new ArrayList<CharacterSequence4a>(1);
/**
* Constructor.
@@ -96,30 +97,12 @@
throwException(this.getFullName() + " must have exactly one "
+ "child.");
}
- if (! (this.getChildren().get(0) instanceof CharacterSequence4a)) {
- throwException(this.getFullName() + " child must be #PCDATA.");
- }
}
/**
- * Returns the text of this bookmark title.
- * @return The text of this title.
- */
- public CharacterSequence4a getText() {
- /* Existence and cast verified in end(). */
- return (CharacterSequence4a) this.getChildren().get(0);
- }
-
/**
* {@inheritDoc}
*/
- public char[] getContent() {
- return getText().getAreaTreeText(null);
- }
-
- /**
- * {@inheritDoc}
- */
public String getName() {
return "bookmark-title";
}
@@ -195,22 +178,28 @@
/**
* {@inheritDoc}
*/
- public List<FObj> getChildren() {
+ public List<CharacterSequence4a> getChildren() {
return this.children;
}
/**
* {@inheritDoc}
*/
- public void addTextNode(final CharacterSequence4a textNode) {
+ public void addTextNode(final CharacterSequence4a textNode)
+ throws FoTreeException {
+ if (this.children.size() > 0) {
+ textNode.throwException("BookmarkTitle should have exactly one "
+ + "child.");
+ }
this.children.add(textNode);
}
/**
* {@inheritDoc}
*/
- public void addNonTextNode(final FObj nonTextNode) {
- this.children.add(nonTextNode);
+ public void addNonTextNode(final FObj nonTextNode) throws FoTreeException {
+ nonTextNode.throwException("Violates BookmarkTitle content model: "
+ + "(#PCDATA)");
}
/**
@@ -241,4 +230,11 @@
return this.getParent().getPrimaryFont(context);
}
+ /**
+ * {@inheritDoc}
+ */
+ public CharacterSequence4a getChildAt(final int index) {
+ return this.children.get(index);
+ }
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-26 19:44:37
|
Revision: 10113
http://foray.svn.sourceforge.net/foray/?rev=10113&view=rev
Author: victormote
Date: 2007-07-26 12:44:15 -0700 (Thu, 26 Jul 2007)
Log Message:
-----------
Fix bug in computation of BPD of inline areas.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/AbstractInlineArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/ExternalGraphicArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/ForeignObjectArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/InlineArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/InlineContainerArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberCitationArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AbstractInlineArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/AbstractInlineArea.java 2007-07-26 19:32:06 UTC (rev 10112)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/AbstractInlineArea.java 2007-07-26 19:44:15 UTC (rev 10113)
@@ -135,7 +135,8 @@
* {@inheritDoc}
*/
public int crBpd() {
- return crBPDInline();
+ final LineArea ancestorLineArea = this.ancestorLineArea();
+ return ancestorLineArea.crBpd();
}
/**
@@ -229,29 +230,4 @@
return 0;
}
- /**
- * Returns the BPD for an inline area.
- * @return The BPD for an inline area.
- */
- protected int crBPDInline() {
- int actual = 0;
- final int computed = this.getBpDimensionOpt();
- if (computed < 0) {
- actual = ancestorArea().crBpd()
- - traitBorderBeforeWidth()
- - traitBorderAfterWidth()
- - traitPaddingBefore()
- - traitPaddingAfter();
- } else {
- actual = computed;
- }
- return actual;
- }
-
- /**
- * Returns the optimum block-progression-dimension for this inline area.
- * @return The optimum bpd for this area, in millipoints.
- */
- protected abstract int getBpDimensionOpt();
-
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/ExternalGraphicArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/ExternalGraphicArea.java 2007-07-26 19:32:06 UTC (rev 10112)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/ExternalGraphicArea.java 2007-07-26 19:44:15 UTC (rev 10113)
@@ -348,13 +348,6 @@
/**
* {@inheritDoc}
*/
- protected int getBpDimensionOpt() {
- return this.traitGeneratedBy().traitBpDimensionOpt(this);
- }
-
- /**
- * {@inheritDoc}
- */
public int traitIPDimensionOpt() {
return traitGeneratedBy().traitIpDimensionOpt(this);
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/ForeignObjectArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/ForeignObjectArea.java 2007-07-26 19:32:06 UTC (rev 10112)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/ForeignObjectArea.java 2007-07-26 19:44:15 UTC (rev 10113)
@@ -360,13 +360,6 @@
/**
* {@inheritDoc}
*/
- protected int getBpDimensionOpt() {
- return this.traitGeneratedBy().traitBpDimensionOpt(this);
- }
-
- /**
- * {@inheritDoc}
- */
public int traitIPDimensionOpt() {
return traitGeneratedBy().traitIpDimensionOpt(this);
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/InlineArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/InlineArea.java 2007-07-26 19:32:06 UTC (rev 10112)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/InlineArea.java 2007-07-26 19:44:15 UTC (rev 10113)
@@ -490,13 +490,6 @@
/**
* {@inheritDoc}
*/
- protected int getBpDimensionOpt() {
- return this.traitGeneratedBy().traitBpDimensionOpt(this);
- }
-
- /**
- * {@inheritDoc}
- */
public int traitIPDimensionOpt() {
return traitGeneratedBy().traitIpDimensionOpt(this);
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/InlineContainerArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/InlineContainerArea.java 2007-07-26 19:32:06 UTC (rev 10112)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/InlineContainerArea.java 2007-07-26 19:44:15 UTC (rev 10113)
@@ -337,13 +337,6 @@
/**
* {@inheritDoc}
*/
- protected int getBpDimensionOpt() {
- return this.traitGeneratedBy().traitBpDimensionOpt(this);
- }
-
- /**
- * {@inheritDoc}
- */
public int traitIPDimensionOpt() {
return traitGeneratedBy().traitIpDimensionOpt(this);
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java 2007-07-26 19:32:06 UTC (rev 10112)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java 2007-07-26 19:44:15 UTC (rev 10113)
@@ -723,13 +723,6 @@
/**
* {@inheritDoc}
*/
- protected int getBpDimensionOpt() {
- return 0;
- }
-
- /**
- * {@inheritDoc}
- */
public int traitIPDimensionOpt() {
return -1;
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberArea.java 2007-07-26 19:32:06 UTC (rev 10112)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberArea.java 2007-07-26 19:44:15 UTC (rev 10113)
@@ -342,13 +342,6 @@
/**
* {@inheritDoc}
*/
- protected int getBpDimensionOpt() {
- return 0;
- }
-
- /**
- * {@inheritDoc}
- */
public int traitIPDimensionOpt() {
return -1;
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberCitationArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberCitationArea.java 2007-07-26 19:32:06 UTC (rev 10112)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberCitationArea.java 2007-07-26 19:44:15 UTC (rev 10113)
@@ -371,13 +371,6 @@
/**
* {@inheritDoc}
*/
- protected int getBpDimensionOpt() {
- return 0;
- }
-
- /**
- * {@inheritDoc}
- */
public int traitIPDimensionOpt() {
return -1;
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java 2007-07-26 19:32:06 UTC (rev 10112)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java 2007-07-26 19:44:15 UTC (rev 10113)
@@ -971,13 +971,6 @@
/**
* {@inheritDoc}
*/
- protected int getBpDimensionOpt() {
- return 0;
- }
-
- /**
- * {@inheritDoc}
- */
public int traitIPDimensionOpt() {
return -1;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-26 19:32:09
|
Revision: 10112
http://foray.svn.sourceforge.net/foray/?rev=10112&view=rev
Author: victormote
Date: 2007-07-26 12:32:06 -0700 (Thu, 26 Jul 2007)
Log Message:
-----------
Minor style change to PDF output.
Modified Paths:
--------------
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFLink.java
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFLink.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFLink.java 2007-07-26 16:19:54 UTC (rev 10111)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFLink.java 2007-07-26 19:32:06 UTC (rev 10112)
@@ -126,9 +126,10 @@
public String toPDF() {
final StringBuilder buffer = new StringBuilder();
buffer.append(this.pdfID() + EOL);
- buffer.append("<< /Type /Annot" + EOL);
- buffer.append("/Subtype /Link" + EOL);
- buffer.append("/Rect ["
+ buffer.append("<<" + EOL
+ + "/Type /Annot" + EOL
+ + "/Subtype /Link" + EOL
+ + "/Rect ["
+ getRectangle().getX() / WKConstants.MILLIPOINTS_PER_POINT
+ " "
+ getRectangle().getY() / WKConstants.MILLIPOINTS_PER_POINT
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-26 16:19:54
|
Revision: 10111
http://foray.svn.sourceforge.net/foray/?rev=10111&view=rev
Author: victormote
Date: 2007-07-26 09:19:54 -0700 (Thu, 26 Jul 2007)
Log Message:
-----------
Don't let sequences of fo:character objects created from #PCDATA inherit the "id" property.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/CharacterSequence4a.java
trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/CharacterSequence4a.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/CharacterSequence4a.java 2007-07-26 15:26:09 UTC (rev 10110)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/CharacterSequence4a.java 2007-07-26 16:19:54 UTC (rev 10111)
@@ -1260,4 +1260,17 @@
return this.resolvedFont;
}
+ /**
+ * {@inheritDoc}
+ * Overrides standard logic, because, although property "id" applies to
+ * fo:character, there is no way to set such a property on a sequence of
+ * fo:character objects that are inferred from #PCDATA. Any "id" for such
+ * data was designated on the parent, and, since "id" does not inherit,
+ * it cannot apply to this object.
+ */
+ @Override
+ public String traitId() {
+ return null;
+ }
+
}
Modified: trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2007-07-26 15:26:09 UTC (rev 10110)
+++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2007-07-26 16:19:54 UTC (rev 10111)
@@ -444,13 +444,14 @@
* @throws OutputException If a destination already exists.
*/
private void renderDestinations(final Area area) throws OutputException {
- if (area.destinationName() != null) {
+ final String destinationName = area.destinationName();
+ if (destinationName != null) {
final PdfDestination explicitDest =
this.currentPage.createDestination(
toPoints(area.crOriginX()),
toPoints(area.crOriginY()));
try {
- explicitDest.registerName(area.destinationName());
+ explicitDest.registerName(destinationName);
} catch (final PdfException e) {
throw new OutputException(e);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|