foray-commit Mailing List for FOray (Page 260)
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-06-03 19:27:15
|
Revision: 7386 Author: victormote Date: 2006-06-03 12:26:59 -0700 (Sat, 03 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7386&view=rev Log Message: ----------- Conform to axsl changes: Add methods or parameters to methods that allow the line-breaking system to know whether the TextArea that is being created will be the last item on the line. Modified Paths: -------------- trunk/foray/foray-fotree/src/java/org/foray/fotree/FOText.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ExternalGraphic.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/InstreamForeignObject.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Leader.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageNumber.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageNumberCitation.java Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FOText.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/FOText.java 2006-06-03 19:26:44 UTC (rev 7385) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FOText.java 2006-06-03 19:26:59 UTC (rev 7386) @@ -561,6 +561,10 @@ return getPreviousContiguousTextInBlock(); } + public boolean isLastItemInBlock() { + return this.getNextSibling() == null; + } + /** * @param charArray char array containing character to be converted. * @param index Index into charArray pointing to a char element that is Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ExternalGraphic.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ExternalGraphic.java 2006-06-03 19:26:44 UTC (rev 7385) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ExternalGraphic.java 2006-06-03 19:26:59 UTC (rev 7386) @@ -152,4 +152,8 @@ } } + public boolean isLastItemInBlock() { + return this.getNextSibling() == null; + } + } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/InstreamForeignObject.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/InstreamForeignObject.java 2006-06-03 19:26:44 UTC (rev 7385) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/InstreamForeignObject.java 2006-06-03 19:26:59 UTC (rev 7386) @@ -109,4 +109,8 @@ return ((ForeignXML) getForeignXML()).intrinsicContentHeight(); } + public boolean isLastItemInBlock() { + return this.getNextSibling() == null; + } + } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Leader.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Leader.java 2006-06-03 19:26:44 UTC (rev 7385) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Leader.java 2006-06-03 19:26:59 UTC (rev 7386) @@ -96,4 +96,8 @@ return this; } + public boolean isLastItemInBlock() { + return this.getNextSibling() == null; + } + } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageNumber.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageNumber.java 2006-06-03 19:26:44 UTC (rev 7385) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageNumber.java 2006-06-03 19:26:59 UTC (rev 7386) @@ -70,4 +70,8 @@ return inlineSizeOptimum(lineLength); } + public boolean isLastItemInBlock() { + return this.getNextSibling() == null; + } + } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageNumberCitation.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageNumberCitation.java 2006-06-03 19:26:44 UTC (rev 7385) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageNumberCitation.java 2006-06-03 19:26:59 UTC (rev 7386) @@ -80,4 +80,8 @@ return traitRefId(); } + public boolean isLastItemInBlock() { + return this.getNextSibling() == null; + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-03 19:27:03
|
Revision: 7385 Author: victormote Date: 2006-06-03 12:26:44 -0700 (Sat, 03 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7385&view=rev Log Message: ----------- Conform to axsl changes: Add methods or parameters to methods that allow the line-breaking system to know whether the TextArea that is being created will be the last item on the line. 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-06-03 18:52:48 UTC (rev 7384) +++ trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java 2006-06-03 19:26:44 UTC (rev 7385) @@ -107,7 +107,8 @@ public void handleLineBreakText(LineOutput lineOutput, LineText text, int startOffset, int sizeInChars, int sizeInline, - boolean hasDiscretionaryHyphen, boolean hasFauxSmallCaps) + boolean hasDiscretionaryHyphen, boolean hasFauxSmallCaps, + boolean isLastItemOnLine) throws TextException { checkLayoutTarget(lineOutput, text); LineArea lineArea = (LineArea) lineOutput; @@ -115,7 +116,7 @@ if (text instanceof FOText) { FOText foText = (FOText) text; lineArea.makeTextArea(foText, sizeInline, startOffset, sizeInChars, - hasDiscretionaryHyphen, hasFauxSmallCaps); + hasDiscretionaryHyphen, hasFauxSmallCaps, isLastItemOnLine); } else { throw new TextException("Line-breaking text must be " + "FOText."); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-03 18:53:07
|
Revision: 7384 Author: victormote Date: 2006-06-03 11:52:48 -0700 (Sat, 03 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7384&view=rev Log Message: ----------- Steps toward not creating TextAreas that are empty. Modified Paths: -------------- trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java Modified: trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2006-06-03 18:12:39 UTC (rev 7383) +++ trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2006-06-03 18:52:48 UTC (rev 7384) @@ -812,9 +812,35 @@ return new PageNumberCitationArea(citation, parentArea, ipd); } + /** + * {@inheritDoc} + */ public org.axsl.areaW.TextArea makeTextArea(FOText foText, int ipd, int startOffset, int sizeInChars, boolean hasDiscretionaryHyphen, boolean hasFauxSmallCaps) { + + /* If the raw text is empty, don't create the TextArea. */ + if (sizeInChars < 1) { + return null; + } + + /* If the final text will be empty, don't create the TextArea. */ + char[] rawText = foText.getAreaTreeText(); + boolean isFirstItemOnline = this.children.size() == 0; + int ignoreAtStart = TextArea.ignoreAtStart(rawText, startOffset, + sizeInChars, isFirstItemOnline, traitWhiteSpaceTreatment()); + /* TODO: Add a parameter to this method that tells us whether this is + * the last item on the line. The line-breaking logic should be able + * to tell us this, if it is informed whether the object passed to it + * is the last item in the block. */ + boolean isLastItemOnLine = false; + int ignoreAtEnd = TextArea.ignoreAtEnd(rawText, startOffset, + sizeInChars, isLastItemOnLine, traitWhiteSpaceTreatment()); + if (ignoreAtStart + ignoreAtEnd >= sizeInChars) { + return null; + } + + /* Go ahead and create*/ FObj parent = foText.parentFO(); Area parentArea = findParentArea(foText); if (parent instanceof FObjMixed) { Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java 2006-06-03 18:12:39 UTC (rev 7383) +++ trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java 2006-06-03 18:52:48 UTC (rev 7384) @@ -163,11 +163,13 @@ char[] rawText = getRawText(); // Count of whitespace that should be ignored at start of array. int ignoreAtStart = ignoreAtStart(rawText, this.backingOffset, - this.backingSize); + this.backingSize, this.isFirstChildOfParent(), + traitWhiteSpaceTreatment()); // Count of whitespace that should be ignored at end of array. int ignoreAtEnd = ignoreAtEnd(rawText, this.backingOffset, - this.backingSize); - if (ignoreAtStart + ignoreAtEnd > this.backingSize) { + this.backingSize, this.isLastChildOfParent(), + traitWhiteSpaceTreatment()); + if (ignoreAtStart + ignoreAtEnd >= this.backingSize) { // In case it was all whitespace, which shouldn't happen return new char[0]; } @@ -272,17 +274,18 @@ return 0; } - public int ignoreAtStart(char[] chars, int start, int size) { + public static int ignoreAtStart(char[] chars, int start, int size, + boolean firstItemOnLine, short whiteSpaceTreatment) { // Only eat leading whitespaces if this is the first item on the line. - if (! this.isFirstChildOfParent()) { + if (! firstItemOnLine) { return 0; } - short wst = traitWhiteSpaceTreatment(); - if (wst == Constants.FOVAL_IGNORE || wst == Constants.FOVAL_PRESERVE) { + if (whiteSpaceTreatment == Constants.FOVAL_IGNORE + || whiteSpaceTreatment == Constants.FOVAL_PRESERVE) { // These situations were totally handled in FOTree return 0; } - if (wst == Constants.FOVAL_IGNORE_IF_BEFORE_LINEFEED) { + if (whiteSpaceTreatment == Constants.FOVAL_IGNORE_IF_BEFORE_LINEFEED) { // Handled in ignoreAtEnd(); return 0; } @@ -301,17 +304,18 @@ return count; } - public int ignoreAtEnd(char[] chars, int start, int size) { + public static int ignoreAtEnd(char[] chars, int start, int size, + boolean lastItemOnLine, short whiteSpaceTreatment) { // Only eat trailing whitespaces if this is the last item on the line. - if (! this.isLastChildOfParent()) { + if (! lastItemOnLine) { return 0; } - short wst = traitWhiteSpaceTreatment(); - if (wst == Constants.FOVAL_IGNORE || wst == Constants.FOVAL_PRESERVE) { + if (whiteSpaceTreatment == Constants.FOVAL_IGNORE + || whiteSpaceTreatment == Constants.FOVAL_PRESERVE) { // These situations were totally handled in FOTree return 0; } - if (wst == Constants.FOVAL_IGNORE_IF_AFTER_LINEFEED) { + if (whiteSpaceTreatment == Constants.FOVAL_IGNORE_IF_AFTER_LINEFEED) { // Handled in ignoreAtStart(); return 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-03 18:12:43
|
Revision: 7383 Author: victormote Date: 2006-06-03 11:12:39 -0700 (Sat, 03 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7383&view=rev Log Message: ----------- Add content and attributes for external-graphic. Modified Paths: -------------- trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java 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-06-03 17:59:52 UTC (rev 7382) +++ trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java 2006-06-03 18:12:39 UTC (rev 7383) @@ -388,7 +388,14 @@ * @param area the area to render */ public void render(ExternalGraphicArea area) { - writeEmptyElement(area, null); + StringBuffer attributes = new StringBuffer(); + outputGeneratedBy(area, attributes); + outputDimension(area, attributes); + outputAttribute(attributes, "url", + area.getGraphic().getURL().toExternalForm()); + writeStartTag(area, attributes); + outputAllRectangles(area); + writeEndTag(area); } protected void createBasicLink(BasicLinkArea area) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-03 17:59:57
|
Revision: 7382 Author: victormote Date: 2006-06-03 10:59:52 -0700 (Sat, 03 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7382&view=rev Log Message: ----------- Skip the before-float and footnote areas if they are null or empty. Modified Paths: -------------- trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java 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-06-03 17:40:58 UTC (rev 7381) +++ trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java 2006-06-03 17:59:52 UTC (rev 7382) @@ -268,6 +268,10 @@ * @param area the body area container to render */ public void render(FootnoteArea area) { + if (area == null + || area.getChildren().size() < 1) { + return; + } StringBuffer buffer = new StringBuffer(); outputGeneratedBy(area, buffer); writeStartTag(area, buffer); @@ -282,6 +286,10 @@ * @param area the body area container to render */ public void render(BeforeFloatArea area) { + if (area == null + || area.getChildren().size() < 1) { + return; + } StringBuffer buffer = new StringBuffer(); outputGeneratedBy(area, buffer); writeStartTag(area, buffer); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-03 17:41:04
|
Revision: 7381 Author: victormote Date: 2006-06-03 10:40:58 -0700 (Sat, 03 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7381&view=rev Log Message: ----------- Conform to axsl changes: Remove obsolete area types and renumber remaining ones. Modified Paths: -------------- trunk/foray/foray-render/src/java/org/foray/render/Renderer.java Modified: trunk/foray/foray-render/src/java/org/foray/render/Renderer.java =================================================================== --- trunk/foray/foray-render/src/java/org/foray/render/Renderer.java 2006-06-03 17:34:08 UTC (rev 7380) +++ trunk/foray/foray-render/src/java/org/foray/render/Renderer.java 2006-06-03 17:40:58 UTC (rev 7381) @@ -577,11 +577,6 @@ render((RegionBodyArea) atNode); return; } - case ConstantsAreaTree.AREATYPE_DISPLAY_SPACE: { - // This node type has been deleted. - render(atNode); - return; - } case ConstantsAreaTree.AREATYPE_LINE: { render((LineArea) atNode); return; @@ -594,10 +589,6 @@ render((SVGArea) atNode); return; } - case ConstantsAreaTree.AREATYPE_INLINE_SPACE: { - render(atNode); - return; - } case ConstantsAreaTree.AREATYPE_LEADER: { render((LeaderArea) atNode); return; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-03 17:34:18
|
Revision: 7380 Author: victormote Date: 2006-06-03 10:34:08 -0700 (Sat, 03 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7380&view=rev Log Message: ----------- Add render methods for the main, before-float, and footnote areas. Modified Paths: -------------- trunk/foray/foray-render/src/java/org/foray/render/Renderer.java trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java Modified: trunk/foray/foray-render/src/java/org/foray/render/Renderer.java =================================================================== --- trunk/foray/foray-render/src/java/org/foray/render/Renderer.java 2006-06-03 17:28:08 UTC (rev 7379) +++ trunk/foray/foray-render/src/java/org/foray/render/Renderer.java 2006-06-03 17:34:08 UTC (rev 7380) @@ -29,7 +29,6 @@ package org.foray.render; -import org.axsl.areaR.AreaRException; import org.foray.common.MUserAgent; import org.foray.common.SVGUserAgent; import org.foray.output.OutputConfig; @@ -37,16 +36,20 @@ import org.axsl.areaR.Area; import org.axsl.areaR.AreaNode; +import org.axsl.areaR.AreaRException; import org.axsl.areaR.AreaTree; import org.axsl.areaR.BasicLinkArea; +import org.axsl.areaR.BeforeFloatArea; import org.axsl.areaR.BlockContainerArea; import org.axsl.areaR.BookmarkTreeArea; import org.axsl.areaR.ExternalGraphicArea; +import org.axsl.areaR.FootnoteArea; import org.axsl.areaR.ForeignObjectArea; import org.axsl.areaR.GeneralInlineArea; import org.axsl.areaR.InlineArea; import org.axsl.areaR.LeaderArea; import org.axsl.areaR.LineArea; +import org.axsl.areaR.MainReferenceArea; import org.axsl.areaR.NormalBlockArea; import org.axsl.areaR.NormalFlowArea; import org.axsl.areaR.PageArea; @@ -496,6 +499,18 @@ protected abstract void render(BookmarkTreeArea area); + protected void render(FootnoteArea area) { + renderChildren(area); + } + + protected void render(BeforeFloatArea area) { + renderChildren(area); + } + + protected void render(MainReferenceArea area) { + renderChildren(area); + } + protected void render(PageNumberCitationArea area) { renderTextSegment(area, area.resolve().toCharArray()); } @@ -568,8 +583,7 @@ return; } case ConstantsAreaTree.AREATYPE_LINE: { - LineArea la = (LineArea) atNode; - render(la); + render((LineArea) atNode); return; } case ConstantsAreaTree.AREATYPE_IMAGE: { @@ -598,15 +612,15 @@ return; } case ConstantsAreaTree.AREATYPE_FOOTNOTE_RA: { - render(atNode); + render((FootnoteArea) atNode); return; } case ConstantsAreaTree.AREATYPE_BEFORE_FLOAT_RA: { - render(atNode); + render((BeforeFloatArea) atNode); return; } case ConstantsAreaTree.AREATYPE_MAIN_RA: { - render(atNode); + render((MainReferenceArea) atNode); return; } case ConstantsAreaTree.AREATYPE_SPAN_RA: { 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-06-03 17:28:08 UTC (rev 7379) +++ trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java 2006-06-03 17:34:08 UTC (rev 7380) @@ -35,7 +35,9 @@ import org.axsl.areaR.Area; import org.axsl.areaR.AreaFlexible; +import org.axsl.areaR.AreaNode; import org.axsl.areaR.BasicLinkArea; +import org.axsl.areaR.BeforeFloatArea; import org.axsl.areaR.BlockContainerArea; import org.axsl.areaR.BookmarkTreeArea; import org.axsl.areaR.ExternalGraphicArea; @@ -45,6 +47,7 @@ import org.axsl.areaR.InlineArea; import org.axsl.areaR.LeaderArea; import org.axsl.areaR.LineArea; +import org.axsl.areaR.MainReferenceArea; import org.axsl.areaR.NormalBlockArea; import org.axsl.areaR.NormalFlowArea; import org.axsl.areaR.PageArea; @@ -176,26 +179,28 @@ /** * Write the start tag, attribues, and end-tag for an element. - * @param area The area for whom element is written. + * @param node The area for whom element is written. * @param attributes Text of the attributes to be written. */ - protected void writeStartTag(Area area, StringBuffer attributes) { + protected void writeStartTag(AreaNode node, StringBuffer attributes) { writeIndent(); this.indent++; this.writer.write("<"); - this.writer.write(area.getAreaName()); - this.writer.write(attributes.toString()); + this.writer.write(node.getAreaName()); + if (attributes != null) { + this.writer.write(attributes.toString()); + } this.writer.write(">\n"); } /** * Write an end tag. - * @param area The area whose end-tag should be written. + * @param node The area whose end-tag should be written. */ - protected void writeEndTag(Area area) { + protected void writeEndTag(AreaNode node) { this.indent--; writeIndent(); - this.writer.write("</" + area.getAreaName() + ">\n"); + this.writer.write("</" + node.getAreaName() + ">\n"); } /** @@ -234,6 +239,15 @@ writeEndTag(area); } + public void render(MainReferenceArea area) { + StringBuffer buffer = new StringBuffer(); + outputGeneratedBy(area, buffer); + writeStartTag(area, buffer); + outputAllRectangles(area); + renderChildren(area); + writeEndTag(area); + } + /** * render a body area container to XML * @@ -263,6 +277,20 @@ } /** + * render a body area container to XML + * + * @param area the body area container to render + */ + public void render(BeforeFloatArea area) { + StringBuffer buffer = new StringBuffer(); + outputGeneratedBy(area, buffer); + writeStartTag(area, buffer); + outputAllRectangles(area); + renderChildren(area); + writeEndTag(area); + } + + /** * render a region area container to XML * * @param area the region area container to render @@ -518,6 +546,12 @@ writeEndTag(area); } + protected void render(AreaNode node) { + writeStartTag(node, null); + renderChildren(node); + writeEndTag(node); + } + private boolean isCoarseXml() { if (options == null) { return false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-03 17:28:15
|
Revision: 7379 Author: victormote Date: 2006-06-03 10:28:08 -0700 (Sat, 03 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7379&view=rev Log Message: ----------- Implement new axsl areaR interface. Modified Paths: -------------- trunk/foray/foray-areatree/src/java/org/foray/area/BeforeFloatRA.java Modified: trunk/foray/foray-areatree/src/java/org/foray/area/BeforeFloatRA.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/BeforeFloatRA.java 2006-06-03 16:37:08 UTC (rev 7378) +++ trunk/foray/foray-areatree/src/java/org/foray/area/BeforeFloatRA.java 2006-06-03 17:28:08 UTC (rev 7379) @@ -33,7 +33,8 @@ * instance of RegionRABody. */ public class BeforeFloatRA extends AreaFixed - implements org.axsl.areaW.BeforeFloatRA { + implements org.axsl.areaR.BeforeFloatArea, + org.axsl.areaW.BeforeFloatRA { public BeforeFloatRA(FObj generatedBy, RegionRABody parentArea) { super(generatedBy, parentArea); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-03 16:37:14
|
Revision: 7378 Author: victormote Date: 2006-06-03 09:37:08 -0700 (Sat, 03 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7378&view=rev Log Message: ----------- Conform to changes in axsl-area-tree DTD: Put all location information into a separate element to make the output more readable. Modified Paths: -------------- trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java 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-06-03 01:38:07 UTC (rev 7377) +++ trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java 2006-06-03 16:37:08 UTC (rev 7378) @@ -101,7 +101,6 @@ RegionArea end = page.getRegionEnd(); StringBuffer buffer = new StringBuffer(); outputAttribute(buffer, "number", page.getFormattedNumber()); - outputAllRectangles(page, buffer); this.writeStartTag(page, buffer); if (before != null) { this.render(before); @@ -156,9 +155,19 @@ * @param attributes Text of the attributes to be written. */ protected void writeEmptyElement(Area area, StringBuffer attributes) { + this.writeEmptyElement(area.getAreaName(), attributes); + } + + /** + * Write the start tag, attribues, and end-tag for an element. + * @param elementName The name of the element to be written. + * @param attributes Text of the attributes to be written. + */ + protected void writeEmptyElement(String elementName, + StringBuffer attributes) { writeIndent(); this.writer.write("<"); - this.writer.write(area.getAreaName()); + this.writer.write(elementName); if (attributes != null) { this.writer.write(attributes.toString()); } @@ -205,8 +214,8 @@ public void render(BlockContainerArea area) { StringBuffer buffer = new StringBuffer(); outputGeneratedBy(area, buffer); - outputAllRectangles(area, buffer); writeStartTag(area, buffer); + outputAllRectangles(area); renderChildren(area); writeEndTag(area); } @@ -219,8 +228,8 @@ public void render(RegionBodyArea area) { StringBuffer buffer = new StringBuffer(); outputGeneratedBy(area, buffer); - outputAllRectangles(area, buffer); writeStartTag(area, buffer); + outputAllRectangles(area); renderChildren(area); writeEndTag(area); } @@ -233,8 +242,8 @@ public void render(RegionArea area) { StringBuffer buffer = new StringBuffer(); outputGeneratedBy(area, buffer); - outputAllRectangles(area, buffer); writeStartTag(area, buffer); + outputAllRectangles(area); renderChildren(area); writeEndTag(area); } @@ -247,8 +256,8 @@ public void render(FootnoteArea area) { StringBuffer buffer = new StringBuffer(); outputGeneratedBy(area, buffer); - outputAllRectangles(area, buffer); writeStartTag(area, buffer); + outputAllRectangles(area); renderChildren(area); writeEndTag(area); } @@ -270,8 +279,8 @@ public void render(SpanArea area) { StringBuffer buffer = new StringBuffer(); outputGeneratedBy(area, buffer); - outputAllRectangles(area, buffer); writeStartTag(area, buffer); + outputAllRectangles(area); renderChildren(area); writeEndTag(area); } @@ -279,8 +288,8 @@ public void render(NormalFlowArea area) { StringBuffer buffer = new StringBuffer(); outputGeneratedBy(area, buffer); - outputAllRectangles(area, buffer); writeStartTag(area, buffer); + outputAllRectangles(area); renderChildren(area); writeEndTag(area); } @@ -293,11 +302,11 @@ public void render(NormalBlockArea area) { StringBuffer buffer = new StringBuffer(); outputGeneratedBy(area, buffer); - outputAllRectangles(area, buffer); outputDimension(area, buffer); outputAttribute(buffer, "start-indent", area.traitStartIndent()); outputAttribute(buffer, "end-indent", area.traitEndIndent()); writeStartTag(area, buffer); + outputAllRectangles(area); renderChildren(area); writeEndTag(area); } @@ -316,9 +325,9 @@ public void render(ForeignObjectArea area) { StringBuffer buffer = new StringBuffer(); outputGeneratedBy(area, buffer); - outputAllRectangles(area, buffer); outputDimension(area, buffer); writeStartTag(area, buffer); + outputAllRectangles(area); renderChildren(area); writeEndTag(area); } @@ -331,9 +340,10 @@ public void render(SVGArea area) { StringBuffer buffer = new StringBuffer(); outputGeneratedBy(area, buffer); - outputAllRectangles(area, buffer); outputDimension(area, buffer); - writeEmptyElement(area, buffer); + writeStartTag(area, buffer); + outputAllRectangles(area); + writeEndTag(area); } /** @@ -363,10 +373,10 @@ } StringBuffer buffer = new StringBuffer(); outputGeneratedBy(area, buffer); - outputAllRectangles(area, buffer); outputDimension(area, buffer); outputFontTraits(area, buffer); writeStartTag(area, buffer); + outputAllRectangles(area); renderChildren(area); writeEndTag(area); } @@ -386,7 +396,6 @@ } StringBuffer buffer = new StringBuffer(); outputGeneratedBy(area, buffer); - outputAllRectangles(area, buffer); outputAttribute(buffer, "leader-pattern", Constants.expandPropertyConstant(area.traitLeaderPattern())); outputAttribute(buffer, "leader-length", @@ -394,36 +403,47 @@ outputAttribute(buffer, "rule-thickness", area.traitRuleThickness()); outputAttribute(buffer, "rule-style", area.traitRuleStyle()); outputColor(area, buffer); - writeEmptyElement(area, buffer); + writeStartTag(area, buffer); + outputAllRectangles(area); + writeEndTag(area); } public void render(TextArea area) { StringBuffer buffer = new StringBuffer(); outputGeneratedBy(area, buffer); - outputAllRectangles(area, buffer); outputDimension(area, buffer); + writeStartTag(area, buffer); + outputAllRectangles(area); char[] rawText = area.getText(); char[] cookedText = XMLCharacter.expandEntityReferences(rawText); String content = new String(cookedText); - writeCompleteElement(area, buffer, content); + renderContent(content); + writeEndTag(area); } + protected void renderContent(String content) { + writeIndent(); + this.writer.write("<content>"); + this.writer.write(content); + this.writer.write("</content>\n"); + } + protected void render(PageNumberCitationArea area) { StringBuffer buffer = new StringBuffer(); outputGeneratedBy(area, buffer); - outputAllRectangles(area, buffer); outputDimension(area, buffer); writeStartTag(area, buffer); - this.writer.write(area.resolve()); + outputAllRectangles(area); + renderContent(area.resolve()); writeEndTag(area); } protected void render(BasicLinkArea area) { StringBuffer buffer = new StringBuffer(); outputGeneratedBy(area, buffer); - outputAllRectangles(area, buffer); outputDimension(area, buffer); writeStartTag(area, buffer); + outputAllRectangles(area); renderChildren(area); writeEndTag(area); } @@ -431,9 +451,9 @@ protected void render(InlineArea area) { StringBuffer buffer = new StringBuffer(); outputGeneratedBy(area, buffer); - outputAllRectangles(area, buffer); outputDimension(area, buffer); writeStartTag(area, buffer); + outputAllRectangles(area); renderChildren(area); writeEndTag(area); } @@ -441,9 +461,9 @@ protected void render(TableArea area) { StringBuffer buffer = new StringBuffer(); outputGeneratedBy(area, buffer); - outputAllRectangles(area, buffer); outputDimension(area, buffer); writeStartTag(area, buffer); + outputAllRectangles(area); renderChildren(area); writeEndTag(area); } @@ -451,9 +471,9 @@ protected void render(TableHeaderContainer area) { StringBuffer buffer = new StringBuffer(); outputGeneratedBy(area, buffer); - outputAllRectangles(area, buffer); outputDimension(area, buffer); writeStartTag(area, buffer); + outputAllRectangles(area); renderChildren(area); writeEndTag(area); } @@ -461,9 +481,9 @@ protected void render(TableFooterContainer area) { StringBuffer buffer = new StringBuffer(); outputGeneratedBy(area, buffer); - outputAllRectangles(area, buffer); outputDimension(area, buffer); writeStartTag(area, buffer); + outputAllRectangles(area); renderChildren(area); writeEndTag(area); } @@ -471,9 +491,9 @@ protected void render(TableBodyContainer area) { StringBuffer buffer = new StringBuffer(); outputGeneratedBy(area, buffer); - outputAllRectangles(area, buffer); outputDimension(area, buffer); writeStartTag(area, buffer); + outputAllRectangles(area); renderChildren(area); writeEndTag(area); } @@ -481,9 +501,9 @@ protected void render(TableRowContainer area) { StringBuffer buffer = new StringBuffer(); outputGeneratedBy(area, buffer); - outputAllRectangles(area, buffer); outputDimension(area, buffer); writeStartTag(area, buffer); + outputAllRectangles(area); renderChildren(area); writeEndTag(area); } @@ -491,9 +511,9 @@ protected void render(TableCellArea area) { StringBuffer buffer = new StringBuffer(); outputGeneratedBy(area, buffer); - outputAllRectangles(area, buffer); outputDimension(area, buffer); writeStartTag(area, buffer); + outputAllRectangles(area); renderChildren(area); writeEndTag(area); } @@ -583,11 +603,13 @@ + idString); } - public void outputAllRectangles(Area area, StringBuffer buffer) { + public void outputAllRectangles(Area area) { + StringBuffer buffer = new StringBuffer(); outputBorderRectangleOrigin(area, buffer); outputPaddingRectangleOrigin(area, buffer); outputContentRectangleOrigin(area, buffer); outputRenderRectangleOrigin(area, buffer); + this.writeEmptyElement("location", buffer); } public void outputBorderRectangleOrigin(Area area, StringBuffer buffer) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-03 02:41:42
|
Revision: 7377 Author: victormote Date: 2006-06-02 18:38:07 -0700 (Fri, 02 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7377&view=rev Log Message: ----------- Use new axsl interfaces to clarify area construction and use, especially for tables and lists. Modified Paths: -------------- trunk/foray/foray-areatree/src/java/org/foray/area/AbstractNormalBlockArea.java trunk/foray/foray-areatree/src/java/org/foray/area/TableRA.java Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AbstractNormalBlockArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/AbstractNormalBlockArea.java 2006-06-03 01:26:39 UTC (rev 7376) +++ trunk/foray/foray-areatree/src/java/org/foray/area/AbstractNormalBlockArea.java 2006-06-03 01:38:07 UTC (rev 7377) @@ -31,7 +31,9 @@ * including {@link NormalBlockArea}, {@link TableRA}. * */ -public abstract class AbstractNormalBlockArea extends BlockArea { +public abstract class AbstractNormalBlockArea extends BlockArea + implements org.axsl.areaR.AbstractNormalBlockArea, + org.axsl.areaW.AbstractNormalBlockArea { public AbstractNormalBlockArea(FObj parentFObj, Area parentArea) { super(parentFObj, parentArea); Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TableRA.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/TableRA.java 2006-06-03 01:26:39 UTC (rev 7376) +++ trunk/foray/foray-areatree/src/java/org/foray/area/TableRA.java 2006-06-03 01:38:07 UTC (rev 7377) @@ -35,7 +35,7 @@ import org.axsl.foR.fo.TableFooter; import org.axsl.foR.fo.TableHeader; -public class TableRA extends NormalBlockArea implements TableArea, +public class TableRA extends AbstractNormalBlockArea implements TableArea, org.axsl.areaW.TableArea { private int[] resolvedColumnWidth = null; @@ -132,4 +132,16 @@ return new org.foray.area.TableFooterContainer(tableFooter, this); } + /** + * {@inheritDoc} + */ + public String getAreaName() { + return "table"; + } + + public Area getOverflowArea(Area area) { + /* TODO: Implement this. */ + return null; + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-03 01:26:44
|
Revision: 7376 Author: victormote Date: 2006-06-02 18:26:39 -0700 (Fri, 02 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7376&view=rev Log Message: ----------- Add super-class for all normal-block areas. Added Paths: ----------- trunk/foray/foray-areatree/src/java/org/foray/area/AbstractNormalBlockArea.java Added: trunk/foray/foray-areatree/src/java/org/foray/area/AbstractNormalBlockArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/AbstractNormalBlockArea.java (rev 0) +++ trunk/foray/foray-areatree/src/java/org/foray/area/AbstractNormalBlockArea.java 2006-06-03 01:26:39 UTC (rev 7376) @@ -0,0 +1,40 @@ +/* + * 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.area; + +import org.axsl.foR.FObj; + +/** + * Abstract superclass for all of the areas that are normal-block areas, + * including {@link NormalBlockArea}, {@link TableRA}. + * + */ +public abstract class AbstractNormalBlockArea extends BlockArea { + + public AbstractNormalBlockArea(FObj parentFObj, Area parentArea) { + super(parentFObj, parentArea); + } + +} Property changes on: trunk/foray/foray-areatree/src/java/org/foray/area/AbstractNormalBlockArea.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-06-03 01:23:23
|
Revision: 7375 Author: victormote Date: 2006-06-02 18:23:12 -0700 (Fri, 02 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7375&view=rev Log Message: ----------- Clean up indentation and content location issues. Modified Paths: -------------- trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java 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-06-03 01:12:50 UTC (rev 7374) +++ trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java 2006-06-03 01:23:12 UTC (rev 7375) @@ -79,9 +79,10 @@ public static final String DOUBLE_QUOTE = "\""; /** - * indentation to use for pretty-printing the XML + * Indentation to use for pretty-printing the XML. (Starts at 1 because + * the root element does not get written through the normal methods). */ - protected int indent = 0; + protected int indent = 1; /** * the writer used to output the XML @@ -136,6 +137,24 @@ * @param area The area for whom element is written. * @param attributes Text of the attributes to be written. */ + protected void writeCompleteElement(Area area, StringBuffer attributes, + String content) { + writeIndent(); + this.writer.write("<"); + this.writer.write(area.getAreaName()); + if (attributes != null) { + this.writer.write(attributes.toString()); + } + this.writer.write(">"); + this.writer.write(content); + this.writer.write("</" + area.getAreaName() + ">\n"); + } + + /** + * Write the start tag, attribues, and end-tag for an element. + * @param area The area for whom element is written. + * @param attributes Text of the attributes to be written. + */ protected void writeEmptyElement(Area area, StringBuffer attributes) { writeIndent(); this.writer.write("<"); @@ -383,11 +402,10 @@ outputGeneratedBy(area, buffer); outputAllRectangles(area, buffer); outputDimension(area, buffer); - writeStartTag(area, buffer); char[] rawText = area.getText(); char[] cookedText = XMLCharacter.expandEntityReferences(rawText); - this.writer.write(cookedText); - writeEndTag(area); + String content = new String(cookedText); + writeCompleteElement(area, buffer, content); } protected void render(PageNumberCitationArea area) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-03 01:12:55
|
Revision: 7374 Author: victormote Date: 2006-06-02 18:12:50 -0700 (Fri, 02 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7374&view=rev Log Message: ----------- Move list-block validation code from layout to fotree. Modified Paths: -------------- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/ListBlockPL.java Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/ListBlockPL.java =================================================================== --- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/ListBlockPL.java 2006-06-03 01:12:42 UTC (rev 7373) +++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/ListBlockPL.java 2006-06-03 01:12:50 UTC (rev 7374) @@ -59,11 +59,6 @@ int numChildren = node.childrenFO().size(); for (int i = listBlockPL.getProgress(); i < numChildren; i++) { - if (!(node.childrenFO().get(i) instanceof ListItem)) { - layout.getLogger().error("children of list-blocks must be " - + "list-items"); - return Status.OK; - } ListItem listItem = (ListItem)node.childrenFO().get(i); ListItemPL listItemPL = (ListItemPL) getLayoutProxy(listItem); int status = listItemPL.layout(blockArea); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-03 01:12:47
|
Revision: 7373 Author: victormote Date: 2006-06-02 18:12:42 -0700 (Fri, 02 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7373&view=rev Log Message: ----------- Move list-block validation code from layout to fotree. Modified Paths: -------------- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ListBlock.java Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ListBlock.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ListBlock.java 2006-06-03 01:00:33 UTC (rev 7372) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ListBlock.java 2006-06-03 01:12:42 UTC (rev 7373) @@ -54,4 +54,17 @@ return true; } + public void end() throws FOTreeException { + if (this.getChildCount() < 1) { + this.throwException("fo:list-block must have at least one child."); + } + for (int i = 0; i < this.getChildren().size(); i++) { + FObj fobj = (FObj) this.getChildAt(i); + if (! (fobj instanceof ListItem)) { + this.throwException("Child of fo:list-block must be " + + "fo:list-item", fobj.getContextMessage()); + } + } + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-03 01:00:37
|
Revision: 7372 Author: victormote Date: 2006-06-02 18:00:33 -0700 (Fri, 02 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7372&view=rev Log Message: ----------- Use new axsl interfaces to clarify area construction and use, especially for tables and lists. Modified Paths: -------------- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/ListBlockPL.java Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/ListBlockPL.java =================================================================== --- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/ListBlockPL.java 2006-06-03 01:00:19 UTC (rev 7371) +++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/ListBlockPL.java 2006-06-03 01:00:33 UTC (rev 7372) @@ -72,13 +72,11 @@ status = Status.AREA_FULL_SOME; } listBlockPL.setProgress(i); - layout.completeCurrentLineInBlock(blockArea); area.incrementProgressionDimension(blockArea.crBPD()); return status; } } - layout.completeCurrentLineInBlock(blockArea); area.incrementProgressionDimension(blockArea.crBPD()); return Status.OK; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-03 01:00:30
|
Revision: 7371 Author: victormote Date: 2006-06-02 18:00:19 -0700 (Fri, 02 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7371&view=rev Log Message: ----------- Use new axsl interfaces to clarify area construction and use, especially for tables and lists. Modified Paths: -------------- trunk/foray/foray-areatree/src/java/org/foray/area/GenericContainer.java trunk/foray/foray-areatree/src/java/org/foray/area/ListBlockArea.java trunk/foray/foray-areatree/src/java/org/foray/area/NormalBlockArea.java trunk/foray/foray-areatree/src/java/org/foray/area/TableBodyContainer.java trunk/foray/foray-areatree/src/java/org/foray/area/TableFooterContainer.java trunk/foray/foray-areatree/src/java/org/foray/area/TableHeaderContainer.java Modified: trunk/foray/foray-areatree/src/java/org/foray/area/GenericContainer.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/GenericContainer.java 2006-06-03 00:18:30 UTC (rev 7370) +++ trunk/foray/foray-areatree/src/java/org/foray/area/GenericContainer.java 2006-06-03 01:00:19 UTC (rev 7371) @@ -27,7 +27,7 @@ import org.axsl.common.ConstantsAreaTree; import org.axsl.foR.FObj; -public class GenericContainer extends ContainerRA +public abstract class GenericContainer extends ContainerRA implements org.axsl.areaW.GenericContainer { int xPosition = 0; @@ -57,11 +57,4 @@ return ConstantsAreaTree.AREATYPE_GENERIC_CONTAINER; } - /** - * {@inheritDoc} - */ - public String getAreaName() { - return "generic-container"; - } - } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/ListBlockArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/ListBlockArea.java 2006-06-03 00:18:30 UTC (rev 7370) +++ trunk/foray/foray-areatree/src/java/org/foray/area/ListBlockArea.java 2006-06-03 01:00:19 UTC (rev 7371) @@ -24,11 +24,12 @@ package org.foray.area; +import org.axsl.common.ConstantsAreaTree; import org.axsl.foR.fo.ListBlock; import org.axsl.foR.fo.ListItem; -public class ListBlockArea extends NormalBlockArea - implements org.axsl.areaW.ListBlockArea { +public class ListBlockArea extends AbstractNormalBlockArea + implements org.axsl.areaR.ListBlockArea, org.axsl.areaW.ListBlockArea { public ListBlockArea(ListBlock parentFObj, Area parentArea) { super(parentFObj, parentArea); @@ -38,4 +39,20 @@ return new ListItemArea(listItem, this); } + public byte getAreaType() { + return ConstantsAreaTree.AREATYPE_LIST_BLOCK; + } + + /** + * {@inheritDoc} + */ + public String getAreaName() { + return "list-block"; + } + + public Area getOverflowArea(Area area) { + /* TODO: Implement this. */ + return null; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/NormalBlockArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/NormalBlockArea.java 2006-06-03 00:18:30 UTC (rev 7370) +++ trunk/foray/foray-areatree/src/java/org/foray/area/NormalBlockArea.java 2006-06-03 01:00:19 UTC (rev 7371) @@ -42,9 +42,9 @@ * This uses the line-height and line-stacking-strategy to work * out how to stack the lines. */ -public class NormalBlockArea extends BlockArea +public class NormalBlockArea extends AbstractNormalBlockArea implements org.axsl.areaR.NormalBlockArea, - org.axsl.areaW.NormalBlockArea { + org.axsl.areaW.NormalBlockArea{ public NormalBlockArea(FObj parentFObj, Area parentArea) { super(parentFObj, parentArea); Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TableBodyContainer.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/TableBodyContainer.java 2006-06-03 00:18:30 UTC (rev 7370) +++ trunk/foray/foray-areatree/src/java/org/foray/area/TableBodyContainer.java 2006-06-03 01:00:19 UTC (rev 7371) @@ -55,4 +55,11 @@ return ConstantsAreaTree.AREATYPE_TABLE_BODY_RA; } + /** + * {@inheritDoc} + */ + public String getAreaName() { + return "table-body"; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TableFooterContainer.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/TableFooterContainer.java 2006-06-03 00:18:30 UTC (rev 7370) +++ trunk/foray/foray-areatree/src/java/org/foray/area/TableFooterContainer.java 2006-06-03 01:00:19 UTC (rev 7371) @@ -55,4 +55,11 @@ return ConstantsAreaTree.AREATYPE_TABLE_FOOTER_RA; } + /** + * {@inheritDoc} + */ + public String getAreaName() { + return "table-footer"; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TableHeaderContainer.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/TableHeaderContainer.java 2006-06-03 00:18:30 UTC (rev 7370) +++ trunk/foray/foray-areatree/src/java/org/foray/area/TableHeaderContainer.java 2006-06-03 01:00:19 UTC (rev 7371) @@ -55,4 +55,11 @@ return ConstantsAreaTree.AREATYPE_TABLE_HEADER_RA; } + /** + * {@inheritDoc} + */ + public String getAreaName() { + return "table-header"; + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-03 00:18:35
|
Revision: 7370 Author: victormote Date: 2006-06-02 17:18:30 -0700 (Fri, 02 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7370&view=rev Log Message: ----------- Normalize the output for the remaining elements. Modified Paths: -------------- trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java 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-06-03 00:16:03 UTC (rev 7369) +++ trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java 2006-06-03 00:18:30 UTC (rev 7370) @@ -39,6 +39,7 @@ import org.axsl.areaR.BlockContainerArea; import org.axsl.areaR.BookmarkTreeArea; import org.axsl.areaR.ExternalGraphicArea; +import org.axsl.areaR.FootnoteArea; import org.axsl.areaR.ForeignObjectArea; import org.axsl.areaR.GeneralInlineArea; import org.axsl.areaR.InlineArea; @@ -98,11 +99,9 @@ RegionArea start = page.getRegionStart(); RegionArea end = page.getRegionEnd(); StringBuffer buffer = new StringBuffer(); - buffer.append("<page"); outputAttribute(buffer, "number", page.getFormattedNumber()); - this.outputAllRectangles(page, buffer); - buffer.append(">"); - this.writeStartTag(buffer.toString()); + outputAllRectangles(page, buffer); + this.writeStartTag(page, buffer); if (before != null) { this.render(before); } @@ -154,6 +153,7 @@ */ protected void writeStartTag(Area area, StringBuffer attributes) { writeIndent(); + this.indent++; this.writer.write("<"); this.writer.write(area.getAreaName()); this.writer.write(attributes.toString()); @@ -162,31 +162,12 @@ /** * Write an end tag. - * @param tag The text of the tag, for example, "</tag>". - */ - protected void writeEndTag(String tag) { - this.indent--; - writeIndent(); - this.writer.write(tag + "\n"); - } - - /** - * Write an end tag. * @param area The area whose end-tag should be written. */ protected void writeEndTag(Area area) { - writeEndTag("</" + area.getAreaName() + ">"); - } - - /** - * write out a start tag - * - * @param tag the text of the tag - */ - protected void writeStartTag(String tag) { + this.indent--; writeIndent(); - this.writer.write(tag + "\n"); - this.indent++; + this.writer.write("</" + area.getAreaName() + ">\n"); } /** @@ -204,13 +185,11 @@ */ public void render(BlockContainerArea area) { StringBuffer buffer = new StringBuffer(); - buffer.append("<AreaContainer"); outputGeneratedBy(area, buffer); outputAllRectangles(area, buffer); - buffer.append(">"); - writeStartTag(buffer.toString()); + writeStartTag(area, buffer); renderChildren(area); - writeEndTag("</AreaContainer>"); + writeEndTag(area); } /** @@ -220,16 +199,42 @@ */ public void render(RegionBodyArea area) { StringBuffer buffer = new StringBuffer(); - buffer.append("<BodyAreaContainer"); outputGeneratedBy(area, buffer); outputAllRectangles(area, buffer); - buffer.append(">"); - writeStartTag(buffer.toString()); + writeStartTag(area, buffer); renderChildren(area); - writeEndTag("</BodyAreaContainer>"); + writeEndTag(area); } /** + * render a body area container to XML + * + * @param area the body area container to render + */ + public void render(RegionArea area) { + StringBuffer buffer = new StringBuffer(); + outputGeneratedBy(area, buffer); + outputAllRectangles(area, buffer); + writeStartTag(area, buffer); + renderChildren(area); + writeEndTag(area); + } + + /** + * render a body area container to XML + * + * @param area the body area container to render + */ + public void render(FootnoteArea area) { + StringBuffer buffer = new StringBuffer(); + outputGeneratedBy(area, buffer); + outputAllRectangles(area, buffer); + writeStartTag(area, buffer); + renderChildren(area); + writeEndTag(area); + } + + /** * render a region area container to XML * * @param area the region area container to render @@ -245,24 +250,20 @@ */ public void render(SpanArea area) { StringBuffer buffer = new StringBuffer(); - buffer.append("<SpanArea"); outputGeneratedBy(area, buffer); outputAllRectangles(area, buffer); - buffer.append(">"); - writeStartTag(buffer.toString()); + writeStartTag(area, buffer); renderChildren(area); - writeEndTag("</SpanArea>"); + writeEndTag(area); } public void render(NormalFlowArea area) { StringBuffer buffer = new StringBuffer(); - buffer.append("<NormalFlowRA"); outputGeneratedBy(area, buffer); outputAllRectangles(area, buffer); - buffer.append(">"); - writeStartTag(buffer.toString()); + writeStartTag(area, buffer); renderChildren(area); - writeEndTag("</NormalFlowRA>"); + writeEndTag(area); } /** @@ -272,26 +273,22 @@ */ public void render(NormalBlockArea area) { StringBuffer buffer = new StringBuffer(); - buffer.append("<NormalBlockArea"); outputGeneratedBy(area, buffer); outputAllRectangles(area, buffer); outputDimension(area, buffer); outputAttribute(buffer, "start-indent", area.traitStartIndent()); outputAttribute(buffer, "end-indent", area.traitEndIndent()); - buffer.append(">"); - writeStartTag(buffer.toString()); + writeStartTag(area, buffer); renderChildren(area); - writeEndTag("</NormalBlockArea>"); + writeEndTag(area); } public void renderInlineArea(GeneralInlineArea area) { StringBuffer buffer = new StringBuffer(); - buffer.append("<InlineArea"); outputGeneratedBy(area, buffer); - buffer.append(">"); - writeStartTag(buffer.toString()); + writeStartTag(area, buffer); renderChildren(area); - writeEndTag("</InlineArea>"); + writeEndTag(area); } /** @@ -299,14 +296,12 @@ */ public void render(ForeignObjectArea area) { StringBuffer buffer = new StringBuffer(); - buffer.append("<ForeignObjectArea"); outputGeneratedBy(area, buffer); outputAllRectangles(area, buffer); outputDimension(area, buffer); - buffer.append(">"); - writeStartTag(buffer.toString()); + writeStartTag(area, buffer); renderChildren(area); - writeEndTag("</ForeignObjectArea>"); + writeEndTag(area); } /** @@ -348,15 +343,13 @@ return; } StringBuffer buffer = new StringBuffer(); - buffer.append("<LineArea"); outputGeneratedBy(area, buffer); outputAllRectangles(area, buffer); outputDimension(area, buffer); outputFontTraits(area, buffer); - buffer.append(">"); - writeStartTag(buffer.toString()); + writeStartTag(area, buffer); renderChildren(area); - writeEndTag("</LineArea>"); + writeEndTag(area); } public void render(BookmarkTreeArea area) { @@ -409,98 +402,82 @@ protected void render(BasicLinkArea area) { StringBuffer buffer = new StringBuffer(); - buffer.append("<BasicLinkArea"); outputGeneratedBy(area, buffer); outputAllRectangles(area, buffer); outputDimension(area, buffer); - buffer.append(">"); - writeStartTag(buffer.toString()); + writeStartTag(area, buffer); renderChildren(area); - writeEndTag("</BasicLinkArea>"); + writeEndTag(area); } protected void render(InlineArea area) { StringBuffer buffer = new StringBuffer(); - buffer.append("<InlineArea"); outputGeneratedBy(area, buffer); outputAllRectangles(area, buffer); outputDimension(area, buffer); - buffer.append(">"); - writeStartTag(buffer.toString()); + writeStartTag(area, buffer); renderChildren(area); - writeEndTag("</InlineArea>"); + writeEndTag(area); } protected void render(TableArea area) { StringBuffer buffer = new StringBuffer(); - buffer.append("<TableRA"); outputGeneratedBy(area, buffer); outputAllRectangles(area, buffer); outputDimension(area, buffer); - buffer.append(">"); - writeStartTag(buffer.toString()); + writeStartTag(area, buffer); renderChildren(area); - writeEndTag("</TableRA>"); + writeEndTag(area); } protected void render(TableHeaderContainer area) { StringBuffer buffer = new StringBuffer(); - buffer.append("<TableHeaderContainer"); outputGeneratedBy(area, buffer); outputAllRectangles(area, buffer); outputDimension(area, buffer); - buffer.append(">"); - writeStartTag(buffer.toString()); + writeStartTag(area, buffer); renderChildren(area); - writeEndTag("</TableHeaderContainer>"); + writeEndTag(area); } protected void render(TableFooterContainer area) { StringBuffer buffer = new StringBuffer(); - buffer.append("<TableFooterContainer"); outputGeneratedBy(area, buffer); outputAllRectangles(area, buffer); outputDimension(area, buffer); - buffer.append(">"); - writeStartTag(buffer.toString()); + writeStartTag(area, buffer); renderChildren(area); - writeEndTag("</TableFooterContainer>"); + writeEndTag(area); } protected void render(TableBodyContainer area) { StringBuffer buffer = new StringBuffer(); - buffer.append("<TableBodyContainer"); outputGeneratedBy(area, buffer); outputAllRectangles(area, buffer); outputDimension(area, buffer); - buffer.append(">"); - writeStartTag(buffer.toString()); + writeStartTag(area, buffer); renderChildren(area); - writeEndTag("</TableBodyContainer>"); + writeEndTag(area); } protected void render(TableRowContainer area) { StringBuffer buffer = new StringBuffer(); - buffer.append("<TableRowContainer"); outputGeneratedBy(area, buffer); outputAllRectangles(area, buffer); outputDimension(area, buffer); - buffer.append(">"); - writeStartTag(buffer.toString()); + writeStartTag(area, buffer); renderChildren(area); - writeEndTag("</TableRowContainer>"); + writeEndTag(area); } protected void render(TableCellArea area) { StringBuffer buffer = new StringBuffer(); - buffer.append("<TableCellRA"); outputGeneratedBy(area, buffer); outputAllRectangles(area, buffer); outputDimension(area, buffer); - buffer.append(">"); - writeStartTag(buffer.toString()); + writeStartTag(area, buffer); renderChildren(area); - writeEndTag("</TableCellRA>"); + writeEndTag(area); } private boolean isCoarseXml() { @@ -526,7 +503,7 @@ buffer.append("<!-- produced by " + this.getApplicationNameShort() + " " + getApplicationVersion() + " -->\n"); this.writer.write(buffer.toString()); - writeStartTag("<area-tree>"); + this.writer.write("<area-tree>\n"); } /** @@ -534,7 +511,7 @@ normally be overridden. (mar...@in...). */ public void stopOutput() throws IOException { - writeEndTag("</area-tree>"); + this.writer.write("</area-tree>"); this.writer.flush(); getLogger().debug("written out XML"); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-03 00:16:12
|
Revision: 7369 Author: victormote Date: 2006-06-02 17:16:03 -0700 (Fri, 02 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7369&view=rev Log Message: ----------- Implement new axsl interface. Modified Paths: -------------- trunk/foray/foray-areatree/src/java/org/foray/area/FootnoteRA.java Modified: trunk/foray/foray-areatree/src/java/org/foray/area/FootnoteRA.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/FootnoteRA.java 2006-06-02 23:27:00 UTC (rev 7368) +++ trunk/foray/foray-areatree/src/java/org/foray/area/FootnoteRA.java 2006-06-03 00:16:03 UTC (rev 7369) @@ -31,7 +31,8 @@ /** * Manages the footnote reference area for a page. */ -public class FootnoteRA extends AreaFixed implements org.axsl.areaW.FootnoteRA { +public class FootnoteRA extends AreaFixed + implements org.axsl.areaR.FootnoteArea, org.axsl.areaW.FootnoteRA { public FootnoteRA(FObj generatedBy, RegionRABody parentArea) { super(generatedBy, parentArea); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-02 23:27:12
|
Revision: 7368 Author: victormote Date: 2006-06-02 16:27:00 -0700 (Fri, 02 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7368&view=rev Log Message: ----------- Create and use new methods to normalize the element names. Modified Paths: -------------- trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java 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-06-02 22:54:50 UTC (rev 7367) +++ trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java 2006-06-02 23:27:00 UTC (rev 7368) @@ -118,7 +118,7 @@ if (body != null) { this.render(body); } - this.writeEndTag("</page>"); + this.writeEndTag(page); } /** @@ -133,29 +133,36 @@ } /** - * write out an element - * - * @param element the full text of the element including tags + * Write the start tag, attribues, and end-tag for an element. + * @param area The area for whom element is written. + * @param attributes Text of the attributes to be written. */ - protected void writeElement(String element) { + protected void writeEmptyElement(Area area, StringBuffer attributes) { writeIndent(); - this.writer.write(element + "\n"); + this.writer.write("<"); + this.writer.write(area.getAreaName()); + if (attributes != null) { + this.writer.write(attributes.toString()); + } + this.writer.write("/>\n"); } /** - * write out an empty-element-tag - * - * @param tag the text of the tag + * Write the start tag, attribues, and end-tag for an element. + * @param area The area for whom element is written. + * @param attributes Text of the attributes to be written. */ - protected void writeEmptyElementTag(String tag) { + protected void writeStartTag(Area area, StringBuffer attributes) { writeIndent(); - this.writer.write(tag + "\n"); + this.writer.write("<"); + this.writer.write(area.getAreaName()); + this.writer.write(attributes.toString()); + this.writer.write(">\n"); } /** - * write out an end tag - * - * @param tag the text of the tag + * Write an end tag. + * @param tag The text of the tag, for example, "</tag>". */ protected void writeEndTag(String tag) { this.indent--; @@ -164,6 +171,14 @@ } /** + * Write an end tag. + * @param area The area whose end-tag should be written. + */ + protected void writeEndTag(Area area) { + writeEndTag("</" + area.getAreaName() + ">"); + } + + /** * write out a start tag * * @param tag the text of the tag @@ -301,12 +316,10 @@ */ public void render(SVGArea area) { StringBuffer buffer = new StringBuffer(); - buffer.append("<SVGArea"); outputGeneratedBy(area, buffer); outputAllRectangles(area, buffer); outputDimension(area, buffer); - buffer.append("/>"); - writeEmptyElementTag(buffer.toString()); + writeEmptyElement(area, buffer); } /** @@ -315,7 +328,7 @@ * @param area the area to render */ public void render(ExternalGraphicArea area) { - writeEmptyElementTag("<ImageArea/>"); + writeEmptyElement(area, null); } protected void createBasicLink(BasicLinkArea area) { @@ -360,7 +373,6 @@ return; } StringBuffer buffer = new StringBuffer(); - buffer.append("<Leader"); outputGeneratedBy(area, buffer); outputAllRectangles(area, buffer); outputAttribute(buffer, "leader-pattern", @@ -370,34 +382,29 @@ outputAttribute(buffer, "rule-thickness", area.traitRuleThickness()); outputAttribute(buffer, "rule-style", area.traitRuleStyle()); outputColor(area, buffer); - buffer.append("/>"); - writeEmptyElementTag(buffer.toString()); + writeEmptyElement(area, buffer); } public void render(TextArea area) { StringBuffer buffer = new StringBuffer(); - buffer.append("<TextArea"); outputGeneratedBy(area, buffer); outputAllRectangles(area, buffer); outputDimension(area, buffer); - buffer.append(">"); + writeStartTag(area, buffer); char[] rawText = area.getText(); char[] cookedText = XMLCharacter.expandEntityReferences(rawText); - buffer.append(cookedText); - buffer.append("</TextArea>"); - writeEmptyElementTag(buffer.toString()); + this.writer.write(cookedText); + writeEndTag(area); } protected void render(PageNumberCitationArea area) { StringBuffer buffer = new StringBuffer(); - buffer.append("<PageNumberInlineArea"); outputGeneratedBy(area, buffer); outputAllRectangles(area, buffer); outputDimension(area, buffer); - buffer.append(">"); - buffer.append(area.resolve()); - buffer.append("</PageNumberInlineArea>"); - writeEmptyElementTag(buffer.toString()); + writeStartTag(area, buffer); + this.writer.write(area.resolve()); + writeEndTag(area); } protected void render(BasicLinkArea area) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-02 22:54:58
|
Revision: 7367 Author: victormote Date: 2006-06-02 15:54:50 -0700 (Fri, 02 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7367&view=rev Log Message: ----------- Use convenience methods for writing attributes. Modified Paths: -------------- trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java 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-06-02 22:42:22 UTC (rev 7366) +++ trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java 2006-06-02 22:54:50 UTC (rev 7367) @@ -21,7 +21,12 @@ */ /* $Id$ */ - + +/* + * Known Contributors: + * Mark Lillywhite mar...@in... + */ + package org.foray.render.xml; import org.foray.common.XMLCharacter; @@ -67,9 +72,6 @@ /** * Renderer that renders areas to XML for debugging purposes. - * - * Modified by Mark Lillywhite mar...@in... to use the - * new renderer interface. Not 100% certain that this is correct. */ public class XMLRenderer extends Renderer { @@ -97,10 +99,7 @@ RegionArea end = page.getRegionEnd(); StringBuffer buffer = new StringBuffer(); buffer.append("<page"); - buffer.append(" number="); - buffer.append(DOUBLE_QUOTE); - buffer.append(page.getFormattedNumber()); - buffer.append(DOUBLE_QUOTE); + outputAttribute(buffer, "number", page.getFormattedNumber()); this.outputAllRectangles(page, buffer); buffer.append(">"); this.writeStartTag(buffer.toString()); @@ -262,14 +261,8 @@ outputGeneratedBy(area, buffer); outputAllRectangles(area, buffer); outputDimension(area, buffer); - buffer.append(" start-indent="); - buffer.append(DOUBLE_QUOTE); - buffer.append(area.traitStartIndent()); - buffer.append(DOUBLE_QUOTE); - buffer.append(" end-indent="); - buffer.append(DOUBLE_QUOTE); - buffer.append(area.traitEndIndent()); - buffer.append(DOUBLE_QUOTE); + outputAttribute(buffer, "start-indent", area.traitStartIndent()); + outputAttribute(buffer, "end-indent", area.traitEndIndent()); buffer.append(">"); writeStartTag(buffer.toString()); renderChildren(area); @@ -277,14 +270,11 @@ } public void renderInlineArea(GeneralInlineArea area) { - StringBuffer iaText = new StringBuffer(); - iaText.append("<InlineArea"); - if (area.generatedByExists()) { - iaText.append(" generated-by=\"" - + area.generatedByName() + "\""); - } - iaText.append(">"); - writeStartTag(iaText.toString()); + StringBuffer buffer = new StringBuffer(); + buffer.append("<InlineArea"); + outputGeneratedBy(area, buffer); + buffer.append(">"); + writeStartTag(buffer.toString()); renderChildren(area); writeEndTag("</InlineArea>"); } @@ -349,10 +339,7 @@ outputGeneratedBy(area, buffer); outputAllRectangles(area, buffer); outputDimension(area, buffer); - buffer.append(" font-weight="); - buffer.append(DOUBLE_QUOTE); - buffer.append(area.traitFontWeight()); - buffer.append(DOUBLE_QUOTE); + outputFontTraits(area, buffer); buffer.append(">"); writeStartTag(buffer.toString()); renderChildren(area); @@ -376,23 +363,12 @@ buffer.append("<Leader"); outputGeneratedBy(area, buffer); outputAllRectangles(area, buffer); - buffer.append(" leader-pattern="); - buffer.append(DOUBLE_QUOTE); - buffer.append(Constants.expandPropertyConstant( - area.traitLeaderPattern())); - buffer.append(DOUBLE_QUOTE); - buffer.append(" leader-length="); - buffer.append(DOUBLE_QUOTE); - buffer.append(area.getProgressionDimension()); - buffer.append(DOUBLE_QUOTE); - buffer.append(" rule-thickness="); - buffer.append(DOUBLE_QUOTE); - buffer.append(area.traitRuleThickness()); - buffer.append(DOUBLE_QUOTE); - buffer.append(" rule-style="); - buffer.append(DOUBLE_QUOTE); - buffer.append(area.traitRuleStyle()); - buffer.append(DOUBLE_QUOTE); + outputAttribute(buffer, "leader-pattern", + Constants.expandPropertyConstant(area.traitLeaderPattern())); + outputAttribute(buffer, "leader-length", + area.getProgressionDimension()); + outputAttribute(buffer, "rule-thickness", area.traitRuleThickness()); + outputAttribute(buffer, "rule-style", area.traitRuleStyle()); outputColor(area, buffer); buffer.append("/>"); writeEmptyElementTag(buffer.toString()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-02 22:48:47
|
Revision: 7363 Author: victormote Date: 2006-06-02 14:18:34 -0700 (Fri, 02 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7363&view=rev Log Message: ----------- Add the DTD declaration to the output. Modified Paths: -------------- trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java 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-06-02 20:58:18 UTC (rev 7362) +++ trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java 2006-06-02 21:18:34 UTC (rev 7363) @@ -534,9 +534,16 @@ public void startOutput() throws IOException { getLogger().debug("rendering areas to XML"); this.writer = new PrintWriter(this.getOutputStream()); - this.writer.write("<?xml version=\"1.0\"?>\n<!-- produced by " + StringBuffer buffer = new StringBuffer(); + buffer.append("<?xml version=\"1.0\"?>\n"); + buffer.append("<!DOCTYPE area-tree\n"); + buffer.append(" PUBLIC \"-//aXSL//DTD Area Tree V0.1//EN\"\n"); + buffer.append(" \"http://www.axsl.org/dtds/0.1/en/"); + buffer.append("axsl-area-tree.dtd\">\n"); + buffer.append("<!-- produced by " + this.getApplicationNameShort() + " " + getApplicationVersion() + " -->\n"); - writeStartTag("<AreaTree>"); + this.writer.write(buffer.toString()); + writeStartTag("<area-tree>"); } /** @@ -544,7 +551,7 @@ normally be overridden. (mar...@in...). */ public void stopOutput() throws IOException { - writeEndTag("</AreaTree>"); + writeEndTag("</area-tree>"); this.writer.flush(); getLogger().debug("written out XML"); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-02 22:42:28
|
Revision: 7366 Author: victormote Date: 2006-06-02 15:42:22 -0700 (Fri, 02 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7366&view=rev Log Message: ----------- Add and use convenience methods for writing attributes. Modified Paths: -------------- trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java 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-06-02 22:24:04 UTC (rev 7365) +++ trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java 2006-06-02 22:42:22 UTC (rev 7366) @@ -96,7 +96,7 @@ RegionArea start = page.getRegionStart(); RegionArea end = page.getRegionEnd(); StringBuffer buffer = new StringBuffer(); - buffer.append("<Page"); + buffer.append("<page"); buffer.append(" number="); buffer.append(DOUBLE_QUOTE); buffer.append(page.getFormattedNumber()); @@ -119,7 +119,7 @@ if (body != null) { this.render(body); } - this.writeEndTag("</Page>"); + this.writeEndTag("</page>"); } /** @@ -597,14 +597,12 @@ if (! area.generatedByExists()) { return; } - buffer.append(" generated-by=\""); - buffer.append(area.generatedByName()); + String idString = ""; if (area.traitId() != null && ! area.traitId().equals("")) { - buffer.append("(id "); - buffer.append(area.traitId()); - buffer.append(")"); + idString = "(id " + area.traitId() + ")"; } - buffer.append("\""); + outputAttribute(buffer, "generated-by", area.generatedByName() + + idString); } public void outputAllRectangles(Area area, StringBuffer buffer) { @@ -615,74 +613,55 @@ } public void outputBorderRectangleOrigin(Area area, StringBuffer buffer) { - buffer.append(" brx="); - buffer.append(DOUBLE_QUOTE); - buffer.append(area.brOriginX()); - buffer.append(DOUBLE_QUOTE); - buffer.append(" bry="); - buffer.append(DOUBLE_QUOTE); - buffer.append(area.brOriginY()); - buffer.append(DOUBLE_QUOTE); + outputAttribute(buffer, "brx", area.brOriginX()); + outputAttribute(buffer, "bry", area.brOriginY()); } public void outputPaddingRectangleOrigin(Area area, StringBuffer buffer) { - buffer.append(" prx="); - buffer.append(DOUBLE_QUOTE); - buffer.append(area.prOriginX()); - buffer.append(DOUBLE_QUOTE); - buffer.append(" pry="); - buffer.append(DOUBLE_QUOTE); - buffer.append(area.prOriginY()); - buffer.append(DOUBLE_QUOTE); + outputAttribute(buffer, "prx", area.prOriginX()); + outputAttribute(buffer, "pry", area.prOriginY()); } public void outputContentRectangleOrigin(Area area, StringBuffer buffer) { - buffer.append(" crx="); - buffer.append(DOUBLE_QUOTE); - buffer.append(area.crOriginX()); - buffer.append(DOUBLE_QUOTE); - buffer.append(" cry="); - buffer.append(DOUBLE_QUOTE); - buffer.append(area.crOriginY()); - buffer.append(DOUBLE_QUOTE); + outputAttribute(buffer, "crx", area.crOriginX()); + outputAttribute(buffer, "cry", area.crOriginY()); } public void outputRenderRectangleOrigin(Area area, StringBuffer buffer) { - buffer.append(" rrx="); - buffer.append(DOUBLE_QUOTE); - buffer.append(area.rrOriginX()); - buffer.append(DOUBLE_QUOTE); - buffer.append(" rry="); - buffer.append(DOUBLE_QUOTE); - buffer.append(area.rrOriginY()); - buffer.append(DOUBLE_QUOTE); + outputAttribute(buffer, "rrx", area.rrOriginX()); + outputAttribute(buffer, "rry", area.rrOriginY()); } public void outputDimension(AreaFlexible area, StringBuffer buffer) { - buffer.append(" dim="); - buffer.append(DOUBLE_QUOTE); - buffer.append(area.getProgressionDimension()); - buffer.append(DOUBLE_QUOTE); + outputAttribute(buffer, "dim", area.getProgressionDimension()); } public void outputColor(AreaFlexible area, StringBuffer buffer) { - buffer.append(" rgb="); - buffer.append(DOUBLE_QUOTE); - buffer.append(area.getRed()); - buffer.append(", "); - buffer.append(area.getGreen()); - buffer.append(", "); - buffer.append(area.getBlue()); - buffer.append(DOUBLE_QUOTE); + String color = area.getRed() + + ", " + + area.getGreen() + + ", " + + area.getBlue(); + outputAttribute(buffer, "rgb", color); } public void outputFontTraits(Area area, StringBuffer buffer) { - buffer.append(" font-weight="); + outputAttribute(buffer, "font-weight", area.traitFontWeight()); + } + + public void outputAttribute(StringBuffer buffer, String attributeName, + String attributeValue) { + buffer.append(" " + attributeName + "="); buffer.append(DOUBLE_QUOTE); - buffer.append(area.traitFontWeight()); + buffer.append(attributeValue); buffer.append(DOUBLE_QUOTE); } + public void outputAttribute(StringBuffer buffer, String attributeName, + long attributeValue) { + outputAttribute(buffer, attributeName, Long.toString(attributeValue)); + } + public void outputText(char[] chars, StringBuffer buffer) { for (int i = 0; i < chars.length; i++) { char ch = chars[i]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-02 22:24:30
|
Revision: 7365 Author: victormote Date: 2006-06-02 15:24:04 -0700 (Fri, 02 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7365&view=rev Log Message: ----------- Conform to axsl change: Add method for name suitable for output of AreaTree to XML. Modified Paths: -------------- trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java trunk/foray/foray-areatree/src/java/org/foray/area/BasicLinkArea.java trunk/foray/foray-areatree/src/java/org/foray/area/BeforeFloatRA.java trunk/foray/foray-areatree/src/java/org/foray/area/BlockContainerRA.java trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkArea.java trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkTitleArea.java trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkTreeArea.java trunk/foray/foray-areatree/src/java/org/foray/area/ExternalGraphicArea.java trunk/foray/foray-areatree/src/java/org/foray/area/FootnoteRA.java trunk/foray/foray-areatree/src/java/org/foray/area/ForeignObjectArea.java trunk/foray/foray-areatree/src/java/org/foray/area/GenericContainer.java trunk/foray/foray-areatree/src/java/org/foray/area/InlineArea.java trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java trunk/foray/foray-areatree/src/java/org/foray/area/MainRA.java trunk/foray/foray-areatree/src/java/org/foray/area/NormalBlockArea.java trunk/foray/foray-areatree/src/java/org/foray/area/NormalFlowRA.java trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberArea.java trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberCitationArea.java trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java trunk/foray/foray-areatree/src/java/org/foray/area/RegionRA.java trunk/foray/foray-areatree/src/java/org/foray/area/RegionRABody.java trunk/foray/foray-areatree/src/java/org/foray/area/SVGArea.java trunk/foray/foray-areatree/src/java/org/foray/area/SpanRA.java trunk/foray/foray-areatree/src/java/org/foray/area/TableCellRA.java trunk/foray/foray-areatree/src/java/org/foray/area/TableColumnRA.java trunk/foray/foray-areatree/src/java/org/foray/area/TableRowContainer.java trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.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-06-02 22:06:07 UTC (rev 7364) +++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java 2006-06-02 22:24:04 UTC (rev 7365) @@ -226,4 +226,11 @@ } } + /** + * {@inheritDoc} + */ + public String getAreaName() { + return "area-tree"; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/BasicLinkArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/BasicLinkArea.java 2006-06-02 22:06:07 UTC (rev 7364) +++ trunk/foray/foray-areatree/src/java/org/foray/area/BasicLinkArea.java 2006-06-02 22:24:04 UTC (rev 7365) @@ -54,4 +54,11 @@ return ipd; } + /** + * {@inheritDoc} + */ + public String getAreaName() { + return "basic-link"; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/BeforeFloatRA.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/BeforeFloatRA.java 2006-06-02 22:06:07 UTC (rev 7364) +++ trunk/foray/foray-areatree/src/java/org/foray/area/BeforeFloatRA.java 2006-06-02 22:24:04 UTC (rev 7365) @@ -72,4 +72,11 @@ return getParentArea().getOverflowArea(this); } + /** + * {@inheritDoc} + */ + public String getAreaName() { + return "before-float"; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/BlockContainerRA.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/BlockContainerRA.java 2006-06-02 22:06:07 UTC (rev 7364) +++ trunk/foray/foray-areatree/src/java/org/foray/area/BlockContainerRA.java 2006-06-02 22:24:04 UTC (rev 7365) @@ -73,4 +73,11 @@ return super.crOriginBPDOffset(); } + /** + * {@inheritDoc} + */ + public String getAreaName() { + return "block-container"; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkArea.java 2006-06-02 22:06:07 UTC (rev 7364) +++ trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkArea.java 2006-06-02 22:24:04 UTC (rev 7365) @@ -50,4 +50,11 @@ return (BookmarkTitleArea) getChildren().get(0); } + /** + * {@inheritDoc} + */ + public String getAreaName() { + return "bookmark"; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkTitleArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkTitleArea.java 2006-06-02 22:06:07 UTC (rev 7364) +++ trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkTitleArea.java 2006-06-02 22:24:04 UTC (rev 7365) @@ -47,4 +47,11 @@ return new String(generatedBy.getContent()); } + /** + * {@inheritDoc} + */ + public String getAreaName() { + return "bookmark-title"; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkTreeArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkTreeArea.java 2006-06-02 22:06:07 UTC (rev 7364) +++ trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkTreeArea.java 2006-06-02 22:24:04 UTC (rev 7365) @@ -41,4 +41,11 @@ return ConstantsAreaTree.AREATYPE_BOOKMARK_TREE; } + /** + * {@inheritDoc} + */ + public String getAreaName() { + return "bookmark-tree"; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/ExternalGraphicArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/ExternalGraphicArea.java 2006-06-02 22:06:07 UTC (rev 7364) +++ trunk/foray/foray-areatree/src/java/org/foray/area/ExternalGraphicArea.java 2006-06-02 22:24:04 UTC (rev 7365) @@ -68,4 +68,11 @@ parentForDimensions.crBPD()); } + /** + * {@inheritDoc} + */ + public String getAreaName() { + return "external-graphic"; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/FootnoteRA.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/FootnoteRA.java 2006-06-02 22:06:07 UTC (rev 7364) +++ trunk/foray/foray-areatree/src/java/org/foray/area/FootnoteRA.java 2006-06-02 22:24:04 UTC (rev 7365) @@ -83,4 +83,11 @@ return parentArea.progressionDimensionAvailable(); } + /** + * {@inheritDoc} + */ + public String getAreaName() { + return "footnote"; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/ForeignObjectArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/ForeignObjectArea.java 2006-06-02 22:06:07 UTC (rev 7364) +++ trunk/foray/foray-areatree/src/java/org/foray/area/ForeignObjectArea.java 2006-06-02 22:24:04 UTC (rev 7365) @@ -75,4 +75,11 @@ return getFirstAreaNodeChild(); } + /** + * {@inheritDoc} + */ + public String getAreaName() { + return "foreign-object"; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/GenericContainer.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/GenericContainer.java 2006-06-02 22:06:07 UTC (rev 7364) +++ trunk/foray/foray-areatree/src/java/org/foray/area/GenericContainer.java 2006-06-02 22:24:04 UTC (rev 7365) @@ -57,4 +57,11 @@ return ConstantsAreaTree.AREATYPE_GENERIC_CONTAINER; } + /** + * {@inheritDoc} + */ + public String getAreaName() { + return "generic-container"; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/InlineArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/InlineArea.java 2006-06-02 22:06:07 UTC (rev 7364) +++ trunk/foray/foray-areatree/src/java/org/foray/area/InlineArea.java 2006-06-02 22:24:04 UTC (rev 7365) @@ -42,4 +42,11 @@ return ConstantsAreaTree.AREATYPE_INLINE; } + /** + * {@inheritDoc} + */ + public String getAreaName() { + return "inline"; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java 2006-06-02 22:06:07 UTC (rev 7364) +++ trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java 2006-06-02 22:24:04 UTC (rev 7365) @@ -241,4 +241,11 @@ return this.actualWordSpacing(); } + /** + * {@inheritDoc} + */ + public String getAreaName() { + return "leader"; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2006-06-02 22:06:07 UTC (rev 7364) +++ trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2006-06-02 22:24:04 UTC (rev 7365) @@ -897,4 +897,11 @@ return 0; } + /** + * {@inheritDoc} + */ + public String getAreaName() { + return "line"; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/MainRA.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/MainRA.java 2006-06-02 22:06:07 UTC (rev 7364) +++ trunk/foray/foray-areatree/src/java/org/foray/area/MainRA.java 2006-06-02 22:24:04 UTC (rev 7365) @@ -260,4 +260,11 @@ return parent.traitColumnGap(); } + /** + * {@inheritDoc} + */ + public String getAreaName() { + return "main"; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/NormalBlockArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/NormalBlockArea.java 2006-06-02 22:06:07 UTC (rev 7364) +++ trunk/foray/foray-areatree/src/java/org/foray/area/NormalBlockArea.java 2006-06-02 22:24:04 UTC (rev 7365) @@ -171,4 +171,11 @@ return null; } + /** + * {@inheritDoc} + */ + public String getAreaName() { + return "normal-block"; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/NormalFlowRA.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/NormalFlowRA.java 2006-06-02 22:06:07 UTC (rev 7364) +++ trunk/foray/foray-areatree/src/java/org/foray/area/NormalFlowRA.java 2006-06-02 22:24:04 UTC (rev 7365) @@ -110,4 +110,11 @@ return sum; } + /** + * {@inheritDoc} + */ + public String getAreaName() { + return "normal-flow"; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java 2006-06-02 22:06:07 UTC (rev 7364) +++ trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java 2006-06-02 22:24:04 UTC (rev 7365) @@ -368,4 +368,11 @@ return this; } + /** + * {@inheritDoc} + */ + public String getAreaName() { + return "page-collection"; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberArea.java 2006-06-02 22:06:07 UTC (rev 7364) +++ trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberArea.java 2006-06-02 22:24:04 UTC (rev 7365) @@ -50,4 +50,11 @@ return ConstantsAreaTree.AREATYPE_PAGE_NUMBER_AREA; } + /** + * {@inheritDoc} + */ + public String getAreaName() { + return "page-number"; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberCitationArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberCitationArea.java 2006-06-02 22:06:07 UTC (rev 7364) +++ trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberCitationArea.java 2006-06-02 22:24:04 UTC (rev 7365) @@ -63,4 +63,11 @@ return false; } + /** + * {@inheritDoc} + */ + public String getAreaName() { + return "page-number-citation"; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java 2006-06-02 22:06:07 UTC (rev 7364) +++ trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java 2006-06-02 22:24:04 UTC (rev 7365) @@ -567,4 +567,11 @@ return (SimplePageMaster) this.traitGeneratedBy(); } + /** + * {@inheritDoc} + */ + public String getAreaName() { + return "page"; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/RegionRA.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/RegionRA.java 2006-06-02 22:06:07 UTC (rev 7364) +++ trunk/foray/foray-areatree/src/java/org/foray/area/RegionRA.java 2006-06-02 22:24:04 UTC (rev 7365) @@ -113,4 +113,11 @@ return null; } + /** + * {@inheritDoc} + */ + public String getAreaName() { + return this.generatedByName(); + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/RegionRABody.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/RegionRABody.java 2006-06-02 22:06:07 UTC (rev 7364) +++ trunk/foray/foray-areatree/src/java/org/foray/area/RegionRABody.java 2006-06-02 22:24:04 UTC (rev 7365) @@ -201,4 +201,11 @@ return traitGeneratedBy().traitColumnGap(); } + /** + * {@inheritDoc} + */ + public String getAreaName() { + return "region-body"; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/SVGArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/SVGArea.java 2006-06-02 22:06:07 UTC (rev 7364) +++ trunk/foray/foray-areatree/src/java/org/foray/area/SVGArea.java 2006-06-02 22:24:04 UTC (rev 7365) @@ -59,4 +59,11 @@ return getParentArea().getOverflowArea(this); } + /** + * {@inheritDoc} + */ + public String getAreaName() { + return "svg"; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/SpanRA.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/SpanRA.java 2006-06-02 22:06:07 UTC (rev 7364) +++ trunk/foray/foray-areatree/src/java/org/foray/area/SpanRA.java 2006-06-02 22:24:04 UTC (rev 7365) @@ -276,4 +276,11 @@ } } + /** + * {@inheritDoc} + */ + public String getAreaName() { + return "span"; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TableCellRA.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/TableCellRA.java 2006-06-02 22:06:07 UTC (rev 7364) +++ trunk/foray/foray-areatree/src/java/org/foray/area/TableCellRA.java 2006-06-02 22:24:04 UTC (rev 7365) @@ -152,4 +152,11 @@ return tableRA.ipdCell(startingColumn, span); } + /** + * {@inheritDoc} + */ + public String getAreaName() { + return "table-cell"; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TableColumnRA.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/TableColumnRA.java 2006-06-02 22:06:07 UTC (rev 7364) +++ trunk/foray/foray-areatree/src/java/org/foray/area/TableColumnRA.java 2006-06-02 22:24:04 UTC (rev 7365) @@ -50,4 +50,11 @@ return tableArea.getResolvedColumnWidth(columnNum); } + /** + * {@inheritDoc} + */ + public String getAreaName() { + return "table-column"; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TableRowContainer.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/TableRowContainer.java 2006-06-02 22:06:07 UTC (rev 7364) +++ trunk/foray/foray-areatree/src/java/org/foray/area/TableRowContainer.java 2006-06-02 22:24:04 UTC (rev 7365) @@ -68,4 +68,11 @@ return new TableCellRA(node, this); } + /** + * {@inheritDoc} + */ + public String getAreaName() { + return "table-row"; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java 2006-06-02 22:06:07 UTC (rev 7364) +++ trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java 2006-06-02 22:24:04 UTC (rev 7365) @@ -541,4 +541,11 @@ return super.traitFontSize(); } + /** + * {@inheritDoc} + */ + public String getAreaName() { + return "text"; + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-02 22:06:17
|
Revision: 7364 Author: victormote Date: 2006-06-02 15:06:07 -0700 (Fri, 02 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7364&view=rev Log Message: ----------- Improvements intended to assist with keeping absolutely-positioned areas out of the normal flow. Modified Paths: -------------- trunk/foray/foray-areatree/src/java/org/foray/area/Area.java trunk/foray/foray-areatree/src/java/org/foray/area/AreaFixed.java trunk/foray/foray-areatree/src/java/org/foray/area/AreaFlexible.java trunk/foray/foray-areatree/src/java/org/foray/area/BlockContainerRA.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-06-02 21:18:34 UTC (rev 7363) +++ trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2006-06-02 22:06:07 UTC (rev 7364) @@ -1204,4 +1204,29 @@ return traitGeneratedBy().traitRight(ancestor.crIPD()); } + /** + * Indicates whether this Area is positioned absolutely or relatively. + * Subclasses that can have absolutely-positioned instances should override + * this method. + * @return True iff this Area is absolutely positioned. + */ + public boolean isAbsolutelyPositioned() { + return false; + } + + /** + * Indicates whether this Area is part of the normal flow. + * See XSL-FO 1.0, Section 7.5, where absolutely-positioned Areas are + * excluded from the normal flow, and do not affect the positioning of later + * siblings. + * @return True iff this Area is part of the normal flow and affects the + * positioning of later siblings. + */ + public boolean isInNormalFlow() { + if (this.isAbsolutelyPositioned()) { + return false; + } + return true; + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AreaFixed.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/AreaFixed.java 2006-06-02 21:18:34 UTC (rev 7363) +++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaFixed.java 2006-06-02 22:06:07 UTC (rev 7364) @@ -49,7 +49,7 @@ for (int i = 0; i < children.size(); i++) { if (children.get(i) instanceof AreaFlexible) { AreaFlexible child = (AreaFlexible) children.get(i); - dimension -= child.getProgressionDimension(); + dimension -= child.usedProgressionDimensionNormalFlow(); } } return dimension; Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AreaFlexible.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/AreaFlexible.java 2006-06-02 21:18:34 UTC (rev 7363) +++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaFlexible.java 2006-06-02 22:06:07 UTC (rev 7364) @@ -180,7 +180,9 @@ */ public void incrementProgressionDimension(int incrementAmount) { Area parent = getParentArea(); - if (parent instanceof AreaFlexible && ! (parent instanceof LineArea)) { + if (parent instanceof AreaFlexible + && ! (parent instanceof LineArea) + && this.isInNormalFlow()) { /* * LineArea uses progressionDimension differently than any other * class, because it is the "pivot" that switches between @@ -215,6 +217,17 @@ } /** + * @return The amount of progression that should be considered "used" by + * this area when computing how much is available in the normal flow. + */ + public int usedProgressionDimensionNormalFlow() { + if (this.isInNormalFlow()) { + return this.usedProgressionDimension(); + } + return 0; + } + + /** * {@inheritDoc} */ public int crIPD() { @@ -334,7 +347,12 @@ for (int i = 0; i < siblingIndex; i++) { if (siblings.get(i) instanceof AreaFlexible) { AreaFlexible af = (AreaFlexible) siblings.get(i); - pdUsedBySiblings += af.usedProgressionDimension(); + if (af.isInNormalFlow()) { + /* If the Area is not part of the normal flow, then its + * progression dimension should not be included in the + * amount used. */ + pdUsedBySiblings += af.usedProgressionDimensionNormalFlow(); + } } } return pdUsedBySiblings; Modified: trunk/foray/foray-areatree/src/java/org/foray/area/BlockContainerRA.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/BlockContainerRA.java 2006-06-02 21:18:34 UTC (rev 7363) +++ trunk/foray/foray-areatree/src/java/org/foray/area/BlockContainerRA.java 2006-06-02 22:06:07 UTC (rev 7364) @@ -43,6 +43,13 @@ return ConstantsAreaTree.AREATYPE_BLOCK_CONTAINER; } + public boolean isAbsolutelyPositioned() { + if (this.traitAbsolutePosition() == Constants.FOVAL_AUTO) { + return false; + } + return true; + } + /** * {@inheritDoc} */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-02 20:58:29
|
Revision: 7362 Author: victormote Date: 2006-06-02 13:58:18 -0700 (Fri, 02 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7362&view=rev Log Message: ----------- Use new Common methods to make sure XML output has no raw entity references. Modified Paths: -------------- trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java 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-06-02 20:57:37 UTC (rev 7361) +++ trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java 2006-06-02 20:58:18 UTC (rev 7362) @@ -24,6 +24,7 @@ package org.foray.render.xml; +import org.foray.common.XMLCharacter; import org.foray.output.OutputConfig; import org.foray.render.Renderer; @@ -404,7 +405,9 @@ outputAllRectangles(area, buffer); outputDimension(area, buffer); buffer.append(">"); - buffer.append(area.getText()); + char[] rawText = area.getText(); + char[] cookedText = XMLCharacter.expandEntityReferences(rawText); + buffer.append(cookedText); buffer.append("</TextArea>"); writeEmptyElementTag(buffer.toString()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |