foray-commit Mailing List for FOray (Page 265)
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
|
|
From: <vic...@us...> - 2006-05-26 14:37:47
|
Revision: 7260 Author: victormote Date: 2006-05-26 07:37:43 -0700 (Fri, 26 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7260&view=rev Log Message: ----------- Stub implementation of new axsl method. Modified Paths: -------------- trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java Modified: trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java =================================================================== --- trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java 2006-05-26 14:21:41 UTC (rev 7259) +++ trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java 2006-05-26 14:37:43 UTC (rev 7260) @@ -367,4 +367,9 @@ } } + public int baseline(String script) { + /* TODO: Fix this. */ + return Constants.BASELINE_ALPHABETIC; + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-26 14:21:50
|
Revision: 7259 Author: victormote Date: 2006-05-26 07:21:41 -0700 (Fri, 26 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7259&view=rev Log Message: ----------- Conform to axsl changes regarding location of constants. Modified Paths: -------------- trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java Modified: trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java =================================================================== --- trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java 2006-05-26 13:24:41 UTC (rev 7258) +++ trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java 2006-05-26 14:21:41 UTC (rev 7259) @@ -27,6 +27,8 @@ import org.foray.font.charset.CharSet; import org.foray.font.format.Kerning; +import org.axsl.common.Constants; + import org.apache.commons.logging.Log; /** @@ -326,34 +328,35 @@ public int estimateBaseline(int writingMode, int baselineType, int fontSize) { switch (baselineType) { - case BASELINE_ALPHABETIC: { + case Constants.BASELINE_ALPHABETIC: { return fontSize + this.getDescender(fontSize); } - case BASELINE_IDEOGRAPHIC: { + case Constants.BASELINE_IDEOGRAPHIC: { return fontSize; } - case BASELINE_HANGING: { + case Constants.BASELINE_HANGING: { return (int) Math.round(fontSize * .3); } - case BASELINE_MATHEMATICAL: { + case Constants.BASELINE_MATHEMATICAL: { /* For now, this is the same as Alphabetic. */ return fontSize + this.getDescender(fontSize); } - case BASELINE_CENTRAL: { + case Constants.BASELINE_CENTRAL: { return fontSize / 2; } - case BASELINE_MIDDLE: { + case Constants.BASELINE_MIDDLE: { /* First get the Alphabetic baseline. */ - int baseline = baseline(writingMode, BASELINE_ALPHABETIC, fontSize); + int baseline = baseline(writingMode, Constants.BASELINE_ALPHABETIC, + fontSize); baseline -= this.getXHeight(fontSize) / 2; return baseline; } - case BASELINE_TEXT_BEFORE_EDGE: { + case Constants.BASELINE_TEXT_BEFORE_EDGE: { /* TODO: This needs to comply with the Note under "text-before-edge" * at Section 7.13 of XSL-FO 1.0. */ return 0; } - case BASELINE_TEXT_AFTER_EDGE: { + case Constants.BASELINE_TEXT_AFTER_EDGE: { /* TODO: This needs to comply with the Note under "text-after-edge" * at Section 7.13 of XSL-FO 1.0. */ return fontSize; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-26 13:24:49
|
Revision: 7258 Author: victormote Date: 2006-05-26 06:24:41 -0700 (Fri, 26 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7258&view=rev Log Message: ----------- Conform to new aXSL requirements regarding baseline computations. Only estimated values are currently provided. Modified Paths: -------------- trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java trunk/foray/foray-font/src/java/org/foray/font/FreeStandingFont.java trunk/foray/foray-font/src/java/org/foray/font/SystemFont.java Modified: trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java =================================================================== --- trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java 2006-05-25 22:13:32 UTC (rev 7257) +++ trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java 2006-05-26 13:24:41 UTC (rev 7258) @@ -292,4 +292,76 @@ } } + /** + * {@inheritDoc} + */ + public int baseline(int writingMode, int baselineType, int fontSize) { + int baseline = extractBaseline(writingMode, baselineType, fontSize); + if (baseline == Integer.MIN_VALUE) { + return estimateBaseline(writingMode, baselineType, fontSize); + } + return baseline; + } + + /** + * Returns the font's explicit definition of the baseline, if possible. + * @param writingMode Same as for {@link #baseline(int, int, int)}. + * @param baselineType Same as for {@link #baseline(int, int, int)}. + * @param fontSize Same as for {@link #baseline(int, int, int)}. + * @return The extracted Baseline, as described for + * {@link #baseline(int, int, int)}, if it exists. Otherwise, returns + * {@link Integer#MIN_VALUE}. + */ + public abstract int extractBaseline(int writingMode, int baselineType, + int fontSize) ; + + /** + * Provides reasonable estimates of the various baseline values for the + * font, based on other font metrics. + * @param writingMode Same as for {@link #baseline(int, int, int)}. + * @param baselineType Same as for {@link #baseline(int, int, int)}. + * @param fontSize Same as for {@link #baseline(int, int, int)}. + * @return The estimated value of the baseline. + */ + public int estimateBaseline(int writingMode, int baselineType, + int fontSize) { + switch (baselineType) { + case BASELINE_ALPHABETIC: { + return fontSize + this.getDescender(fontSize); + } + case BASELINE_IDEOGRAPHIC: { + return fontSize; + } + case BASELINE_HANGING: { + return (int) Math.round(fontSize * .3); + } + case BASELINE_MATHEMATICAL: { + /* For now, this is the same as Alphabetic. */ + return fontSize + this.getDescender(fontSize); + } + case BASELINE_CENTRAL: { + return fontSize / 2; + } + case BASELINE_MIDDLE: { + /* First get the Alphabetic baseline. */ + int baseline = baseline(writingMode, BASELINE_ALPHABETIC, fontSize); + baseline -= this.getXHeight(fontSize) / 2; + return baseline; + } + case BASELINE_TEXT_BEFORE_EDGE: { + /* TODO: This needs to comply with the Note under "text-before-edge" + * at Section 7.13 of XSL-FO 1.0. */ + return 0; + } + case BASELINE_TEXT_AFTER_EDGE: { + /* TODO: This needs to comply with the Note under "text-after-edge" + * at Section 7.13 of XSL-FO 1.0. */ + return fontSize; + } + default: { + return 0; + } + } + } + } Modified: trunk/foray/foray-font/src/java/org/foray/font/FreeStandingFont.java =================================================================== --- trunk/foray/foray-font/src/java/org/foray/font/FreeStandingFont.java 2006-05-25 22:13:32 UTC (rev 7257) +++ trunk/foray/foray-font/src/java/org/foray/font/FreeStandingFont.java 2006-05-26 13:24:41 UTC (rev 7258) @@ -353,4 +353,12 @@ return this.charSet; } + /** + * {@inheritDoc} + */ + public int extractBaseline(int writingMode, int baselineType, + int fontSize) { + return Integer.MIN_VALUE; + } + } Modified: trunk/foray/foray-font/src/java/org/foray/font/SystemFont.java =================================================================== --- trunk/foray/foray-font/src/java/org/foray/font/SystemFont.java 2006-05-25 22:13:32 UTC (rev 7257) +++ trunk/foray/foray-font/src/java/org/foray/font/SystemFont.java 2006-05-26 13:24:41 UTC (rev 7258) @@ -502,4 +502,12 @@ return null; } + /** + * {@inheritDoc} + */ + public int extractBaseline(int writingMode, int baselineType, + int fontSize) { + return Integer.MIN_VALUE; + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-25 22:13:41
|
Revision: 7257 Author: victormote Date: 2006-05-25 15:13:32 -0700 (Thu, 25 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7257&view=rev Log Message: ----------- Use new axsl methods for bpd computations. Modified Paths: -------------- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableCellPL.java trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TablePL.java trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableRowPL.java Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableCellPL.java =================================================================== --- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableCellPL.java 2006-05-25 22:13:23 UTC (rev 7256) +++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableCellPL.java 2006-05-25 22:13:32 UTC (rev 7257) @@ -145,11 +145,7 @@ bDone = true; // Adjust for minimum cell content height - org.axsl.areaW.Area nearest = area.nearestGeneratedByBlockLevelFO(); - int minCellHeight = Constants.DIMENSION_AUTO; - if (nearest != null) { - minCellHeight = nearest.crBPD(); - } + int minCellHeight = area.crBPDNearestGeneratedByBlockLevelFO(); minCellHeight = node.getHeight(minCellHeight); if (minCellHeight > cellArea.crBPD()) { cellArea.setProgressionDimension(minCellHeight); Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TablePL.java =================================================================== --- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TablePL.java 2006-05-25 22:13:23 UTC (rev 7256) +++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TablePL.java 2006-05-25 22:13:32 UTC (rev 7257) @@ -232,11 +232,7 @@ } } - org.axsl.areaW.Area nearest = area.nearestGeneratedByBlockLevelFO(); - int height = Constants.DIMENSION_AUTO; - if (nearest != null) { - height = nearest.crBPD(); - } + int height = area.crBPDNearestGeneratedByBlockLevelFO(); height = node.getHeight(height); if (height != 0) { areaContainer.setProgressionDimension(height); Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableRowPL.java =================================================================== --- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableRowPL.java 2006-05-25 22:13:23 UTC (rev 7256) +++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableRowPL.java 2006-05-25 22:13:32 UTC (rev 7257) @@ -155,11 +155,7 @@ AbstractTableContainer container = (AbstractTableContainer) area; TableRowContainer areaContainer = container.makeTableRowContainer(node); - org.axsl.areaW.Area nearest = area.nearestGeneratedByBlockLevelFO(); - int height = Constants.DIMENSION_AUTO; - if (nearest != null) { - height = nearest.crBPD(); - } + int height = area.crBPDNearestGeneratedByBlockLevelFO(); height = node.getHeight(height); largestCellHeight = height; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-25 22:13:27
|
Revision: 7256 Author: victormote Date: 2006-05-25 15:13:23 -0700 (Thu, 25 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7256&view=rev Log Message: ----------- Use new axsl methods for bpd computations. Modified Paths: -------------- trunk/foray/foray-areatree/src/java/org/foray/area/Area.java Modified: trunk/foray/foray-areatree/src/java/org/foray/area/Area.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2006-05-25 19:18:36 UTC (rev 7255) +++ trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2006-05-25 22:13:23 UTC (rev 7256) @@ -113,22 +113,6 @@ return traitGeneratedBy().getName(); } - public int heightNearestGenByBlockLevelFO() { - org.axsl.areaW.Area nearest = nearestGeneratedByBlockLevelFO(); - if (nearest == null) { - return Constants.DIMENSION_AUTO; - } - return nearest.crBPD(); - } - - public int widthNearestGenByBlockLevelFO() { - org.axsl.areaW.Area nearest = nearestGeneratedByBlockLevelFO(); - if (nearest == null || ! (nearest instanceof Area)) { - return Constants.DIMENSION_AUTO; - } - return ((Area) nearest).narIPD(); - } - public int traitLetterSpacingOpt() { return traitGeneratedBy().traitLetterSpacingOpt(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-25 19:18:42
|
Revision: 7255 Author: victormote Date: 2006-05-25 12:18:36 -0700 (Thu, 25 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7255&view=rev Log Message: ----------- Use new axsl convenience methods to fix NPE (restores similar functionality to the code that existed before splitting the Area and Layout code). Modified Paths: -------------- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/BlockContainerPL.java Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/BlockContainerPL.java =================================================================== --- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/BlockContainerPL.java 2006-05-25 19:17:49 UTC (rev 7254) +++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/BlockContainerPL.java 2006-05-25 19:18:36 UTC (rev 7255) @@ -49,11 +49,8 @@ } // Compute effective width & height of containing Area - org.axsl.areaW.Area nearest = area.nearestGeneratedByBlockLevelFO(); - int height = nearest.crBPD(); - height = node.getHeight(height); - int width = nearest.crIPD(); - width = node.getWidth(width); + int height = node.getHeight(area.crBPDNearestGeneratedByBlockLevelFO()); + int width = node.getWidth(area.crIPDNearestGeneratedByBlockLevelFO()); if ((width == 0) && (height == 0)) { width = node.traitRight(0) - node.traitLeft(0); height = node.traitBottom(0) - node.traitTop(0); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-25 19:17:56
|
Revision: 7254 Author: victormote Date: 2006-05-25 12:17:49 -0700 (Thu, 25 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7254&view=rev Log Message: ----------- Conform to axsl changes. 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 2006-05-25 16:18:20 UTC (rev 7253) +++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java 2006-05-25 19:17:49 UTC (rev 7254) @@ -456,4 +456,26 @@ return linkage; } + /** + * {@inheritDoc} + */ + public int crBPDNearestGeneratedByBlockLevelFO() { + org.axsl.areaW.Area nearest = nearestGeneratedByBlockLevelFO(); + if (nearest == null) { + return Constants.DIMENSION_AUTO; + } + return nearest.crBPD(); + } + + /** + * {@inheritDoc} + */ + public int crIPDNearestGeneratedByBlockLevelFO() { + org.axsl.areaW.Area nearest = nearestGeneratedByBlockLevelFO(); + if (nearest == null) { + return Constants.DIMENSION_AUTO; + } + return nearest.crIPD(); + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-25 16:18:27
|
Revision: 7253 Author: victormote Date: 2006-05-25 09:18:20 -0700 (Thu, 25 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7253&view=rev Log Message: ----------- Add switch structure to handle other algorithms. Modified Paths: -------------- trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java Modified: trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java =================================================================== --- trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java 2006-05-25 16:05:42 UTC (rev 7252) +++ trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java 2006-05-25 16:18:20 UTC (rev 7253) @@ -284,7 +284,12 @@ * {@inheritDoc} */ public float normalLineHeightFactor(int algorithm) { - return 1.2F; + switch (algorithm) { + case LH_ALGORITHM_DEFAULT: + default: { + return 1.2F; + } + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-25 16:06:20
|
Revision: 7252 Author: victormote Date: 2006-05-25 09:05:42 -0700 (Thu, 25 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7252&view=rev Log Message: ----------- Conform to and use new axsl Font system capability of computing a normal line-height. Modified Paths: -------------- trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/LineHeight.java Modified: trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java =================================================================== --- trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java 2006-05-25 15:10:46 UTC (rev 7251) +++ trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java 2006-05-25 16:05:42 UTC (rev 7252) @@ -280,4 +280,11 @@ */ public abstract CharSet getCharSet() ; + /** + * {@inheritDoc} + */ + public float normalLineHeightFactor(int algorithm) { + return 1.2F; + } + } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2006-05-25 15:10:46 UTC (rev 7251) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2006-05-25 16:05:42 UTC (rev 7252) @@ -1068,7 +1068,7 @@ property = fontProperty.getLineHeight(); return property.getValueMultiplier(fobj); } - return LineHeight.getValueMultiplierNoInstance(); + return LineHeight.getValueMultiplierNoInstance(this.fobj); } /** Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/LineHeight.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/LineHeight.java 2006-05-25 15:10:46 UTC (rev 7251) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/LineHeight.java 2006-05-25 16:05:42 UTC (rev 7252) @@ -36,6 +36,8 @@ import org.foray.fotree.value.PropertyValue; import org.axsl.common.Constants; +import org.axsl.fontR.Font; +import org.axsl.fontR.FontUse; public class LineHeight extends Property { @@ -173,7 +175,7 @@ short keyword = ((PropertyKeyword) this.value).getValue(); switch (keyword) { case Constants.FOVAL_NORMAL: { - return getValueMultiplierNoInstance(); + return getValueMultiplierNoInstance(fobj); } case Constants.FOVAL_INHERIT: { return fobj.getFObjParent().propertyList @@ -205,8 +207,10 @@ return (int) Math.round((fobj.traitFontSize() * 1.2)); } - public static float getValueMultiplierNoInstance() { - return 1.2F; + public static float getValueMultiplierNoInstance(FObj fobj) { + FontUse fontUse = fobj.getPrimaryFont(); + int algorithm = Font.LH_ALGORITHM_DEFAULT; + return fontUse.getFont().normalLineHeightFactor(algorithm); } public int getPrecedence(FObj fobj) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-25 15:11:01
|
Revision: 7251 Author: victormote Date: 2006-05-25 08:10:46 -0700 (Thu, 25 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7251&view=rev Log Message: ----------- Add package for creating FOray-specific objects. Added Paths: ----------- trunk/foray/foray-specific/ trunk/foray/foray-specific/.checkstyle trunk/foray/foray-specific/.classpath trunk/foray/foray-specific/.project trunk/foray/foray-specific/scripts/ trunk/foray/foray-specific/scripts/build.bat trunk/foray/foray-specific/scripts/build.sh trunk/foray/foray-specific/scripts/build.xml trunk/foray/foray-specific/src/ trunk/foray/foray-specific/src/java/ trunk/foray/foray-specific/src/java/org/ trunk/foray/foray-specific/src/java/org/foray/ trunk/foray/foray-specific/src/java/org/foray/specific/ trunk/foray/foray-specific/src/java/org/foray/specific/FOraySpecific.java Property changes on: trunk/foray/foray-specific ___________________________________________________________________ Name: svn:ignore + build zzlocal Added: trunk/foray/foray-specific/.checkstyle =================================================================== --- trunk/foray/foray-specific/.checkstyle (rev 0) +++ trunk/foray/foray-specific/.checkstyle 2006-05-25 15:10:46 UTC (rev 7251) @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<fileset-config file-format-version="1.2.0" simple-config="true"> + <fileset name="all" enabled="true" check-config-name="FOray Checkstyle" local="false"> + <file-match-pattern match-pattern="." include-pattern="true"/> + </fileset> +</fileset-config> Added: trunk/foray/foray-specific/.classpath =================================================================== --- trunk/foray/foray-specific/.classpath (rev 0) +++ trunk/foray/foray-specific/.classpath 2006-05-25 15:10:46 UTC (rev 7251) @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry excluding=".#*" kind="src" path="src/java"/> + <classpathentry kind="src" path="scripts"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="var" path="FORAY_LIB_ROOT/servlet-2.2.jar"/> + <classpathentry kind="var" path="FORAY_LIB_ROOT/xalan-2.4.1.jar"/> + <classpathentry kind="var" path="ANT_HOME/lib/ant.jar"/> + <classpathentry kind="var" path="FORAY_LIB_ROOT/xercesImpl-2.7.1.jar"/> + <classpathentry kind="var" path="FORAY_LIB_ROOT/resolver.jar"/> + <classpathentry kind="var" path="FORAY_LIB_ROOT/xml-apis-1.3.02.jar"/> + <classpathentry kind="var" path="FORAY_LIB_ROOT/commons-logging.jar"/> + <classpathentry kind="var" path="ANT_HOME/lib/ant-launcher.jar"/> + <classpathentry kind="var" path="ANT_HOME/lib/ant-trax.jar"/> + <classpathentry combineaccessrules="false" kind="src" path="/FOrayApp"/> + <classpathentry combineaccessrules="false" kind="src" path="/axslFont-R"/> + <classpathentry combineaccessrules="false" kind="src" path="/FOrayFont"/> + <classpathentry combineaccessrules="false" kind="src" path="/axslText"/> + <classpathentry combineaccessrules="false" kind="src" path="/FOrayText"/> + <classpathentry combineaccessrules="false" kind="src" path="/axslGraphic-R"/> + <classpathentry combineaccessrules="false" kind="src" path="/FOrayGraphic"/> + <classpathentry combineaccessrules="false" kind="src" path="/FOrayCommon"/> + <classpathentry combineaccessrules="false" kind="src" path="/axslFO-R"/> + <classpathentry combineaccessrules="false" kind="src" path="/axslArea-W"/> + <classpathentry combineaccessrules="false" kind="src" path="/axslLayout"/> + <classpathentry kind="output" path="build/eclipse"/> +</classpath> Added: trunk/foray/foray-specific/.project =================================================================== --- trunk/foray/foray-specific/.project (rev 0) +++ trunk/foray/foray-specific/.project 2006-05-25 15:10:46 UTC (rev 7251) @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>FOrayApp</name> + <comment></comment> + <projects> + <project>FOrayCommon</project> + <project>FOrayFont</project> + <project>FOrayFOTree</project> + <project>FOrayGraphic</project> + <project>FOrayPDF</project> + <project>FOrayPS</project> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.atlassw.tools.eclipse.checkstyle.CheckstyleBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>com.atlassw.tools.eclipse.checkstyle.CheckstyleNature</nature> + </natures> +</projectDescription> Added: trunk/foray/foray-specific/scripts/build.bat =================================================================== --- trunk/foray/foray-specific/scripts/build.bat (rev 0) +++ trunk/foray/foray-specific/scripts/build.bat 2006-05-25 15:10:46 UTC (rev 7251) @@ -0,0 +1,27 @@ +@echo off + +echo "FOray Build System" +echo "------------------" + +IF "%JAVA_HOME%" == "" GOTO JAVA_HOME_ERR +IF "%ANT_HOME%" == "" GOTO ANT_HOME_ERR + +call %ANT_HOME%\bin\ant.bat %* + +GOTO END + +:JAVA_HOME_ERR + echo ERROR: JAVA_HOME not found in your environment. + echo + echo Please set the JAVA_HOME variable in your environment to match the + echo location of the Java Virtual Machine you want to use. +GOTO END + +:ANT_HOME_ERR + echo ERROR: ANT_HOME not found in your environment. + echo + echo Please set the ANT_HOME variable in your environment to match the + echo location of the root of your ANT installation. +GOTO END + +:END Added: trunk/foray/foray-specific/scripts/build.sh =================================================================== --- trunk/foray/foray-specific/scripts/build.sh (rev 0) +++ trunk/foray/foray-specific/scripts/build.sh 2006-05-25 15:10:46 UTC (rev 7251) @@ -0,0 +1,29 @@ +#!/bin/sh + +# This file must be executable. + +echo +echo "FOray Build System" +echo "------------------" + +if [ "$JAVA_HOME" = "" ] +then + echo "ERROR: JAVA_HOME not found in your environment." + echo + echo "Please set the JAVA_HOME variable in your environment to match the" + echo "location of the Java Virtual Machine you want to use." + exit 1 +fi + +if [ "$ANT_HOME" = "" ] +then + echo "ERROR: ANT_HOME not found in your environment." + echo + echo "Please set the ANT_HOME variable in your environment to match the" + echo "location of the root of your ANT installation." + exit 1 +fi + +"$ANT_HOME"/bin/ant "$@" + +##### Last Line of $RCSfile$ ##### Property changes on: trunk/foray/foray-specific/scripts/build.sh ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + "Author Id Rev Date URL" Name: svn:eol-style + native Added: trunk/foray/foray-specific/scripts/build.xml =================================================================== --- trunk/foray/foray-specific/scripts/build.xml (rev 0) +++ trunk/foray/foray-specific/scripts/build.xml 2006-05-25 15:10:46 UTC (rev 7251) @@ -0,0 +1,199 @@ +<?xml version="1.0"?> +<!-- $Id$ --> + +<project default="package" basedir="."> + + <!-- Set up a prefix to designate environment variables. --> + <property environment="env"/> + + <target name="env"> + <!-- If the environment variable FORAY_CONFIG is set, use it. --> + <condition property="foray.config" value="${env.FORAY_CONFIG}"> + <and> + <isset property="env.FORAY_CONFIG"/> + <available file="${env.FORAY_CONFIG}"/> + </and> + </condition> + <!-- Otherwise, set it to the FOray scripts directory. --> + <property name="foray.config" location="../../scripts"/> + <echo>foray.config: ${foray.config}</echo> + + <!-- Retrieve externally-configured properties. --> + <property file="${foray.config}/foray-build.properties"/> + + <!-- Get a default for {foray.home}. --> + <property name="foray.home" location="../.."/> + <echo>foray.home: ${foray.home}</echo> + + <!-- Set up dependent properties. --> + <property name="lib.dir" location="${foray.home}/lib"/> + <property name="axsl.build" location="${lib.dir}"/> + + <path id="libs-build-classpath"> + <fileset dir="${axsl.build}"> + <include name="**/axsl*.jar"/> + </fileset> + <fileset dir="${lib.dir}"> + <include name="xml-apis*.jar"/> + <include name="servlet*.jar"/> + <include name="axsl*.jar"/> + <include name="xercesImpl*.jar"/> + <include name="commons-logging.jar"/> + </fileset> + <fileset dir="${foray.home}/foray-common/build/ant"> + <include name="*.jar"/> + </fileset> + <fileset dir="${foray.home}/foray-font/build/ant"> + <include name="*.jar"/> + </fileset> + <fileset dir="${foray.home}/foray-graphic/build/ant"> + <include name="*.jar"/> + </fileset> + <fileset dir="${foray.home}/foray-pdf/build/ant"> + <include name="*.jar"/> + </fileset> + <fileset dir="${foray.home}/foray-text/build/ant"> + <include name="*.jar"/> + </fileset> + <fileset dir="${foray.home}/foray-fotree/build/ant"> + <include name="*.jar"/> + </fileset> + <fileset dir="${foray.home}/foray-areatree/build/ant"> + <include name="*.jar"/> + </fileset> + <fileset dir="${foray.home}/foray-layout/build/ant"> + <include name="*.jar"/> + </fileset> + <fileset dir="${foray.home}/foray-pioneer/build/ant"> + <include name="*.jar"/> + </fileset> + <fileset dir="${foray.home}/foray-output/build/ant"> + <include name="*.jar"/> + </fileset> + <fileset dir="${foray.home}/foray-render/build/ant"> + <include name="*.jar"/> + </fileset> + </path> + </target> + + <!-- =================================================================== --> + <!-- Initialization target --> + <!-- =================================================================== --> + <target name="init" depends="env"> + <tstamp/> + <property name="name" value="foray"/> + <property name="contact.info" + value="The FOray project http://www.foray.org"/> + <property name="module" value="app"/> + <property name="module.dir" value="${foray.home}/foray-${module}"/> + <property name="version" value="0.1"/> + <property name="src.dir" value="${module.dir}/src"/> + <property name="build.dir" value="${module.dir}/build/ant"/> + <property name="classes.dir" value="${build.dir}/classes"/> + <property name="debug" value="on"/> + <property name="optimize" value="off"/> + <property name="deprecation" value="off"/> + <property name="source" value="1.4"/> + </target> + + <!-- =================================================================== --> + <!-- Prepares the build directory --> + <!-- =================================================================== --> + <target name="prepare" depends="init"> + <!-- create directories --> + <echo message="Preparing the build directories"/> + <mkdir dir="${build.dir}"/> + <mkdir dir="${classes.dir}"/> + </target> + + <!-- =================================================================== --> + <!-- Compiles the source directory --> + <!-- =================================================================== --> + <target name="compile" depends="prepare"> + <echo message="Compiling the sources "/> + <!-- create directories --> + <mkdir dir="${build.dir}"/> + <javac srcdir="${src.dir}" + destdir="${classes.dir}" + debug="${debug}" + deprecation="${deprecation}" + optimize="${optimize}" + source="${source}" + > + <classpath refid="libs-build-classpath"/> + </javac> + </target> + + <!-- =================================================================== --> + <!-- Creates the class package --> + <!-- =================================================================== --> + <target name="package" depends="compile, style" + description="Generates the jar files (default target)"> + <echo message="Creating the jar file ${build.dir}/${name}.jar"/> + + <tstamp> + <format property="ts" pattern="yyyyMMdd-HHmmss-z"/> + </tstamp> + <jar jarfile="${build.dir}/${name}-${module}.jar" + basedir="${classes.dir}" + > + <manifest> + <attribute name="Implementation-Title" value="${name}-${module}"/> + <attribute name="Implementation-Version" value="${version}"/> + <attribute name="Implementation-Vendor" + value="${contact.info}"/> + </manifest> + </jar> + + </target> + + <target name="javadoc-api" depends="init" description="Creates API + documentation"> + <echo message="Producing the javadoc files "/> + <mkdir dir="${build.dir}/javadoc-api"/> + <javadoc + packagenames="org.foray.app" + sourcepath="${src.dir}/java" + destdir="${build.dir}/javadoc-api" + classpathref="libs-build-classpath" + author="true" + version="true" + windowtitle="FOray Application API" + doctitle="FOray Application API" + bottom="Copyright © 2004 The FOray Project. All Rights Reserved." + overview="${src.dir}/java/org/foray/app/overview.html" + use="true" + access="public" + failonerror="true"> + <classpath refid="libs-build-classpath"/> + </javadoc> + </target> + + <!-- =================================================================== --> + <!-- Clean targets --> + <!-- =================================================================== --> + <target name="clean" depends="init" description="Cleans the build directory"> + <delete dir="${build.dir}"/> + </target> + + <!-- =================================================================== --> + <!-- Checkstyle --> + <!-- =================================================================== --> + <target name="style" depends="init" description="Runs checkstyle" + if="checkstyle.home"> + <taskdef name="checkstyle" + classname="com.puppycrawl.tools.checkstyle.CheckStyleTask"> + <classpath> + <fileset dir="${checkstyle.home}"> + <include name="checkstyle-all-*.jar"/> + </fileset> + </classpath> + </taskdef> + <checkstyle config="../../scripts/checkstyle-config.xml"> + <fileset dir="${src.dir}" includes="**/*.java"/> + </checkstyle> + </target> + +</project> + +<!-- Last Line of $RCSfile$ --> Property changes on: trunk/foray/foray-specific/scripts/build.xml ___________________________________________________________________ Name: svn:keywords + "Author Id Rev Date URL" Name: svn:eol-style + native Added: trunk/foray/foray-specific/src/java/org/foray/specific/FOraySpecific.java =================================================================== --- trunk/foray/foray-specific/src/java/org/foray/specific/FOraySpecific.java (rev 0) +++ trunk/foray/foray-specific/src/java/org/foray/specific/FOraySpecific.java 2006-05-25 15:10:46 UTC (rev 7251) @@ -0,0 +1,107 @@ +/* + * Copyright 2006 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 + * + */ + +/* $Id$ */ + +package org.foray.specific; + +import org.foray.app.FOrayException; +import org.foray.app.SessionConfig; +import org.foray.common.XMLParser; +import org.foray.font.FOrayFontServer; +import org.foray.graphic.FOrayGraphicServer; + +import org.axsl.areaW.AreaTreeFactory; +import org.axsl.foR.FOTreeFactory; +import org.axsl.fontR.FontException; +import org.axsl.fontR.FontServer; +import org.axsl.graphicR.GraphicServer; +import org.axsl.layout.LayoutFactory; +import org.axsl.text.TextServer; + +import org.apache.commons.logging.Log; + +import org.xml.sax.EntityResolver; + +import java.net.URL; + +public class FOraySpecific { + + private Log logger; + + public FOraySpecific(Log logger) throws FOrayException { + this.logger = logger; + } + + public Log getLogger() { + return this.logger; + } + + public FontServer makeFontServer(SessionConfig configuration, + EntityResolver entityResolver) throws FOrayException { + FOrayFontServer forayFontServer = new FOrayFontServer(getLogger()); + forayFontServer.setBaseFontURL( + configuration.optionFontBaseDirectory()); + forayFontServer.setBaseURL(configuration.optionBaseDirectory()); + forayFontServer.setEntityResolver(entityResolver); + try { + forayFontServer.setup(configuration.optionFontConfiguration(), + null); + } catch (FontException e) { + throw new FOrayException(e); + } + return forayFontServer; + } + + public TextServer makeTextServer(SessionConfig configuration) + throws FOrayException { + URL hyphenationDir = configuration.optionHyphenationBaseDirectory(); + return new org.foray.text.TextServer(getLogger(), + hyphenationDir); + + } + + public GraphicServer makeGraphicServer() throws FOrayException { + return new FOrayGraphicServer(getLogger(), + XMLParser.getParserClassName()); + } + + public FOTreeFactory makeFOTreeFactory(GraphicServer graphicServer, + TextServer textServer, URL[] graphicSearchPath) + throws FOrayException { + return null; +// return new FOrayFOTreeServer(this.getLogger(), +// graphicServer, textServer, graphicSearchPath,Wi +// getConfiguration().optionCacheGraphics()); +// + } + + public AreaTreeFactory makeAreaTreeFactory() + throws FOrayException { + return null; + } + + public LayoutFactory makeLayoutFactory() throws FOrayException { + return null; + } + +} Property changes on: trunk/foray/foray-specific/src/java/org/foray/specific/FOraySpecific.java ___________________________________________________________________ Name: svn:keywords + "Author Id Rev Date URL" Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-24 20:52:09
|
Revision: 7250 Author: victormote Date: 2006-05-24 13:51:39 -0700 (Wed, 24 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7250&view=rev Log Message: ----------- Conform to axsl changes regarding the creation of FontConsumer instances. Modified Paths: -------------- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java trunk/foray/foray-font/src/java/org/foray/font/FOrayFontConsumer.java trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java trunk/foray/foray-output/src/java/org/foray/output/MIFConverter.java trunk/foray/foray-output/src/java/org/foray/output/OutputTarget.java trunk/foray/foray-render/src/java/org/foray/render/PrintRenderer.java trunk/foray/foray-render/src/java/org/foray/render/awt/AWTRenderer.java trunk/foray/foray-render/src/java/org/foray/render/svg/SVGRenderer.java trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java Modified: trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-24 19:35:38 UTC (rev 7249) +++ trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-24 20:51:39 UTC (rev 7250) @@ -24,8 +24,6 @@ package org.foray.app; -import org.foray.font.FOrayFontConsumer; -import org.foray.font.FOrayFontServer; import org.foray.output.OutputTarget; import org.foray.render.Renderer; @@ -172,14 +170,12 @@ throw new FOrayException("OutputStream is required."); } + /* Obtain a FontConsumer instance. */ FontServer server = getFontServer(); - if (server instanceof FOrayFontServer) { - this.fontConsumer = new FOrayFontConsumer((FOrayFontServer) server, - this.getOutputTarget().isUsingFreeStandingFonts(), - this.getOutputTarget().isUsingSystemFonts(), - this.getOutputTarget().isUsingFreeStandingFonts()); - } - + this.fontConsumer = server.makeFontConsumer(); + this.fontConsumer.setFontSources(this.getOutputTarget() + .getFontSources()); + /* Finish configuring the OutputTarget. */ this.outputTarget.setOutputStream(this.getOutputStream()); this.outputTarget.setApplicationName( Modified: trunk/foray/foray-font/src/java/org/foray/font/FOrayFontConsumer.java =================================================================== --- trunk/foray/foray-font/src/java/org/foray/font/FOrayFontConsumer.java 2006-05-24 19:35:38 UTC (rev 7249) +++ trunk/foray/foray-font/src/java/org/foray/font/FOrayFontConsumer.java 2006-05-24 20:51:39 UTC (rev 7250) @@ -110,25 +110,36 @@ /** * Constructor. * @param server The FOrayFontServer instance serving this FontConsumer. - * @param usesFreeStandingFonts Set to true if the FontConsumer can use - * free-standing fonts. - * @param usesSystemFonts Set to true if the FontConsumer can use system - * fonts. - * @param prefersFreeStandingFonts Set to true if FreeStandingFonts should - * be selected where possible, false if SystemFont should be selected where - * possible. - * In cases where usesFreeStandingFonts and usesSystemFonts are both set to - * true, this breaks the tie. */ - public FOrayFontConsumer(FOrayFontServer server, - boolean usesFreeStandingFonts, boolean usesSystemFonts, - boolean prefersFreeStandingFonts) { + public FOrayFontConsumer(FOrayFontServer server) { this.server = server; - this.usesFreeStandingFonts = usesFreeStandingFonts; - this.usesSystemFonts = usesSystemFonts; - this.prefersFreeStandingFonts = prefersFreeStandingFonts; + this.usesFreeStandingFonts = true; + this.usesSystemFonts = true; + this.prefersFreeStandingFonts = true; } + public void setFontSources(int[] fontSources) { + if (fontSources == null + || fontSources.length < 1) { + return; + } + if (fontSources[0] == FONT_SOURCE_SYSTEM) { + this.prefersFreeStandingFonts = false; + } else { + this.prefersFreeStandingFonts = true; + } + for (int i = 0; i < fontSources.length; i++) { + if (fontSources[i] == FONT_SOURCE_FREE_STANDING) { + this.usesFreeStandingFonts = true; + break; + } + if (fontSources[i] == FONT_SOURCE_SYSTEM) { + this.usesSystemFonts = true; + break; + } + } + } + /** * Use this method to set a logger for this font consumer. This will * override the logger used by FOrayFontServer. Modified: trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java =================================================================== --- trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java 2006-05-24 19:35:38 UTC (rev 7249) +++ trunk/foray/foray-font/src/java/org/foray/font/FOrayFontServer.java 2006-05-24 20:51:39 UTC (rev 7250) @@ -29,6 +29,7 @@ import org.foray.font.format.MetricsFileReader; import org.foray.font.output.FOrayFontPDFFactory; +import org.axsl.fontR.FontConsumer; import org.axsl.fontR.FontException; import org.axsl.fontR.FontServer; import org.axsl.fontR.output.FontOutputFactory; @@ -844,4 +845,11 @@ this.registeredFontSelectorFactories.put(name, factory); } + /** + * {@inheritDoc} + */ + public FontConsumer makeFontConsumer() { + return new FOrayFontConsumer(this); + } + } Modified: trunk/foray/foray-output/src/java/org/foray/output/MIFConverter.java =================================================================== --- trunk/foray/foray-output/src/java/org/foray/output/MIFConverter.java 2006-05-24 19:35:38 UTC (rev 7249) +++ trunk/foray/foray-output/src/java/org/foray/output/MIFConverter.java 2006-05-24 20:51:39 UTC (rev 7250) @@ -32,6 +32,7 @@ import org.axsl.foR.fo.TableCell; import org.axsl.foR.fo.TableColumn; import org.axsl.foR.fo.TableRow; +import org.axsl.fontR.FontConsumer; import java.awt.Color; import java.io.IOException; @@ -226,14 +227,13 @@ this.getOutputStream().flush(); } - public boolean isUsingFreeStandingFonts() { - return true; + /** + * {@inheritDoc} + */ + public int[] getFontSources() { + return new int[] {FontConsumer.FONT_SOURCE_FREE_STANDING}; } - public boolean isUsingSystemFonts() { - return false; - } - public void resetTextCursor() { } Modified: trunk/foray/foray-output/src/java/org/foray/output/OutputTarget.java =================================================================== --- trunk/foray/foray-output/src/java/org/foray/output/OutputTarget.java 2006-05-24 19:35:38 UTC (rev 7249) +++ trunk/foray/foray-output/src/java/org/foray/output/OutputTarget.java 2006-05-24 20:51:39 UTC (rev 7250) @@ -80,17 +80,19 @@ public abstract void stopOutput() throws IOException; /** - * - * @return True if the Renderer implementation can use FreeStandingFonts. + * Indicates which font sources can be used by this OutputTarget. + * @return The array of valid font sources that can be used by this + * OutputTarget. + * Valid array values are {@link FontConsumer#FONT_SOURCE_FREE_STANDING} and + * {@link FontConsumer#FONT_SOURCE_SYSTEM}. + * The order of the array signifies the order of preference for selection + * purposes. + * For example, if both system fonts and free-standing fonts can be used, + * but free-standing fonts are preferred, the array should contain + * { FONT_SOURCE_FREE_STANDING, FONT_SOURCE_SYSTEM }; */ - public abstract boolean isUsingFreeStandingFonts() ; + public abstract int[] getFontSources() ; - /** - * - * @return True if the Renderer implementation can use SystemFonts. - */ - public abstract boolean isUsingSystemFonts(); - public void setOutputStream(OutputStream stream) { this.outputStream = stream; } Modified: trunk/foray/foray-render/src/java/org/foray/render/PrintRenderer.java =================================================================== --- trunk/foray/foray-render/src/java/org/foray/render/PrintRenderer.java 2006-05-24 19:35:38 UTC (rev 7249) +++ trunk/foray/foray-render/src/java/org/foray/render/PrintRenderer.java 2006-05-24 20:51:39 UTC (rev 7250) @@ -31,6 +31,7 @@ import org.axsl.areaR.LeaderArea; import org.axsl.areaR.TextArea; import org.axsl.common.Constants; +import org.axsl.fontR.FontConsumer; import java.awt.Color; @@ -206,12 +207,11 @@ renderTextSegment(area, text); } - public boolean isUsingFreeStandingFonts() { - return true; + /** + * {@inheritDoc} + */ + public int[] getFontSources() { + return new int[] {FontConsumer.FONT_SOURCE_FREE_STANDING}; } - public boolean isUsingSystemFonts() { - return false; - } - } Modified: trunk/foray/foray-render/src/java/org/foray/render/awt/AWTRenderer.java =================================================================== --- trunk/foray/foray-render/src/java/org/foray/render/awt/AWTRenderer.java 2006-05-24 19:35:38 UTC (rev 7249) +++ trunk/foray/foray-render/src/java/org/foray/render/awt/AWTRenderer.java 2006-05-24 20:51:39 UTC (rev 7250) @@ -39,6 +39,7 @@ import org.axsl.areaR.SVGArea; import org.axsl.areaR.TextArea; import org.axsl.common.Constants; +import org.axsl.fontR.FontConsumer; import org.axsl.fontR.FontUse; import org.axsl.graphicR.Graphic; import org.axsl.graphicR.GraphicException; @@ -873,14 +874,14 @@ render(0); } - public boolean isUsingFreeStandingFonts() { - return false; + /** + * {@inheritDoc} + */ + public int[] getFontSources() { + return new int[] {FontConsumer.FONT_SOURCE_FREE_STANDING, + FontConsumer.FONT_SOURCE_SYSTEM}; } - public boolean isUsingSystemFonts() { - return true; - } - public void resetTextCursor() { } Modified: trunk/foray/foray-render/src/java/org/foray/render/svg/SVGRenderer.java =================================================================== --- trunk/foray/foray-render/src/java/org/foray/render/svg/SVGRenderer.java 2006-05-24 19:35:38 UTC (rev 7249) +++ trunk/foray/foray-render/src/java/org/foray/render/svg/SVGRenderer.java 2006-05-24 20:51:39 UTC (rev 7250) @@ -38,6 +38,7 @@ import org.axsl.areaR.SVGArea; import org.axsl.areaR.TextArea; import org.axsl.common.Constants; +import org.axsl.fontR.FontConsumer; import org.axsl.graphicR.Graphic; import org.axsl.graphicR.GraphicException; import org.axsl.graphicR.SVGGraphic; @@ -562,14 +563,13 @@ pageNumber = 0; } - public boolean isUsingFreeStandingFonts() { - return false; + /** + * {@inheritDoc} + */ + public int[] getFontSources() { + return new int[] {FontConsumer.FONT_SOURCE_SYSTEM}; } - public boolean isUsingSystemFonts() { - return true; - } - public void resetTextCursor() { } Modified: trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java =================================================================== --- trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java 2006-05-24 19:35:38 UTC (rev 7249) +++ trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java 2006-05-24 20:51:39 UTC (rev 7250) @@ -54,6 +54,7 @@ import org.axsl.areaR.TableRowContainer; import org.axsl.areaR.TextArea; import org.axsl.common.Constants; +import org.axsl.fontR.FontConsumer; import org.axsl.graphicR.Graphic; import java.awt.Color; @@ -543,14 +544,13 @@ getLogger().debug("written out XML"); } - public boolean isUsingFreeStandingFonts() { - return true; + /** + * {@inheritDoc} + */ + public int[] getFontSources() { + return new int[] {FontConsumer.FONT_SOURCE_FREE_STANDING}; } - public boolean isUsingSystemFonts() { - return false; - } - protected void drawLine(int startX, int startY, int endX, int endY, int thickness, int ruleStyle, Color strokeColor) { // No operation. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-24 19:36:09
|
Revision: 7249 Author: victormote Date: 2006-05-24 12:35:38 -0700 (Wed, 24 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7249&view=rev Log Message: ----------- Use new axsl layout factory. Modified Paths: -------------- trunk/foray/foray-app/src/java/org/foray/app/AWTStarter.java trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java trunk/foray/foray-app/src/java/org/foray/app/FOrayDocument.java trunk/foray/foray-app/src/java/org/foray/app/FOraySession.java trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java trunk/foray/foray-app/src/java/org/foray/app/PrintStarter.java trunk/foray/foray-app/src/java/org/foray/app/ant/FOrayAntTaskStarter.java trunk/foray/foray-app/src/java/org/foray/app/test/TestConverter.java trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoAWTViewer.java trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoFO2PDF.java trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoObj2PDF.java trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoXML2PDF.java trunk/foray/foray-app/src/java/org/foray/demo/servlet/AbstractDemoServlet.java Added Paths: ----------- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerFactory.java Modified: trunk/foray/foray-app/src/java/org/foray/app/AWTStarter.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/AWTStarter.java 2006-05-24 18:46:08 UTC (rev 7248) +++ trunk/foray/foray-app/src/java/org/foray/app/AWTStarter.java 2006-05-24 19:35:38 UTC (rev 7249) @@ -100,7 +100,7 @@ SessionConfig configuration = this.options.getSessionConfig(); session = new FOraySession(null, configuration, null, null, null, null, - null); + null, null); // init parser parser = inputHandler.getParser(); Modified: trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java 2006-05-24 18:46:08 UTC (rev 7248) +++ trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java 2006-05-24 19:35:38 UTC (rev 7249) @@ -33,6 +33,7 @@ import org.axsl.foR.FOTreeFactory; import org.axsl.fontR.FontServer; import org.axsl.graphicR.GraphicServer; +import org.axsl.layout.LayoutFactory; import org.axsl.text.TextServer; import org.apache.commons.logging.Log; @@ -90,9 +91,10 @@ GraphicServer graphicServer = null; FOTreeFactory foTreeServer = null; AreaTreeFactory areaTreeFactory = null; + LayoutFactory layoutFactory = null; FOraySession session = new FOraySession(logger, sessionConfig, fontServer, textServer, graphicServer, foTreeServer, - areaTreeFactory); + areaTreeFactory, layoutFactory); /* * Instantiate and configure the FOrayDocument(s). The constructor Modified: trunk/foray/foray-app/src/java/org/foray/app/FOrayDocument.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOrayDocument.java 2006-05-24 18:46:08 UTC (rev 7248) +++ trunk/foray/foray-app/src/java/org/foray/app/FOrayDocument.java 2006-05-24 19:35:38 UTC (rev 7249) @@ -40,6 +40,7 @@ import org.axsl.fontR.FontConsumer; import org.axsl.fontR.FontServer; import org.axsl.graphicR.GraphicServer; +import org.axsl.layout.LayoutFactory; import org.axsl.pdfW.PDFDocument; import org.axsl.text.TextServer; @@ -394,4 +395,8 @@ return this.session.getAreaTreeFactory(); } + public LayoutFactory getLayoutFactory() { + return this.session.getLayoutFactory(); + } + } Modified: trunk/foray/foray-app/src/java/org/foray/app/FOraySession.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOraySession.java 2006-05-24 18:46:08 UTC (rev 7248) +++ trunk/foray/foray-app/src/java/org/foray/app/FOraySession.java 2006-05-24 19:35:38 UTC (rev 7249) @@ -30,12 +30,14 @@ import org.foray.font.FOrayFontServer; import org.foray.fotree.FOrayFOTreeServer; import org.foray.graphic.FOrayGraphicServer; +import org.foray.pioneer.PioneerFactory; import org.axsl.areaW.AreaTreeFactory; import org.axsl.foR.FOTreeFactory; import org.axsl.fontR.FontException; import org.axsl.fontR.FontServer; import org.axsl.graphicR.GraphicServer; +import org.axsl.layout.LayoutFactory; import org.axsl.text.TextServer; import org.apache.commons.logging.Log; @@ -88,6 +90,8 @@ private AreaTreeFactory areaTreeFactory; + private LayoutFactory layoutFactory; + /** A SessionConfig instance to be used for this session. */ private SessionConfig configuration; @@ -121,7 +125,7 @@ public FOraySession(Log logger, SessionConfig configuration, FontServer fontServer, TextServer textServer, GraphicServer graphicServer, FOTreeFactory foTreeServer, - AreaTreeFactory areaTreeFactory) + AreaTreeFactory areaTreeFactory, LayoutFactory layoutFactory) throws FOrayException { this.log = logger; if (this.log == null) { @@ -150,6 +154,8 @@ setupFOTreeServer(); this.areaTreeFactory = areaTreeFactory; setupAreaTreeFactory(); + this.layoutFactory = layoutFactory; + setupLayoutFactory(); } public Log getLogger() { @@ -249,7 +255,7 @@ } /** - * Sets up an AreaTreeServer if there is not one already. + * Sets up an AreaTreeFactory if there is not one already. */ private void setupAreaTreeFactory() { if (this.areaTreeFactory != null) { @@ -260,6 +266,16 @@ } /** + * Sets up a LayoutFactory if there is not one already. + */ + private void setupLayoutFactory() { + if (this.layoutFactory != null) { + return; + } + this.layoutFactory = new PioneerFactory(this.getLogger()); + } + + /** * */ private URL[] buildGraphicSearchPath() { @@ -333,4 +349,8 @@ return this.areaTreeFactory; } + public LayoutFactory getLayoutFactory() { + return this.layoutFactory; + } + } Modified: trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-24 18:46:08 UTC (rev 7248) +++ trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-24 19:35:38 UTC (rev 7249) @@ -27,7 +27,6 @@ import org.foray.font.FOrayFontConsumer; import org.foray.font.FOrayFontServer; import org.foray.output.OutputTarget; -import org.foray.pioneer.PioneerLS; import org.foray.render.Renderer; import org.axsl.areaR.AreaRException; @@ -43,6 +42,7 @@ import org.axsl.fontR.FontServer; import org.axsl.layout.Layout; import org.axsl.layout.LayoutException; +import org.axsl.layout.LayoutFactory; import org.axsl.text.TextServer; import org.apache.commons.logging.Log; @@ -162,7 +162,7 @@ // Validate the LayoutStrategy. If null, create a default one. this.layout = layout; if (this.layout == null) { - this.layout = new PioneerLS(this.getLogger()); + this.layout = this.getLayoutFactory().makeLayout(); } // Validate the OutputStream. @@ -547,4 +547,8 @@ return this.document.getAreaTreeFactory(); } + public LayoutFactory getLayoutFactory() { + return this.document.getLayoutFactory(); + } + } Modified: trunk/foray/foray-app/src/java/org/foray/app/PrintStarter.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/PrintStarter.java 2006-05-24 18:46:08 UTC (rev 7248) +++ trunk/foray/foray-app/src/java/org/foray/app/PrintStarter.java 2006-05-24 19:35:38 UTC (rev 7249) @@ -56,7 +56,7 @@ Log logger = Logging.makeDefaultLogger(); SessionConfig configuration = this.options.getSessionConfig(); FOraySession session = new FOraySession(logger, configuration, null, - null, null, null, null); + null, null, null, null, null); PrinterJob pj = PrinterJob.getPrinterJob(); if(System.getProperty("dialog") != null) { Modified: trunk/foray/foray-app/src/java/org/foray/app/ant/FOrayAntTaskStarter.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/ant/FOrayAntTaskStarter.java 2006-05-24 18:46:08 UTC (rev 7248) +++ trunk/foray/foray-app/src/java/org/foray/app/ant/FOrayAntTaskStarter.java 2006-05-24 19:35:38 UTC (rev 7249) @@ -262,7 +262,7 @@ try { FOraySession session = new FOraySession(this.getLogger(), - sessionConfig, null, null, null, null, null); + sessionConfig, null, null, null, null, null, null); FOrayDocument document = new FOrayDocument(session, inputHandler.getInputSource(), parser); Modified: trunk/foray/foray-app/src/java/org/foray/app/test/TestConverter.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/test/TestConverter.java 2006-05-24 18:46:08 UTC (rev 7248) +++ trunk/foray/foray-app/src/java/org/foray/app/test/TestConverter.java 2006-05-24 19:35:38 UTC (rev 7249) @@ -269,7 +269,7 @@ } FOraySession session = new FOraySession(log, configuration, null, - null, null, null, null); + null, null, null, null, null); XMLReader parser = inputHandler.getParser(); setParserFeatures(parser); Modified: trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoAWTViewer.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoAWTViewer.java 2006-05-24 18:46:08 UTC (rev 7248) +++ trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoAWTViewer.java 2006-05-24 19:35:38 UTC (rev 7249) @@ -113,7 +113,7 @@ //Setup FOraySession SessionConfig config = new SessionConfig(getLogger()); FOraySession session = new FOraySession(logger, config, null, null, - null, null, null); + null, null, null, null); //Setup FOrayDocument InputHandler inputHandler = new FOInputHandler(getLogger(), fo); Modified: trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoFO2PDF.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoFO2PDF.java 2006-05-24 18:46:08 UTC (rev 7248) +++ trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoFO2PDF.java 2006-05-24 19:35:38 UTC (rev 7249) @@ -50,7 +50,7 @@ // Setup FOraySession SessionConfig config = new SessionConfig(getLogger()); FOraySession driver = new FOraySession(getLogger(), config, null, null, - null, null, null); + null, null, null, null); // Setup FOrayDocument InputHandler inputHandler = new FOInputHandler(getLogger(), fo); Modified: trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoObj2PDF.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoObj2PDF.java 2006-05-24 18:46:08 UTC (rev 7248) +++ trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoObj2PDF.java 2006-05-24 19:35:38 UTC (rev 7249) @@ -57,7 +57,7 @@ // Setup FOraySession SessionConfig config = new SessionConfig(getLogger()); FOraySession driver = new FOraySession(getLogger(), config, null, null, - null, null, null); + null, null, null, null); // Setup FOrayDocument // Setup JAXP transformation Modified: trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoXML2PDF.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoXML2PDF.java 2006-05-24 18:46:08 UTC (rev 7248) +++ trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoXML2PDF.java 2006-05-24 19:35:38 UTC (rev 7249) @@ -55,7 +55,7 @@ // Setup FOraySession SessionConfig config = new SessionConfig(getLogger()); FOraySession driver = new FOraySession(getLogger(), config, null, null, - null, null, null); + null, null, null, null); // Setup FOrayDocument // Setup JAXP transformation Modified: trunk/foray/foray-app/src/java/org/foray/demo/servlet/AbstractDemoServlet.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/demo/servlet/AbstractDemoServlet.java 2006-05-24 18:46:08 UTC (rev 7248) +++ trunk/foray/foray-app/src/java/org/foray/demo/servlet/AbstractDemoServlet.java 2006-05-24 19:35:38 UTC (rev 7249) @@ -110,7 +110,7 @@ // Setup FOraySession SessionConfig configuration = new SessionConfig(logger); FOraySession session = new FOraySession(logger, configuration, null, - null, null, null, null); + null, null, null, null, null); return session; } @@ -198,7 +198,7 @@ // Setup FOraySession SessionConfig configuration = new SessionConfig(logger); FOraySession session = new FOraySession(logger, configuration, null, - null, null, null, null); + null, null, null, null, null); // Setup FOrayDocument TransformerFactory factory = TransformerFactory.newInstance(); Added: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerFactory.java =================================================================== --- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerFactory.java (rev 0) +++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerFactory.java 2006-05-24 19:35:38 UTC (rev 7249) @@ -0,0 +1,50 @@ +/* + * Copyright 2006 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 + * + */ + +/* $Id$ */ + +package org.foray.pioneer; + +import org.axsl.layout.Layout; +import org.axsl.layout.LayoutFactory; + +import org.apache.commons.logging.Log; + +/** + * Creates instances of {@link PioneerLS}. + */ +public class PioneerFactory implements LayoutFactory { + + private Log logger; + + public PioneerFactory(Log logger) { + this.logger = logger; + } + + /** + * {@inheritDoc} + */ + public Layout makeLayout() { + return new PioneerLS(this.logger); + } + +} Property changes on: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerFactory.java ___________________________________________________________________ Name: svn:keywords + "Author Id Rev Date URL" Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-24 18:46:13
|
Revision: 7248 Author: victormote Date: 2006-05-24 11:46:08 -0700 (Wed, 24 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7248&view=rev Log Message: ----------- Use new axsl interfaces. Modified Paths: -------------- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java Modified: trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-24 18:45:17 UTC (rev 7247) +++ trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-24 18:46:08 UTC (rev 7248) @@ -26,7 +26,6 @@ import org.foray.font.FOrayFontConsumer; import org.foray.font.FOrayFontServer; -import org.foray.layout.LayoutStrategy; import org.foray.output.OutputTarget; import org.foray.pioneer.PioneerLS; import org.foray.render.Renderer; @@ -42,6 +41,8 @@ import org.axsl.foR.fo.PageSequence; import org.axsl.fontR.FontConsumer; import org.axsl.fontR.FontServer; +import org.axsl.layout.Layout; +import org.axsl.layout.LayoutException; import org.axsl.text.TextServer; import org.apache.commons.logging.Log; @@ -132,14 +133,14 @@ private int pageSequenceCount; /** The LayoutStrategy implementation to be used for this target. */ - private LayoutStrategy layout; + private Layout layout; private org.axsl.areaW.AreaTree areaTree; private FontConsumer fontConsumer; public FOrayTarget(FOrayDocument document, OutputTarget outputTarget, - LayoutStrategy layout, OutputStream outputStream) + Layout layout, OutputStream outputStream) throws FOrayException { // Validate the FOrayDocument. this.document = document; @@ -281,6 +282,8 @@ layout.formatPageSequence(pageCollection); } catch (AreaWException e) { throw new FOrayException(e); + } catch (LayoutException e) { + throw new FOrayException(e); } try { processQueue(false); @@ -452,7 +455,7 @@ return document.getConfiguration(); } - public LayoutStrategy getLayoutStrategy() { + public Layout getLayoutStrategy() { return this.layout; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-24 18:45:22
|
Revision: 7247 Author: victormote Date: 2006-05-24 11:45:17 -0700 (Wed, 24 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7247&view=rev Log Message: ----------- Inherit the interface doc. Modified Paths: -------------- trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java Modified: trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java =================================================================== --- trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java 2006-05-24 18:31:02 UTC (rev 7246) +++ trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java 2006-05-24 18:45:17 UTC (rev 7247) @@ -70,11 +70,7 @@ } /** - * This the main processing of the LayoutStrategy implementation, which - * is to create the needed content in the given PageCollection to satisfy - * the PageCollection's cousin PageSequence in the FOTree. - * @param pageCollection A PageCollection instance from the AreaTree. - * @throws AreaWException For errors during layout. + * {@inheritDoc} */ public void formatPageSequence(PageCollection pageCollection) throws AreaWException { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-24 18:31:10
|
Revision: 7246 Author: victormote Date: 2006-05-24 11:31:02 -0700 (Wed, 24 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7246&view=rev Log Message: ----------- Let Eclipse find the new axsl Layout package. Modified Paths: -------------- trunk/foray/foray-app/.classpath Modified: trunk/foray/foray-app/.classpath =================================================================== --- trunk/foray/foray-app/.classpath 2006-05-24 18:29:03 UTC (rev 7245) +++ trunk/foray/foray-app/.classpath 2006-05-24 18:31:02 UTC (rev 7246) @@ -31,5 +31,6 @@ <classpathentry kind="var" path="ANT_HOME/lib/ant-trax.jar"/> <classpathentry combineaccessrules="false" kind="src" path="/axslArea-W"/> <classpathentry combineaccessrules="false" kind="src" path="/FOrayLayout"/> + <classpathentry combineaccessrules="false" kind="src" path="/axslLayout"/> <classpathentry kind="output" path="build/eclipse"/> </classpath> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-24 18:29:12
|
Revision: 7245 Author: victormote Date: 2006-05-24 11:29:03 -0700 (Wed, 24 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7245&view=rev Log Message: ----------- Let Eclipse find the new axsl Layout package. Modified Paths: -------------- trunk/foray/foray-pioneer/.classpath Modified: trunk/foray/foray-pioneer/.classpath =================================================================== --- trunk/foray/foray-pioneer/.classpath 2006-05-24 18:28:28 UTC (rev 7244) +++ trunk/foray/foray-pioneer/.classpath 2006-05-24 18:29:03 UTC (rev 7245) @@ -14,5 +14,6 @@ <classpathentry kind="var" path="FORAY_LIB_ROOT/batik.jar"/> <classpathentry kind="var" path="FORAY_LIB_ROOT/commons-logging.jar"/> <classpathentry combineaccessrules="false" kind="src" path="/FOrayLayout"/> + <classpathentry combineaccessrules="false" kind="src" path="/axslLayout"/> <classpathentry kind="output" path="build/eclipse"/> </classpath> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-24 18:28:36
|
Revision: 7244 Author: victormote Date: 2006-05-24 11:28:28 -0700 (Wed, 24 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7244&view=rev Log Message: ----------- Implement new Layout interface. Modified Paths: -------------- trunk/foray/foray-layout/.classpath trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java Modified: trunk/foray/foray-layout/.classpath =================================================================== --- trunk/foray/foray-layout/.classpath 2006-05-24 17:21:48 UTC (rev 7243) +++ trunk/foray/foray-layout/.classpath 2006-05-24 18:28:28 UTC (rev 7244) @@ -10,5 +10,6 @@ <classpathentry combineaccessrules="false" kind="src" path="/axslGraphic-R"/> <classpathentry kind="var" path="FORAY_LIB_ROOT/commons-logging.jar"/> <classpathentry combineaccessrules="false" kind="src" path="/axslCommon"/> + <classpathentry combineaccessrules="false" kind="src" path="/axslLayout"/> <classpathentry kind="output" path="build/eclipse"/> </classpath> Modified: trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java =================================================================== --- trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java 2006-05-24 17:21:48 UTC (rev 7243) +++ trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java 2006-05-24 18:28:28 UTC (rev 7244) @@ -41,6 +41,7 @@ import org.axsl.foR.fo.PageSequence; import org.axsl.foR.fo.Region; import org.axsl.foR.fo.SimplePageMaster; +import org.axsl.layout.Layout; import org.axsl.text.TextException; import org.axsl.text.line.LineBreakHandler; import org.axsl.text.line.LineNonText; @@ -52,7 +53,7 @@ /** * Abstract base class for all Layout systems. */ -public abstract class LayoutStrategy implements LineBreakHandler { +public abstract class LayoutStrategy implements LineBreakHandler, Layout { Log logger; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-24 17:22:15
|
Revision: 7243 Author: victormote Date: 2006-05-24 10:21:48 -0700 (Wed, 24 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7243&view=rev Log Message: ----------- Use new AreaTreeFactory class to create AreaTree instance. Modified Paths: -------------- trunk/foray/foray-app/src/java/org/foray/app/AWTStarter.java trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java trunk/foray/foray-app/src/java/org/foray/app/FOrayDocument.java trunk/foray/foray-app/src/java/org/foray/app/FOraySession.java trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java trunk/foray/foray-app/src/java/org/foray/app/PrintStarter.java trunk/foray/foray-app/src/java/org/foray/app/ant/FOrayAntTaskStarter.java trunk/foray/foray-app/src/java/org/foray/app/test/TestConverter.java trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoAWTViewer.java trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoFO2PDF.java trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoObj2PDF.java trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoXML2PDF.java trunk/foray/foray-app/src/java/org/foray/demo/servlet/AbstractDemoServlet.java trunk/foray/foray-areatree/src/java/org/foray/area/FOrayAreaTreeFactory.java Modified: trunk/foray/foray-app/src/java/org/foray/app/AWTStarter.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/AWTStarter.java 2006-05-24 17:00:19 UTC (rev 7242) +++ trunk/foray/foray-app/src/java/org/foray/app/AWTStarter.java 2006-05-24 17:21:48 UTC (rev 7243) @@ -99,7 +99,8 @@ resource.setMissingEmphasized(false); SessionConfig configuration = this.options.getSessionConfig(); - session = new FOraySession(null, configuration, null, null, null, null); + session = new FOraySession(null, configuration, null, null, null, null, + null); // init parser parser = inputHandler.getParser(); Modified: trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java 2006-05-24 17:00:19 UTC (rev 7242) +++ trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java 2006-05-24 17:21:48 UTC (rev 7243) @@ -29,6 +29,7 @@ import org.foray.output.OutputTarget; import org.foray.pioneer.PioneerLS; +import org.axsl.areaW.AreaTreeFactory; import org.axsl.foR.FOTreeFactory; import org.axsl.fontR.FontServer; import org.axsl.graphicR.GraphicServer; @@ -88,8 +89,10 @@ TextServer textServer = null; GraphicServer graphicServer = null; FOTreeFactory foTreeServer = null; + AreaTreeFactory areaTreeFactory = null; FOraySession session = new FOraySession(logger, sessionConfig, - fontServer, textServer, graphicServer, foTreeServer); + fontServer, textServer, graphicServer, foTreeServer, + areaTreeFactory); /* * Instantiate and configure the FOrayDocument(s). The constructor Modified: trunk/foray/foray-app/src/java/org/foray/app/FOrayDocument.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOrayDocument.java 2006-05-24 17:00:19 UTC (rev 7242) +++ trunk/foray/foray-app/src/java/org/foray/app/FOrayDocument.java 2006-05-24 17:21:48 UTC (rev 7243) @@ -36,6 +36,7 @@ import org.foray.render.txt.TXTRenderer; import org.foray.render.xml.XMLRenderer; +import org.axsl.areaW.AreaTreeFactory; import org.axsl.fontR.FontConsumer; import org.axsl.fontR.FontServer; import org.axsl.graphicR.GraphicServer; @@ -389,4 +390,8 @@ return renderer; } + public AreaTreeFactory getAreaTreeFactory() { + return this.session.getAreaTreeFactory(); + } + } Modified: trunk/foray/foray-app/src/java/org/foray/app/FOraySession.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOraySession.java 2006-05-24 17:00:19 UTC (rev 7242) +++ trunk/foray/foray-app/src/java/org/foray/app/FOraySession.java 2006-05-24 17:21:48 UTC (rev 7243) @@ -24,12 +24,14 @@ package org.foray.app; +import org.foray.area.FOrayAreaTreeFactory; import org.foray.common.Logging; import org.foray.common.XMLParser; import org.foray.font.FOrayFontServer; import org.foray.fotree.FOrayFOTreeServer; import org.foray.graphic.FOrayGraphicServer; +import org.axsl.areaW.AreaTreeFactory; import org.axsl.foR.FOTreeFactory; import org.axsl.fontR.FontException; import org.axsl.fontR.FontServer; @@ -84,6 +86,8 @@ /** */ private FOTreeFactory foTreeServer; + private AreaTreeFactory areaTreeFactory; + /** A SessionConfig instance to be used for this session. */ private SessionConfig configuration; @@ -116,7 +120,8 @@ */ public FOraySession(Log logger, SessionConfig configuration, FontServer fontServer, TextServer textServer, - GraphicServer graphicServer, FOTreeFactory foTreeServer) + GraphicServer graphicServer, FOTreeFactory foTreeServer, + AreaTreeFactory areaTreeFactory) throws FOrayException { this.log = logger; if (this.log == null) { @@ -143,6 +148,8 @@ setupGraphicServer(); this.foTreeServer = foTreeServer; setupFOTreeServer(); + this.areaTreeFactory = areaTreeFactory; + setupAreaTreeFactory(); } public Log getLogger() { @@ -242,6 +249,17 @@ } /** + * Sets up an AreaTreeServer if there is not one already. + */ + private void setupAreaTreeFactory() { + if (this.areaTreeFactory != null) { + return; + } + this.areaTreeFactory = new FOrayAreaTreeFactory(this.getLogger(), + this.getTextServer()); + } + + /** * */ private URL[] buildGraphicSearchPath() { @@ -311,4 +329,8 @@ return this.entityResolver; } + public AreaTreeFactory getAreaTreeFactory() { + return this.areaTreeFactory; + } + } Modified: trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-24 17:00:19 UTC (rev 7242) +++ trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-24 17:21:48 UTC (rev 7243) @@ -24,7 +24,6 @@ package org.foray.app; -import org.foray.area.AreaTree; import org.foray.font.FOrayFontConsumer; import org.foray.font.FOrayFontServer; import org.foray.layout.LayoutStrategy; @@ -35,6 +34,7 @@ import org.axsl.areaR.AreaRException; import org.axsl.areaR.PageArea; import org.axsl.areaW.AreaTreeEvent; +import org.axsl.areaW.AreaTreeFactory; import org.axsl.areaW.AreaTreeListener; import org.axsl.areaW.AreaWException; import org.axsl.foR.FOTreeEvent; @@ -297,9 +297,8 @@ private org.axsl.areaW.AreaTree getCreatedAreaTree() { if (this.areaTree == null) { - this.areaTree = new AreaTree(this.document.getFOTreeBuilder() - .getRootFObj(), this.getFontConsumer(), - this.getTextServer(), this.getLogger()); + this.areaTree = this.getAreaTreeFactory().makeAreaTree( + this.document.getFOTreeBuilder().getRootFObj()); this.areaTree.registerListener(this); } return this.areaTree; @@ -541,4 +540,8 @@ return null; } + public AreaTreeFactory getAreaTreeFactory() { + return this.document.getAreaTreeFactory(); + } + } Modified: trunk/foray/foray-app/src/java/org/foray/app/PrintStarter.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/PrintStarter.java 2006-05-24 17:00:19 UTC (rev 7242) +++ trunk/foray/foray-app/src/java/org/foray/app/PrintStarter.java 2006-05-24 17:21:48 UTC (rev 7243) @@ -56,7 +56,7 @@ Log logger = Logging.makeDefaultLogger(); SessionConfig configuration = this.options.getSessionConfig(); FOraySession session = new FOraySession(logger, configuration, null, - null, null, null); + null, null, null, null); PrinterJob pj = PrinterJob.getPrinterJob(); if(System.getProperty("dialog") != null) { Modified: trunk/foray/foray-app/src/java/org/foray/app/ant/FOrayAntTaskStarter.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/ant/FOrayAntTaskStarter.java 2006-05-24 17:00:19 UTC (rev 7242) +++ trunk/foray/foray-app/src/java/org/foray/app/ant/FOrayAntTaskStarter.java 2006-05-24 17:21:48 UTC (rev 7243) @@ -262,7 +262,7 @@ try { FOraySession session = new FOraySession(this.getLogger(), - sessionConfig, null, null, null, null); + sessionConfig, null, null, null, null, null); FOrayDocument document = new FOrayDocument(session, inputHandler.getInputSource(), parser); Modified: trunk/foray/foray-app/src/java/org/foray/app/test/TestConverter.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/test/TestConverter.java 2006-05-24 17:00:19 UTC (rev 7242) +++ trunk/foray/foray-app/src/java/org/foray/app/test/TestConverter.java 2006-05-24 17:21:48 UTC (rev 7243) @@ -269,7 +269,7 @@ } FOraySession session = new FOraySession(log, configuration, null, - null, null, null); + null, null, null, null); XMLReader parser = inputHandler.getParser(); setParserFeatures(parser); Modified: trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoAWTViewer.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoAWTViewer.java 2006-05-24 17:00:19 UTC (rev 7242) +++ trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoAWTViewer.java 2006-05-24 17:21:48 UTC (rev 7243) @@ -113,7 +113,7 @@ //Setup FOraySession SessionConfig config = new SessionConfig(getLogger()); FOraySession session = new FOraySession(logger, config, null, null, - null, null); + null, null, null); //Setup FOrayDocument InputHandler inputHandler = new FOInputHandler(getLogger(), fo); Modified: trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoFO2PDF.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoFO2PDF.java 2006-05-24 17:00:19 UTC (rev 7242) +++ trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoFO2PDF.java 2006-05-24 17:21:48 UTC (rev 7243) @@ -50,7 +50,7 @@ // Setup FOraySession SessionConfig config = new SessionConfig(getLogger()); FOraySession driver = new FOraySession(getLogger(), config, null, null, - null, null); + null, null, null); // Setup FOrayDocument InputHandler inputHandler = new FOInputHandler(getLogger(), fo); Modified: trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoObj2PDF.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoObj2PDF.java 2006-05-24 17:00:19 UTC (rev 7242) +++ trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoObj2PDF.java 2006-05-24 17:21:48 UTC (rev 7243) @@ -57,7 +57,7 @@ // Setup FOraySession SessionConfig config = new SessionConfig(getLogger()); FOraySession driver = new FOraySession(getLogger(), config, null, null, - null, null); + null, null, null); // Setup FOrayDocument // Setup JAXP transformation Modified: trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoXML2PDF.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoXML2PDF.java 2006-05-24 17:00:19 UTC (rev 7242) +++ trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoXML2PDF.java 2006-05-24 17:21:48 UTC (rev 7243) @@ -55,7 +55,7 @@ // Setup FOraySession SessionConfig config = new SessionConfig(getLogger()); FOraySession driver = new FOraySession(getLogger(), config, null, null, - null, null); + null, null, null); // Setup FOrayDocument // Setup JAXP transformation Modified: trunk/foray/foray-app/src/java/org/foray/demo/servlet/AbstractDemoServlet.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/demo/servlet/AbstractDemoServlet.java 2006-05-24 17:00:19 UTC (rev 7242) +++ trunk/foray/foray-app/src/java/org/foray/demo/servlet/AbstractDemoServlet.java 2006-05-24 17:21:48 UTC (rev 7243) @@ -110,7 +110,7 @@ // Setup FOraySession SessionConfig configuration = new SessionConfig(logger); FOraySession session = new FOraySession(logger, configuration, null, - null, null, null); + null, null, null, null); return session; } @@ -198,7 +198,7 @@ // Setup FOraySession SessionConfig configuration = new SessionConfig(logger); FOraySession session = new FOraySession(logger, configuration, null, - null, null, null); + null, null, null, null); // Setup FOrayDocument TransformerFactory factory = TransformerFactory.newInstance(); Modified: trunk/foray/foray-areatree/src/java/org/foray/area/FOrayAreaTreeFactory.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/FOrayAreaTreeFactory.java 2006-05-24 17:00:19 UTC (rev 7242) +++ trunk/foray/foray-areatree/src/java/org/foray/area/FOrayAreaTreeFactory.java 2006-05-24 17:21:48 UTC (rev 7243) @@ -26,7 +26,6 @@ import org.axsl.areaW.AreaTreeFactory; import org.axsl.foR.fo.Root; -import org.axsl.fontR.FontConsumer; import org.axsl.text.TextServer; import org.apache.commons.logging.Log; @@ -39,13 +38,10 @@ public class FOrayAreaTreeFactory implements AreaTreeFactory { private Log logger; - private FontConsumer fontConsumer; private TextServer textServer; - public FOrayAreaTreeFactory(Log logger, FontConsumer fontConsumer, - TextServer textServer) { + public FOrayAreaTreeFactory(Log logger, TextServer textServer) { this.logger = logger; - this.fontConsumer = fontConsumer; this.textServer = textServer; } @@ -53,7 +49,7 @@ * {@inheritDoc} */ public org.axsl.areaW.AreaTree makeAreaTree(Root root) { - AreaTree areaTree = new AreaTree(root, this.fontConsumer, + AreaTree areaTree = new AreaTree(root, root.getFontConsumer(), this.textServer, getLogger()); return areaTree; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-24 17:00:26
|
Revision: 7242 Author: victormote Date: 2006-05-24 10:00:19 -0700 (Wed, 24 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7242&view=rev Log Message: ----------- Add implementation of AreaTreeFactory. Added Paths: ----------- trunk/foray/foray-areatree/src/java/org/foray/area/FOrayAreaTreeFactory.java Added: trunk/foray/foray-areatree/src/java/org/foray/area/FOrayAreaTreeFactory.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/FOrayAreaTreeFactory.java (rev 0) +++ trunk/foray/foray-areatree/src/java/org/foray/area/FOrayAreaTreeFactory.java 2006-05-24 17:00:19 UTC (rev 7242) @@ -0,0 +1,65 @@ +/* + * Copyright 2005 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 + * + */ + +/* $Id$ */ + +package org.foray.area; + +import org.axsl.areaW.AreaTreeFactory; +import org.axsl.foR.fo.Root; +import org.axsl.fontR.FontConsumer; +import org.axsl.text.TextServer; + +import org.apache.commons.logging.Log; + +/** + * The top-level object in the FOTree implementation. + * FOTreeServer encapsulates the FOTree at a high level of abstraction for a + * client application. + */ +public class FOrayAreaTreeFactory implements AreaTreeFactory { + + private Log logger; + private FontConsumer fontConsumer; + private TextServer textServer; + + public FOrayAreaTreeFactory(Log logger, FontConsumer fontConsumer, + TextServer textServer) { + this.logger = logger; + this.fontConsumer = fontConsumer; + this.textServer = textServer; + } + + /** + * {@inheritDoc} + */ + public org.axsl.areaW.AreaTree makeAreaTree(Root root) { + AreaTree areaTree = new AreaTree(root, this.fontConsumer, + this.textServer, getLogger()); + return areaTree; + } + + public Log getLogger() { + return this.logger; + } + +} Property changes on: trunk/foray/foray-areatree/src/java/org/foray/area/FOrayAreaTreeFactory.java ___________________________________________________________________ Name: svn:keywords + "Author Id Rev Date URL" Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-24 16:35:47
|
Revision: 7241 Author: victormote Date: 2006-05-24 09:35:40 -0700 (Wed, 24 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7241&view=rev Log Message: ----------- 1. Allow the AreaTree to be cast either as Readable or Writable. 2. Clean up some exceptions. Modified Paths: -------------- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java Modified: trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-24 16:11:25 UTC (rev 7240) +++ trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-24 16:35:40 UTC (rev 7241) @@ -134,7 +134,7 @@ /** The LayoutStrategy implementation to be used for this target. */ private LayoutStrategy layout; - private AreaTree areaTree; + private org.axsl.areaW.AreaTree areaTree; private FontConsumer fontConsumer; @@ -267,26 +267,25 @@ are not all valid. In this case we defer the rendering until they are all valid. */ - public void render(PageSequence pageSequence) - throws SAXException { + public void render(PageSequence pageSequence) throws FOrayException { pageSequenceCount ++; getLogger().info("Starting layout of page-sequence " + pageSequenceCount + "."); if (this.outputTarget instanceof Renderer) { Renderer renderer = (Renderer) this.outputTarget; - AreaTree areaTree = getAreaTree(); - renderer.setAreaTree(areaTree); + org.axsl.areaR.AreaTree areaTreeR = getRenderedAreaTree(); + renderer.setAreaTree(areaTreeR); org.axsl.areaW.PageCollection pageCollection = areaTree.makePageCollection(pageSequence); try { layout.formatPageSequence(pageCollection); } catch (AreaWException e) { - throw new SAXException(e); + throw new FOrayException(e); } try { processQueue(false); } catch (AreaRException e1) { - throw new SAXException(e1); + throw new FOrayException(e1); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); @@ -296,7 +295,7 @@ } } - private AreaTree getAreaTree() { + private org.axsl.areaW.AreaTree getCreatedAreaTree() { if (this.areaTree == null) { this.areaTree = new AreaTree(this.document.getFOTreeBuilder() .getRootFObj(), this.getFontConsumer(), @@ -306,6 +305,15 @@ return this.areaTree; } + private org.axsl.areaR.AreaTree getRenderedAreaTree() + throws FOrayException { + org.axsl.areaW.AreaTree areaTreeW = getCreatedAreaTree(); + if (! (areaTreeW instanceof org.axsl.areaR.AreaTree)) { + throw new FOrayException("Area Tree cannot be rendered."); + } + return (org.axsl.areaR.AreaTree) areaTreeW; + } + public void pageComplete(AreaTreeEvent event) { org.axsl.areaW.PageArea page = event.getPage(); org.axsl.areaR.PageArea pageToRender = (PageArea) page; @@ -373,7 +381,7 @@ * do not need to do anything with it, so we ignore it. * @param event The FOTreeEvent that was fired. */ - public void foFObjComplete (FOTreeEvent event) { + public void foFObjComplete(FOTreeEvent event) { } /** @@ -381,13 +389,13 @@ * FOTreeEvent that is fired when a PageSequence object has been completed. * @param event the FOTreeEvent that was fired */ - public void foPageSequenceComplete (FOTreeEvent event) { + public void foPageSequenceComplete(FOTreeEvent event) { try { boolean shouldRender = this.getConfiguration().isModeRender(); if (shouldRender) { render(event.getPageSequence()); } - } catch (SAXException e) { + } catch (FOrayException e) { // TODO Auto-generated catch block e.printStackTrace(); } @@ -398,11 +406,11 @@ * is fired when the Document has been completely parsed. * @param event the FOTreeEvent that was fired */ - public void foDocumentComplete (FOTreeEvent event) { + public void foDocumentComplete(FOTreeEvent event) { org.axsl.foR.fo.Root rootFObj = document.getFOTreeBuilder() .getRootFObj(); try { - getAreaTree().layoutDocumentNodes(rootFObj); + getCreatedAreaTree().layoutDocumentNodes(rootFObj); } catch (AreaWException e1) { getLogger().error("Error in layout of Document nodes."); e1.printStackTrace(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-24 16:11:29
|
Revision: 7240 Author: victormote Date: 2006-05-24 09:11:25 -0700 (Wed, 24 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7240&view=rev Log Message: ----------- Clean up doc a bit. Modified Paths: -------------- trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java 2006-05-24 16:04:28 UTC (rev 7239) +++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java 2006-05-24 16:11:25 UTC (rev 7240) @@ -185,9 +185,7 @@ } /** - * Add an object to the list of listeners to be notified about - * {@link AreaTreeEvent} firings. - * @param listener The listener to be registered. + * {@inheritDoc} */ public void registerListener (AreaTreeListener listener) { if (listener == null) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-24 16:04:38
|
Revision: 7239 Author: victormote Date: 2006-05-24 09:04:28 -0700 (Wed, 24 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7239&view=rev Log Message: ----------- Conform to axsl naming changes. Modified Paths: -------------- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java Modified: trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-24 15:53:10 UTC (rev 7238) +++ trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-24 16:04:28 UTC (rev 7239) @@ -150,7 +150,7 @@ document.registerTarget(this); // Register this FOrayTarget as a listener for FO Tree events. - document.getFOTreeBuilder().addFOTreeListener(this); + document.getFOTreeBuilder().registerListener(this); // Validate the OutputTarget. this.outputTarget = outputTarget; Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java 2006-05-24 15:53:10 UTC (rev 7238) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java 2006-05-24 16:04:28 UTC (rev 7239) @@ -267,7 +267,7 @@ * FOTreeEvent firings. * @param listener the Object which should be notified */ - public void addFOTreeListener (FOTreeListener listener) { + public void registerListener (FOTreeListener listener) { if (listener == null) { return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-24 15:53:18
|
Revision: 7238 Author: victormote Date: 2006-05-24 08:53:10 -0700 (Wed, 24 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7238&view=rev Log Message: ----------- Remove no-longer-needed classes that are redundant with AreaTree information. Modified Paths: -------------- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java Removed Paths: ------------- trunk/foray/foray-app/src/java/org/foray/app/FormattingResults.java trunk/foray/foray-app/src/java/org/foray/app/PageSequenceResults.java Modified: trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-24 15:47:46 UTC (rev 7237) +++ trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-05-24 15:53:10 UTC (rev 7238) @@ -118,9 +118,6 @@ /** The renderer being used. */ private OutputTarget outputTarget; - /** The formatting results to be handed back to the caller. */ - private FormattingResults results = new FormattingResults(); - /** * The list of pages waiting to be renderered. In general, pages waiting * to be rendered are doing so because they have unresolved "ref-id" items @@ -200,10 +197,6 @@ startRenderer(); } - public FormattingResults getResults() { - return this.results; - } - public void startRenderer() throws FOrayException { pageCount = 0; @@ -290,8 +283,6 @@ } catch (AreaWException e) { throw new SAXException(e); } - this.results.haveFormattedPageSequence(pageSequence, - pageCollection); try { processQueue(false); } catch (AreaRException e1) { Deleted: trunk/foray/foray-app/src/java/org/foray/app/FormattingResults.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FormattingResults.java 2006-05-24 15:47:46 UTC (rev 7237) +++ trunk/foray/foray-app/src/java/org/foray/app/FormattingResults.java 2006-05-24 15:53:10 UTC (rev 7238) @@ -1,94 +0,0 @@ -/* - * 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 - * - */ - -/* $Id$ */ - -package org.foray.app; - -import org.axsl.areaW.PageCollection; - -import org.axsl.foR.fo.PageSequence; - -import java.util.ArrayList; -import java.util.List; - -/** - * Class for reporting back formatting results to the calling application. - * - * @author Jeremias Maerki - */ -public class FormattingResults { - - private int pageCount = 0; - private List pageSequences = null; - - /** - * Constructor for the FormattingResults object - */ - public FormattingResults() { - } - - /** - * Gets the number of pages rendered - * - * @return The number of pages overall - */ - public int getPageCount() { - return this.pageCount; - } - - /** - * Gets the results for the individual page-sequences. - * - * @return A List with PageSequenceResults objects - */ - public List getPageSequences() { - return this.pageSequences; - } - - /** - * Resets this object - */ - public void reset() { - this.pageCount = 0; - if (this.pageSequences != null) { - this.pageSequences.clear(); - } - } - - /** - * Description of the Method - * - * @param pageSequence Description of Parameter - */ - public void haveFormattedPageSequence(PageSequence pageSequence, - PageCollection areaTree) { - this.pageCount += areaTree.getPageCount(); - if (this.pageSequences == null) { - this.pageSequences = new ArrayList(); - } - this.pageSequences.add( - new PageSequenceResults(pageSequence.traitId(), - areaTree.getPageCount())); - } -} - Deleted: trunk/foray/foray-app/src/java/org/foray/app/PageSequenceResults.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/PageSequenceResults.java 2006-05-24 15:47:46 UTC (rev 7237) +++ trunk/foray/foray-app/src/java/org/foray/app/PageSequenceResults.java 2006-05-24 15:53:10 UTC (rev 7238) @@ -1,67 +0,0 @@ -/* - * 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 - * - */ - -/* $Id$ */ - -package org.foray.app; - -/** - * Class for reporting back formatting results to the calling application. This - * particular class is used to report the results of a single page-sequence. - * - * @author Jeremias Maerki - */ -public class PageSequenceResults { - - private String id; - private int pageCount; - - /** - * Constructor for the PageSequenceResults object - * - * @param id ID of the page-sequence, if available - * @param pageCount The number of resulting pages - */ - public PageSequenceResults(String id, int pageCount) { - this.id = id; - this.pageCount = pageCount; - } - - /** - * Gets the ID of the page-sequence if one was specified. - * - * @return The ID - */ - public String getID() { - return this.id; - } - - /** - * Gets the number of pages that resulted by processing the page-sequence. - * - * @return The number of pages generated - */ - public int getPageCount() { - return this.pageCount; - } -} - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-24 15:47:51
|
Revision: 7237 Author: victormote Date: 2006-05-24 08:47:46 -0700 (Wed, 24 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7237&view=rev Log Message: ----------- Remove unused method. Modified Paths: -------------- trunk/foray/foray-app/src/java/org/foray/app/FOrayDocument.java Modified: trunk/foray/foray-app/src/java/org/foray/app/FOrayDocument.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOrayDocument.java 2006-05-24 15:19:19 UTC (rev 7236) +++ trunk/foray/foray-app/src/java/org/foray/app/FOrayDocument.java 2006-05-24 15:47:46 UTC (rev 7237) @@ -172,19 +172,6 @@ } /** - * Returns the results of the last rendering process. Information includes - * the total number of pages generated and the number of pages per - * page-sequence. - */ - public FormattingResults getResults() { - try { - return currentTarget.getResults(); - } catch (NullPointerException e) { - return null; - } - } - - /** * Returns the tree builder (a SAX ContentHandler). * * Used in situations where SAX is used but not via a FOray-invoked This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-05-24 15:19:34
|
Revision: 7236 Author: victormote Date: 2006-05-24 08:19:19 -0700 (Wed, 24 May 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7236&view=rev Log Message: ----------- Conform to axsl name changes. Modified Paths: -------------- trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java trunk/foray/foray-app/src/java/org/foray/app/FOrayDocument.java trunk/foray/foray-app/src/java/org/foray/app/FOraySession.java trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java trunk/foray/foray-fotree/src/java/org/foray/fotree/FOrayFOTreeServer.java Modified: trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java 2006-05-09 12:47:10 UTC (rev 7235) +++ trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java 2006-05-24 15:19:19 UTC (rev 7236) @@ -29,7 +29,7 @@ import org.foray.output.OutputTarget; import org.foray.pioneer.PioneerLS; -import org.axsl.foR.FOTreeServer; +import org.axsl.foR.FOTreeFactory; import org.axsl.fontR.FontServer; import org.axsl.graphicR.GraphicServer; import org.axsl.text.TextServer; @@ -87,7 +87,7 @@ FontServer fontServer = null; TextServer textServer = null; GraphicServer graphicServer = null; - FOTreeServer foTreeServer = null; + FOTreeFactory foTreeServer = null; FOraySession session = new FOraySession(logger, sessionConfig, fontServer, textServer, graphicServer, foTreeServer); Modified: trunk/foray/foray-app/src/java/org/foray/app/FOrayDocument.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOrayDocument.java 2006-05-09 12:47:10 UTC (rev 7235) +++ trunk/foray/foray-app/src/java/org/foray/app/FOrayDocument.java 2006-05-24 15:19:19 UTC (rev 7236) @@ -97,7 +97,7 @@ private ArrayList targetList = new ArrayList(); /** The FO tree builder, which handles the SAX events. */ - private org.axsl.foR.FOTreeBuilder treeBuilder; + private org.axsl.foR.FOTree treeBuilder; private FOrayTarget currentTarget; @@ -117,7 +117,7 @@ private FOrayDocument(FOraySession session) { this.session = session; session.registerDocument(this); - treeBuilder = this.session.getFOTreeServer().makeTreeBuilder(); + treeBuilder = this.session.getFOTreeServer().makeFOTree(); } /** @@ -331,7 +331,7 @@ return session.getConfiguration(); } - public org.axsl.foR.FOTreeBuilder getFOTreeBuilder() { + public org.axsl.foR.FOTree getFOTreeBuilder() { return this.treeBuilder; } Modified: trunk/foray/foray-app/src/java/org/foray/app/FOraySession.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOraySession.java 2006-05-09 12:47:10 UTC (rev 7235) +++ trunk/foray/foray-app/src/java/org/foray/app/FOraySession.java 2006-05-24 15:19:19 UTC (rev 7236) @@ -30,7 +30,7 @@ import org.foray.fotree.FOrayFOTreeServer; import org.foray.graphic.FOrayGraphicServer; -import org.axsl.foR.FOTreeServer; +import org.axsl.foR.FOTreeFactory; import org.axsl.fontR.FontException; import org.axsl.fontR.FontServer; import org.axsl.graphicR.GraphicServer; @@ -82,7 +82,7 @@ private GraphicServer graphicServer; /** */ - private FOTreeServer foTreeServer; + private FOTreeFactory foTreeServer; /** A SessionConfig instance to be used for this session. */ private SessionConfig configuration; @@ -116,7 +116,7 @@ */ public FOraySession(Log logger, SessionConfig configuration, FontServer fontServer, TextServer textServer, - GraphicServer graphicServer, FOTreeServer foTreeServer) + GraphicServer graphicServer, FOTreeFactory foTreeServer) throws FOrayException { this.log = logger; if (this.log == null) { @@ -276,7 +276,7 @@ } } - public FOTreeServer getFOTreeServer() { + public FOTreeFactory getFOTreeServer() { return this.foTreeServer; } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java 2006-05-09 12:47:10 UTC (rev 7235) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java 2006-05-24 15:19:19 UTC (rev 7236) @@ -52,7 +52,7 @@ * SAX Handler that builds the formatting object tree. */ public class FOTreeBuilder extends DefaultHandler - implements org.axsl.foR.FOTreeBuilder { + implements org.axsl.foR.FOTree { byte[] unsupportedObjectsFO; short[] unsupportedPropertiesFO; Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FOrayFOTreeServer.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/FOrayFOTreeServer.java 2006-05-09 12:47:10 UTC (rev 7235) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FOrayFOTreeServer.java 2006-05-24 15:19:19 UTC (rev 7236) @@ -31,7 +31,7 @@ import org.foray.fotree.svg.NamespaceSVG; import org.foray.fotree.xml.NamespaceXML; -import org.axsl.foR.FOTreeServer; +import org.axsl.foR.FOTreeFactory; import org.axsl.graphicR.GraphicServer; import org.axsl.text.TextServer; @@ -47,7 +47,7 @@ * FOTreeServer encapsulates the FOTree at a high level of abstraction for a * client application. */ -public class FOrayFOTreeServer implements FOTreeServer { +public class FOrayFOTreeServer implements FOTreeFactory { Log logger; GraphicServer graphicServer; @@ -199,7 +199,7 @@ /** * {@inheritDoc} */ - public org.axsl.foR.FOTreeBuilder makeTreeBuilder() { + public org.axsl.foR.FOTree makeFOTree() { FOTreeBuilder foTreeBuilder = new FOTreeBuilder(this, this.getLogger()); foTreeBuilder.setGraphicServer(this.graphicServer); foTreeBuilder.setTextServer(this.textServer); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |