foray-commit Mailing List for FOray (Page 292)
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
(4) |
Dec
(23) |
| 2026 |
Jan
(119) |
Feb
(335) |
Mar
(103) |
Apr
(43) |
May
(154) |
Jun
(107) |
Jul
(187) |
Aug
(4) |
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <vic...@us...> - 2006-06-17 02:10:49
|
Revision: 7665 Author: victormote Date: 2006-06-16 19:10:44 -0700 (Fri, 16 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7665&view=rev Log Message: ----------- Conform to axsl changes: Add new methods to Font interface to provide metrics for underline, overline, and strikout positions and weights. Modified Paths: -------------- trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java Modified: trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java =================================================================== --- trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java 2006-06-17 01:03:08 UTC (rev 7664) +++ trunk/foray/foray-font/src/java/org/foray/font/FOrayFont.java 2006-06-17 02:10:44 UTC (rev 7665) @@ -372,4 +372,63 @@ return Constants.BASELINE_ALPHABETIC; } + /** + * {@inheritDoc} + */ + public int underlineSize(int fontSize) { + /* TODO: Where possible, replace this heuristic with data from the + * font itself. */ + /* Until we learn better, make this the same size as the strikeout. */ + return strikeoutSize(fontSize); + } + + /** + * {@inheritDoc} + */ + public int underlinePosition(int fontSize) { + /* TODO: Where possible, replace this heuristic with data from the + * font itself. */ + return (fontSize / 10) * -1; + } + + /** + * {@inheritDoc} + */ + public int overlineSize(int fontSize) { + /* TODO: Where possible, replace this heuristic with data from the + * font itself. */ + /* Until we learn better, make this the same size as the strikeout. */ + return strikeoutSize(fontSize); + } + + /** + * {@inheritDoc} + */ + public int overlinePosition(int fontSize) { + /* TODO: Where possible, replace this heuristic with data from the + * font itself. */ + return getAscender(fontSize) + (fontSize / 10); + } + + /** + * {@inheritDoc} + */ + public int strikeoutSize(int fontSize) { + /* TODO: Where possible, replace this heuristic with data from the + * font itself. */ + /* This computation comes from the OpenType manual, Section OS/2 + * table, for the definition of "yStrikeoutSize", where this ratio is + * suggested. */ + return fontSize * 102 / 2048; + } + + /** + * {@inheritDoc} + */ + public int strikeoutPosition(int fontSize) { + /* TODO: Where possible, replace this heuristic with data from the + * font itself. */ + return getAscender(fontSize) * 3 / 8; + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-17 01:03:15
|
Revision: 7664 Author: victormote Date: 2006-06-16 18:03:08 -0700 (Fri, 16 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7664&view=rev Log Message: ----------- Remove doFrame() method so that background processing is separated. 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-17 01:00:26 UTC (rev 7663) +++ trunk/foray/foray-render/src/java/org/foray/render/Renderer.java 2006-06-17 01:03:08 UTC (rev 7664) @@ -104,11 +104,6 @@ public abstract void render(PageArea page) throws IOException, AreaRException; - protected void doFrame(Area area) { - markBorder(area); - markBackground(area); - } - protected abstract void markBorder(Area area); /** @@ -328,7 +323,8 @@ * @param area the area container to render */ public void render(BlockContainerArea area) { - doFrame(area); + markBorder(area); + markBackground(area); renderChildren(area); } @@ -372,7 +368,8 @@ * @param area the block area to render */ public void render(NormalBlockArea area) { - doFrame(area); + markBorder(area); + markBackground(area); renderChildren(area); } @@ -415,12 +412,14 @@ /* TODO: Add logic that tries to paint the borders as efficiently * as possible. Contiguous cells that have identical borders should have * their borders painted at the same time. */ - doFrame(area); + markBorder(area); + markBackground(area); renderChildren(area); } public void render(TableRowContainer area) { - doFrame(area); + markBorder(area); + markBackground(area); renderChildren(area); } @@ -430,7 +429,8 @@ * @param area the area container to render */ public void render(TableCellArea area) { - doFrame(area); + markBorder(area); + markBackground(area); renderChildren(area); } @@ -491,7 +491,8 @@ protected abstract void createBasicLink(BasicLinkArea area) ; public void render(InlineArea area) { - doFrame(area); + markBorder(area); + markBackground(area); renderChildren(area); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-17 01:00:33
|
Revision: 7663 Author: victormote Date: 2006-06-16 18:00:26 -0700 (Fri, 16 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7663&view=rev Log Message: ----------- Conform to axsl changes: 1. Improvements to BackgroundArea interface. 2. Have TableArea return BackgroundAreas instead of Areas. 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-17 01:00:18 UTC (rev 7662) +++ trunk/foray/foray-render/src/java/org/foray/render/Renderer.java 2006-06-17 01:00:26 UTC (rev 7663) @@ -38,6 +38,7 @@ import org.axsl.areaR.AreaNode; import org.axsl.areaR.AreaRException; import org.axsl.areaR.AreaTree; +import org.axsl.areaR.BackgroundArea; import org.axsl.areaR.BasicLinkArea; import org.axsl.areaR.BeforeFloatArea; import org.axsl.areaR.BlockContainerArea; @@ -404,11 +405,11 @@ * @param area The TableRA instance to render. */ public void render(TableArea area) { - Area[] backgroundAreas = area.getBackgroundAreas(); + BackgroundArea[] backgroundAreas = area.getBackgroundAreas(); if (backgroundAreas != null) { for (int i = 0; i < backgroundAreas.length; i++) { - Area bga = backgroundAreas[i]; - markBackground(bga); +// BackgroundArea bga = backgroundAreas[i]; +// markBackground(bga); } } /* TODO: Add logic that tries to paint the borders as efficiently This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-17 01:00:22
|
Revision: 7662 Author: victormote Date: 2006-06-16 18:00:18 -0700 (Fri, 16 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7662&view=rev Log Message: ----------- Conform to axsl changes: 1. Improvements to BackgroundArea interface. 2. Have TableArea return BackgroundAreas instead of Areas. Modified Paths: -------------- trunk/foray/foray-areatree/src/java/org/foray/area/TableRA.java 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-17 00:35:48 UTC (rev 7661) +++ trunk/foray/foray-areatree/src/java/org/foray/area/TableRA.java 2006-06-17 01:00:18 UTC (rev 7662) @@ -296,7 +296,7 @@ /** * {@inheritDoc} */ - public org.axsl.areaR.Area[] getBackgroundAreas() { + public org.axsl.areaR.BackgroundArea[] getBackgroundAreas() { /* TODO: Implement this. See the method javadoc for details. */ 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-17 00:35:54
|
Revision: 7661 Author: victormote Date: 2006-06-16 17:35:48 -0700 (Fri, 16 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7661&view=rev Log Message: ----------- Conform to axsl changes: 1. Remove TableBodyContainer, TableFooterContainer, and TableHeaderContainer interfaces. 2. Add BackgroundArea interface to replace these three. 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-17 00:35:39 UTC (rev 7660) +++ trunk/foray/foray-render/src/java/org/foray/render/Renderer.java 2006-06-17 00:35:48 UTC (rev 7661) @@ -61,10 +61,7 @@ import org.axsl.areaR.SVGArea; import org.axsl.areaR.SpanArea; import org.axsl.areaR.TableArea; -import org.axsl.areaR.TableBodyContainer; import org.axsl.areaR.TableCellArea; -import org.axsl.areaR.TableFooterContainer; -import org.axsl.areaR.TableHeaderContainer; import org.axsl.areaR.TableRowContainer; import org.axsl.areaR.TextArea; import org.axsl.graphicR.Graphic; @@ -426,21 +423,6 @@ renderChildren(area); } - public void render(TableBodyContainer area) { - markBackground(area); - renderChildren(area); - } - - public void render(TableHeaderContainer area) { - markBackground(area); - renderChildren(area); - } - - public void render(TableFooterContainer area) { - markBackground(area); - renderChildren(area); - } - /** * render area container * 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-17 00:35:39 UTC (rev 7660) +++ trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java 2006-06-17 00:35:48 UTC (rev 7661) @@ -56,10 +56,7 @@ import org.axsl.areaR.SVGArea; import org.axsl.areaR.SpanArea; import org.axsl.areaR.TableArea; -import org.axsl.areaR.TableBodyContainer; import org.axsl.areaR.TableCellArea; -import org.axsl.areaR.TableFooterContainer; -import org.axsl.areaR.TableHeaderContainer; import org.axsl.areaR.TableRowContainer; import org.axsl.areaR.TextArea; import org.axsl.common.Constants; @@ -511,36 +508,6 @@ writeEndTag(area); } - public void render(TableHeaderContainer area) { - StringBuffer buffer = new StringBuffer(); - outputGeneratedBy(area, buffer); - outputDimension(area, buffer); - writeStartTag(area, buffer); - outputAllRectangles(area); - renderChildren(area); - writeEndTag(area); - } - - public void render(TableFooterContainer area) { - StringBuffer buffer = new StringBuffer(); - outputGeneratedBy(area, buffer); - outputDimension(area, buffer); - writeStartTag(area, buffer); - outputAllRectangles(area); - renderChildren(area); - writeEndTag(area); - } - - public void render(TableBodyContainer area) { - StringBuffer buffer = new StringBuffer(); - outputGeneratedBy(area, buffer); - outputDimension(area, buffer); - writeStartTag(area, buffer); - outputAllRectangles(area); - renderChildren(area); - writeEndTag(area); - } - public void render(TableRowContainer area) { StringBuffer buffer = new StringBuffer(); outputGeneratedBy(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-17 00:35:45
|
Revision: 7660 Author: victormote Date: 2006-06-16 17:35:39 -0700 (Fri, 16 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7660&view=rev Log Message: ----------- Conform to axsl changes: 1. Remove TableBodyContainer, TableFooterContainer, and TableHeaderContainer interfaces. 2. Add BackgroundArea interface to replace these three. Modified Paths: -------------- 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/TableBodyContainer.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/TableBodyContainer.java 2006-06-17 00:05:15 UTC (rev 7659) +++ trunk/foray/foray-areatree/src/java/org/foray/area/TableBodyContainer.java 2006-06-17 00:35:39 UTC (rev 7660) @@ -29,7 +29,7 @@ import org.axsl.foR.fo.RetrieveMarker; public class TableBodyContainer extends AbstractTableContainer - implements org.axsl.areaR.TableBodyContainer, + implements org.axsl.areaR.BackgroundArea, org.axsl.areaW.TableBodyContainer { public TableBodyContainer(FObj generatedBy, Area parentArea, 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-17 00:05:15 UTC (rev 7659) +++ trunk/foray/foray-areatree/src/java/org/foray/area/TableFooterContainer.java 2006-06-17 00:35:39 UTC (rev 7660) @@ -29,7 +29,7 @@ import org.axsl.foR.fo.RetrieveMarker; public class TableFooterContainer extends AbstractTableContainer - implements org.axsl.areaR.TableFooterContainer, + implements org.axsl.areaR.BackgroundArea, org.axsl.areaW.TableFooterContainer { public TableFooterContainer(FObj generatedBy, Area parentArea, 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-17 00:05:15 UTC (rev 7659) +++ trunk/foray/foray-areatree/src/java/org/foray/area/TableHeaderContainer.java 2006-06-17 00:35:39 UTC (rev 7660) @@ -29,7 +29,7 @@ import org.axsl.foR.fo.RetrieveMarker; public class TableHeaderContainer extends AbstractTableContainer - implements org.axsl.areaR.TableHeaderContainer, + implements org.axsl.areaR.BackgroundArea, org.axsl.areaW.TableHeaderContainer { public TableHeaderContainer(FObj generatedBy, Area parentArea, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-17 00:05:19
|
Revision: 7659 Author: victormote Date: 2006-06-16 17:05:15 -0700 (Fri, 16 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7659&view=rev Log Message: ----------- Simplify rendering by ignoring the various table-related container items and letting them pass through the Visitor logic as AreaNodes. 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-16 23:18:04 UTC (rev 7658) +++ trunk/foray/foray-render/src/java/org/foray/render/Renderer.java 2006-06-17 00:05:15 UTC (rev 7659) @@ -418,29 +418,7 @@ * as possible. Contiguous cells that have identical borders should have * their borders painted at the same time. */ doFrame(area); - List children = area.getChildren(); - - // First process the table-header - for (int i = 0; i < children.size(); i++) { - Area child = (Area)children.get(i); - if (child instanceof TableHeaderContainer) { - render((TableHeaderContainer) child); - } - } - // Then process all of the table-body - for (int i = 0; i < children.size(); i++) { - Area child = (Area)children.get(i); - if (child instanceof TableBodyContainer) { - render((TableBodyContainer) child); - } - } - // Then process the table-footer - for (int i = 0; i < children.size(); i++) { - Area child = (Area)children.get(i); - if (child instanceof TableFooterContainer) { - render((TableFooterContainer) child); - } - } + renderChildren(area); } public void render(TableRowContainer area) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-16 23:18:08
|
Revision: 7658 Author: victormote Date: 2006-06-16 16:18:04 -0700 (Fri, 16 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7658&view=rev Log Message: ----------- Conform to axsl change: Remove unnecessary interface. 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-16 23:17:55 UTC (rev 7657) +++ trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java 2006-06-16 23:18:04 UTC (rev 7658) @@ -34,7 +34,6 @@ import org.foray.render.Renderer; 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; @@ -684,11 +683,11 @@ outputAttribute(buffer, "rry", area.rrOriginY()); } - public void outputDimension(AreaFlexible area, StringBuffer buffer) { + public void outputDimension(Area area, StringBuffer buffer) { outputAttribute(buffer, "dim", area.getProgressionDimension()); } - public void outputColor(AreaFlexible area, StringBuffer buffer) { + public void outputColor(Area area, StringBuffer buffer) { String color = area.getColor().getRed() / 255 + ", " + area.getColor().getGreen() / 255 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-16 23:18:02
|
Revision: 7657 Author: victormote Date: 2006-06-16 16:17:55 -0700 (Fri, 16 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7657&view=rev Log Message: ----------- Conform to axsl change: Remove unnecessary interface. Modified Paths: -------------- trunk/foray/foray-areatree/src/java/org/foray/area/AbstractNormalBlockArea.java trunk/foray/foray-areatree/src/java/org/foray/area/AreaFlexible.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-16 22:57:51 UTC (rev 7656) +++ trunk/foray/foray-areatree/src/java/org/foray/area/AbstractNormalBlockArea.java 2006-06-16 23:17:55 UTC (rev 7657) @@ -33,7 +33,7 @@ * */ public abstract class AbstractNormalBlockArea extends BlockArea - implements org.axsl.areaR.AreaFlexible, + implements org.axsl.areaR.Area, org.axsl.areaW.AbstractNormalBlockArea { public AbstractNormalBlockArea(FObj parentFObj, Area parentArea, 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-16 22:57:51 UTC (rev 7656) +++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaFlexible.java 2006-06-16 23:17:55 UTC (rev 7657) @@ -34,8 +34,7 @@ * Subclasses are areas that need to store their own size and spacing * information. The opposite of AreaFlexible is {@link AreaFixed}. */ -public abstract class AreaFlexible extends Area - implements org.axsl.areaR.AreaFlexible { +public abstract class AreaFlexible extends Area { /** * See {@link #getProgressionDimension()} for a description of This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-16 22:57:55
|
Revision: 7656 Author: victormote Date: 2006-06-16 15:57:51 -0700 (Fri, 16 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7656&view=rev Log Message: ----------- Conform to axsl change: Remove unneeded interface. Modified Paths: -------------- trunk/foray/foray-areatree/src/java/org/foray/area/AbstractNormalBlockArea.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-16 22:52:37 UTC (rev 7655) +++ trunk/foray/foray-areatree/src/java/org/foray/area/AbstractNormalBlockArea.java 2006-06-16 22:57:51 UTC (rev 7656) @@ -33,7 +33,7 @@ * */ public abstract class AbstractNormalBlockArea extends BlockArea - implements org.axsl.areaR.AbstractNormalBlockArea, + implements org.axsl.areaR.AreaFlexible, org.axsl.areaW.AbstractNormalBlockArea { public AbstractNormalBlockArea(FObj parentFObj, Area parentArea, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-16 22:52:42
|
Revision: 7655 Author: victormote Date: 2006-06-16 15:52:37 -0700 (Fri, 16 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7655&view=rev Log Message: ----------- Conform to axsl changes: Remove unneeded method. Let the Area Tree worry about the vertical alignment of its LineAreas. Modified Paths: -------------- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/BlockPL.java trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FOTextPL.java Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/BlockPL.java =================================================================== --- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/BlockPL.java 2006-06-16 22:49:37 UTC (rev 7654) +++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/BlockPL.java 2006-06-16 22:52:37 UTC (rev 7655) @@ -174,7 +174,6 @@ if (this.currentLineArea == null) { return; } - this.currentLineArea.verticalAlign(); this.currentLineArea = null; } Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FOTextPL.java =================================================================== --- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FOTextPL.java 2006-06-16 22:49:37 UTC (rev 7654) +++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FOTextPL.java 2006-06-16 22:52:37 UTC (rev 7655) @@ -81,7 +81,6 @@ start = addTextItemToLine(la, lineText, start, end, retrieveMarker); while (start != -1) { BlockPL blockPL = this.layout.getBlockPL(ba); - blockPL.getCurrentLineArea(ba).verticalAlign(); la = ba.createNextLineArea(false); blockPL.currentLineArea = la; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-16 22:49:47
|
Revision: 7654 Author: victormote Date: 2006-06-16 15:49:37 -0700 (Fri, 16 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7654&view=rev Log Message: ----------- Have each inline area notify its parent line area when it is added to the line. Modified Paths: -------------- trunk/foray/foray-areatree/src/java/org/foray/area/ExternalGraphicArea.java trunk/foray/foray-areatree/src/java/org/foray/area/ForeignObjectArea.java trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberArea.java trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberCitationArea.java trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java 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-16 22:33:49 UTC (rev 7653) +++ trunk/foray/foray-areatree/src/java/org/foray/area/ExternalGraphicArea.java 2006-06-16 22:49:37 UTC (rev 7654) @@ -55,6 +55,7 @@ setProgressionDimension(width); // Adjust the bpd of the parent line-area. parentArea.setMinimumProgressionDimension(viewportBPD()); + this.ancestorLineArea().lineContentChanged(); } public Graphic getGraphic() { 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-16 22:33:49 UTC (rev 7653) +++ trunk/foray/foray-areatree/src/java/org/foray/area/ForeignObjectArea.java 2006-06-16 22:49:37 UTC (rev 7654) @@ -58,6 +58,7 @@ if (foreign instanceof SVGElement) { new SVGArea((SVGElement) foreign, this, retrieveMarker); } + this.ancestorLineArea().lineContentChanged(); } public boolean traitIsReferenceArea() { 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-16 22:33:49 UTC (rev 7653) +++ trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java 2006-06-16 22:49:37 UTC (rev 7654) @@ -80,6 +80,7 @@ */ private void init(int initialProgressionDimension) { setProgressionDimension(initialProgressionDimension); + this.ancestorLineArea().lineContentChanged(); } /** 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-16 22:33:49 UTC (rev 7653) +++ trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2006-06-16 22:49:37 UTC (rev 7654) @@ -981,4 +981,12 @@ visitor.render(this); } + /** + * Tell the LineArea that its content has changed, so that it can make any + * adjustments it thinks are necessary. + */ + public void lineContentChanged() { + this.verticalAlign(); + } + } 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-16 22:33:49 UTC (rev 7653) +++ trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberArea.java 2006-06-16 22:49:37 UTC (rev 7654) @@ -52,6 +52,7 @@ */ private void init(int width) { setProgressionDimension(width); + this.ancestorLineArea().lineContentChanged(); } public String resolve() { 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-16 22:33:49 UTC (rev 7653) +++ trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberCitationArea.java 2006-06-16 22:49:37 UTC (rev 7654) @@ -50,6 +50,7 @@ */ private void init(int width) { setProgressionDimension(width); + this.ancestorLineArea().lineContentChanged(); } public String resolve() { 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-16 22:33:49 UTC (rev 7653) +++ trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java 2006-06-16 22:49:37 UTC (rev 7654) @@ -135,6 +135,7 @@ this.hasDiscretionaryHyphen = hasDiscretionaryHyphen; this.hasFauxSmallCaps = hasFauxSmallCaps; setProgressionDimension(progressionDimensionUsed); + this.ancestorLineArea().lineContentChanged(); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-16 22:34:02
|
Revision: 7653 Author: victormote Date: 2006-06-16 15:33:49 -0700 (Fri, 16 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7653&view=rev Log Message: ----------- Only allow inline items to be laid out on lines or in other inline items. Modified Paths: -------------- trunk/foray/foray-areatree/src/java/org/foray/area/AbstractInlineArea.java trunk/foray/foray-areatree/src/java/org/foray/area/BasicLinkArea.java trunk/foray/foray-areatree/src/java/org/foray/area/ExternalGraphicArea.java trunk/foray/foray-areatree/src/java/org/foray/area/ForeignObjectArea.java trunk/foray/foray-areatree/src/java/org/foray/area/InlineArea.java trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberArea.java trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberCitationArea.java trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AbstractInlineArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/AbstractInlineArea.java 2006-06-16 18:59:43 UTC (rev 7652) +++ trunk/foray/foray-areatree/src/java/org/foray/area/AbstractInlineArea.java 2006-06-16 22:33:49 UTC (rev 7653) @@ -38,12 +38,29 @@ public abstract class AbstractInlineArea extends AreaFlexible implements GeneralInlineArea { - public AbstractInlineArea(FONode generatedBy, Area parentArea, + /** + * Constructor for inline content being added to a LineArea. + * @param generatedBy + * @param parentArea + * @param retrieveMarker + */ + public AbstractInlineArea(FONode generatedBy, LineArea parentArea, RetrieveMarker retrieveMarker) { super(generatedBy, parentArea, retrieveMarker); } /** + * Constructor for inline content being added to another inline area. + * @param generatedBy + * @param parentArea + * @param retrieveMarker + */ + public AbstractInlineArea(FONode generatedBy, AbstractInlineArea parentArea, + RetrieveMarker retrieveMarker) { + super(generatedBy, parentArea, retrieveMarker); + } + + /** * {@inheritDoc} */ public boolean isBlockArea() { 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-16 18:59:43 UTC (rev 7652) +++ trunk/foray/foray-areatree/src/java/org/foray/area/BasicLinkArea.java 2006-06-16 22:33:49 UTC (rev 7653) @@ -35,7 +35,7 @@ implements org.axsl.areaR.BasicLinkArea, org.axsl.areaW.BasicLinkArea { - public BasicLinkArea(BasicLink generatedBy, Area parentArea, + public BasicLinkArea(BasicLink generatedBy, LineArea parentArea, RetrieveMarker retrieveMarker) { super(generatedBy, parentArea, retrieveMarker); } 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-16 18:59:43 UTC (rev 7652) +++ trunk/foray/foray-areatree/src/java/org/foray/area/ExternalGraphicArea.java 2006-06-16 22:33:49 UTC (rev 7653) @@ -34,9 +34,24 @@ implements org.axsl.areaR.ExternalGraphicArea, org.axsl.areaW.ExternalGraphicArea { - public ExternalGraphicArea(ExternalGraphic generatedBy, Area parentArea, + public ExternalGraphicArea(ExternalGraphic generatedBy, LineArea parentArea, RetrieveMarker retrieveMarker, int width) { super(generatedBy, parentArea, retrieveMarker); + init(parentArea, width); + } + + public ExternalGraphicArea(ExternalGraphic generatedBy, + AbstractInlineArea parentArea, RetrieveMarker retrieveMarker, + int width) { + super(generatedBy, parentArea, retrieveMarker); + init(parentArea, width); + } + + /** + * @param parentArea + * @param width + */ + private void init(Area parentArea, int width) { setProgressionDimension(width); // Adjust the bpd of the parent line-area. parentArea.setMinimumProgressionDimension(viewportBPD()); 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-16 18:59:43 UTC (rev 7652) +++ trunk/foray/foray-areatree/src/java/org/foray/area/ForeignObjectArea.java 2006-06-16 22:33:49 UTC (rev 7653) @@ -35,8 +35,20 @@ org.axsl.areaW.ForeignObjectArea { public ForeignObjectArea(InstreamForeignObject generatedBy, - Area parentArea, RetrieveMarker retrieveMarker, int width) { + LineArea parentArea, RetrieveMarker retrieveMarker, int width) { super(generatedBy, parentArea, retrieveMarker); + init(generatedBy, parentArea, retrieveMarker, width); + } + + public ForeignObjectArea(InstreamForeignObject generatedBy, + AbstractInlineArea parentArea, RetrieveMarker retrieveMarker, + int width) { + super(generatedBy, parentArea, retrieveMarker); + init(generatedBy, parentArea, retrieveMarker, width); + } + + private void init(InstreamForeignObject generatedBy, Area parentArea, + RetrieveMarker retrieveMarker, int width) { setProgressionDimension(width); // Adjust the bpd of the parent line-area. parentArea.setMinimumProgressionDimension(viewportBPD()); 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-16 18:59:43 UTC (rev 7652) +++ trunk/foray/foray-areatree/src/java/org/foray/area/InlineArea.java 2006-06-16 22:33:49 UTC (rev 7653) @@ -41,7 +41,7 @@ implements org.axsl.areaR.InlineArea, org.axsl.areaW.InlineArea { - public InlineArea(Inline generatedBy, Area parentArea, + public InlineArea(Inline generatedBy, LineArea parentArea, RetrieveMarker retrieveMarker) { super(generatedBy, parentArea, retrieveMarker); } 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-16 18:59:43 UTC (rev 7652) +++ trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java 2006-06-16 22:33:49 UTC (rev 7653) @@ -63,9 +63,22 @@ implements org.axsl.areaR.LeaderArea, org.axsl.areaW.LeaderArea { - public LeaderArea(Leader generatedBy, Area parentArea, + public LeaderArea(Leader generatedBy, LineArea parentArea, RetrieveMarker retrieveMarker, int initialProgressionDimension) { super(generatedBy, parentArea, retrieveMarker); + init(initialProgressionDimension); + } + + public LeaderArea(Leader generatedBy, AbstractInlineArea parentArea, + RetrieveMarker retrieveMarker, int initialProgressionDimension) { + super(generatedBy, parentArea, retrieveMarker); + init(initialProgressionDimension); + } + + /** + * @param initialProgressionDimension + */ + private void init(int initialProgressionDimension) { setProgressionDimension(initialProgressionDimension); } 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-16 18:59:43 UTC (rev 7652) +++ trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2006-06-16 22:33:49 UTC (rev 7653) @@ -777,46 +777,102 @@ } public static org.axsl.areaW.ForeignObjectArea makeForeignObjectArea( - InstreamForeignObject ifo, Area parentArea, int ipd, + InstreamForeignObject ifo, LineArea parentArea, int ipd, RetrieveMarker retrieveMarker) { return new ForeignObjectArea(ifo, parentArea, retrieveMarker, ipd); } + public static org.axsl.areaW.ForeignObjectArea makeForeignObjectArea( + InstreamForeignObject ifo, AbstractInlineArea parentArea, int ipd, + RetrieveMarker retrieveMarker) { + return new ForeignObjectArea(ifo, parentArea, retrieveMarker, ipd); + } + public static org.axsl.areaW.ExternalGraphicArea makeExternalGraphicArea( - ExternalGraphic ifo, Area parentArea, int ipd, + ExternalGraphic ifo, LineArea parentArea, int ipd, RetrieveMarker retrieveMarker) { return new ExternalGraphicArea(ifo, parentArea, retrieveMarker, ipd); } + public static org.axsl.areaW.ExternalGraphicArea makeExternalGraphicArea( + ExternalGraphic ifo, AbstractInlineArea parentArea, int ipd, + RetrieveMarker retrieveMarker) { + return new ExternalGraphicArea(ifo, parentArea, retrieveMarker, ipd); + } + public static org.axsl.areaW.LeaderArea makeLeaderArea( - Leader leader, Area parentArea, int ipd, + Leader leader, LineArea parentArea, int ipd, RetrieveMarker retrieveMarker) { return new LeaderArea(leader, parentArea, retrieveMarker, ipd); } + public static org.axsl.areaW.LeaderArea makeLeaderArea( + Leader leader, AbstractInlineArea parentArea, int ipd, + RetrieveMarker retrieveMarker) { + return new LeaderArea(leader, parentArea, retrieveMarker, ipd); + } + public static org.axsl.areaW.PageNumberArea makePageNumberArea( - PageNumber pageNumber, Area parentArea, int ipd, + PageNumber pageNumber, LineArea parentArea, int ipd, RetrieveMarker retrieveMarker) { return new PageNumberArea(pageNumber, parentArea, retrieveMarker, ipd); } + public static org.axsl.areaW.PageNumberArea makePageNumberArea( + PageNumber pageNumber, AbstractInlineArea parentArea, int ipd, + RetrieveMarker retrieveMarker) { + return new PageNumberArea(pageNumber, parentArea, retrieveMarker, ipd); + } + public static org.axsl.areaW.PageNumberCitationArea - makePageNumberCitationArea( - PageNumberCitation citation, Area parentArea, int ipd, + makePageNumberCitationArea(PageNumberCitation citation, LineArea parentArea, + int ipd, RetrieveMarker retrieveMarker) { + return new PageNumberCitationArea(citation, parentArea, retrieveMarker, + ipd); + } + + public static org.axsl.areaW.PageNumberCitationArea + makePageNumberCitationArea(PageNumberCitation citation, + AbstractInlineArea parentArea, int ipd, RetrieveMarker retrieveMarker) { return new PageNumberCitationArea(citation, parentArea, retrieveMarker, ipd); } public static org.axsl.areaW.TextArea makeTextArea(FOTextContent foText, - Area parentArea, int ipd, + LineArea parentArea, int ipd, int startOffset, int sizeInChars, boolean hasDiscretionaryHyphen, boolean hasFauxSmallCaps, boolean isLastItemOnLine, FOContext context, RetrieveMarker retrieveMarker) { + if (shouldCreateTextArea(foText, parentArea, startOffset, sizeInChars, + isLastItemOnLine, context)) { + return new TextArea(foText, parentArea, retrieveMarker, startOffset, + sizeInChars, ipd, hasDiscretionaryHyphen, hasFauxSmallCaps); + } + return null; + } + + public static org.axsl.areaW.TextArea makeTextArea(FOTextContent foText, + AbstractInlineArea parentArea, int ipd, + int startOffset, int sizeInChars, boolean hasDiscretionaryHyphen, + boolean hasFauxSmallCaps, boolean isLastItemOnLine, + FOContext context, RetrieveMarker retrieveMarker) { + + if (shouldCreateTextArea(foText, parentArea, startOffset, sizeInChars, + isLastItemOnLine, context)) { + return new TextArea(foText, parentArea, retrieveMarker, startOffset, + sizeInChars, ipd, hasDiscretionaryHyphen, hasFauxSmallCaps); + } + return null; + } + + private static boolean shouldCreateTextArea(FOTextContent foText, + Area parentArea, int startOffset, int sizeInChars, + boolean isLastItemOnLine, FOContext context) { /* If the raw text is empty, don't create the TextArea. */ if (sizeInChars < 1) { - return null; + return false; } /* If the final text will be empty, don't create the TextArea. */ @@ -829,12 +885,9 @@ sizeInChars, isLastItemOnLine, parentArea.traitWhiteSpaceTreatment()); if (ignoreAtStart + ignoreAtEnd >= sizeInChars) { - return null; + return false; } - - /* Go ahead and create*/ - return new TextArea(foText, parentArea, retrieveMarker, startOffset, - sizeInChars, ipd, hasDiscretionaryHyphen, hasFauxSmallCaps); + return true; } public org.axsl.areaW.ForeignObjectArea makeForeignObjectArea( 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-16 18:59:43 UTC (rev 7652) +++ trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberArea.java 2006-06-16 22:33:49 UTC (rev 7653) @@ -35,9 +35,22 @@ implements org.axsl.areaR.PageNumberArea, org.axsl.areaW.PageNumberArea { - public PageNumberArea(FObj generatedBy, Area parentArea, + public PageNumberArea(FObj generatedBy, LineArea parentArea, RetrieveMarker retrieveMarker, int width) { super(generatedBy, parentArea, retrieveMarker); + init(width); + } + + public PageNumberArea(FObj generatedBy, AbstractInlineArea parentArea, + RetrieveMarker retrieveMarker, int width) { + super(generatedBy, parentArea, retrieveMarker); + init(width); + } + + /** + * @param width + */ + private void init(int width) { setProgressionDimension(width); } 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-16 18:59:43 UTC (rev 7652) +++ trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberCitationArea.java 2006-06-16 22:33:49 UTC (rev 7653) @@ -32,9 +32,23 @@ implements org.axsl.areaR.PageNumberCitationArea, org.axsl.areaW.PageNumberCitationArea { - public PageNumberCitationArea(FObj generatedBy, Area parentArea, + public PageNumberCitationArea(FObj generatedBy, LineArea parentArea, RetrieveMarker retrieveMarker, int width) { super(generatedBy, parentArea, retrieveMarker); + init(width); + } + + public PageNumberCitationArea(FObj generatedBy, + AbstractInlineArea parentArea, RetrieveMarker retrieveMarker, + int width) { + super(generatedBy, parentArea, retrieveMarker); + init(width); + } + + /** + * @param width + */ + private void init(int width) { setProgressionDimension(width); } 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-16 18:59:43 UTC (rev 7652) +++ trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java 2006-06-16 22:33:49 UTC (rev 7653) @@ -99,11 +99,35 @@ */ boolean hasFauxSmallCaps = false; - public TextArea(FOTextContent generatedBy, Area parentArea, + public TextArea(FOTextContent generatedBy, LineArea parentArea, RetrieveMarker retrieveMarker, int backingOffset, int backingSize, int progressionDimensionUsed, boolean hasDiscretionaryHyphen, boolean hasFauxSmallCaps) { super(generatedBy, parentArea, retrieveMarker); + init(parentArea, backingOffset, backingSize, progressionDimensionUsed, + hasDiscretionaryHyphen, hasFauxSmallCaps); + } + + public TextArea(FOTextContent generatedBy, AbstractInlineArea parentArea, + RetrieveMarker retrieveMarker, int backingOffset, int backingSize, + int progressionDimensionUsed, boolean hasDiscretionaryHyphen, + boolean hasFauxSmallCaps) { + super(generatedBy, parentArea, retrieveMarker); + init(parentArea, backingOffset, backingSize, progressionDimensionUsed, + hasDiscretionaryHyphen, hasFauxSmallCaps); + } + + /** + * @param parentArea + * @param backingOffset + * @param backingSize + * @param progressionDimensionUsed + * @param hasDiscretionaryHyphen + * @param hasFauxSmallCaps + */ + private void init(Area parentArea, int backingOffset, int backingSize, + int progressionDimensionUsed, boolean hasDiscretionaryHyphen, + boolean hasFauxSmallCaps) { this.backingOffset = backingOffset; this.backingSize = backingSize; this.resolvedLetterSpacing = parentArea.traitLetterSpacingOpt(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-16 18:59:48
|
Revision: 7652 Author: victormote Date: 2006-06-16 11:59:43 -0700 (Fri, 16 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7652&view=rev Log Message: ----------- Use static variable to avoid creating multiple instances of the same DtColor. Modified Paths: -------------- trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtColor.java Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtColor.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtColor.java 2006-06-16 18:37:46 UTC (rev 7651) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtColor.java 2006-06-16 18:59:43 UTC (rev 7652) @@ -287,7 +287,9 @@ return foundColor; } /* Otherwise, create a new instance. */ - return new DtColor(color); + DtColor newDtColor = new DtColor(color); + DtColor.colorsUsed.add(newDtColor); + return newDtColor; } public static DtColor makeDtColor(float red, float green, float blue, @@ -300,7 +302,9 @@ } /* Otherwise, create a new instance. */ Color newColor = new Color(red, green, blue, alpha); - return new DtColor(newColor); + DtColor newDtColor = new DtColor(newColor); + DtColor.colorsUsed.add(newDtColor); + return newDtColor; } /** @@ -480,8 +484,8 @@ return foundColor; } } - Color newColor = new Color(red, green, blue, alpha); - return new DtColor(newColor); + DtColor dtColor = DtColor.makeDtColor(red, green, blue, alpha); + return dtColor; } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-16 18:37:52
|
Revision: 7651 Author: victormote Date: 2006-06-16 11:37:46 -0700 (Fri, 16 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7651&view=rev Log Message: ----------- Fix ugly static initialization problem. Modified Paths: -------------- trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtColor.java Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtColor.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtColor.java 2006-06-16 17:36:25 UTC (rev 7650) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtColor.java 2006-06-16 18:37:46 UTC (rev 7651) @@ -242,7 +242,7 @@ * TODO: Sort this by the numeric color value stored in the java.awt.Color * so that a binary search can be used. */ - private static ArrayList colorsUsed = new ArrayList(20); + private static ArrayList colorsUsed; private Color value; @@ -311,8 +311,8 @@ * if it has not yet been created. */ private static DtColor findColor(Color color) { - for (int i = 0; i < DtColor.colorsUsed.size(); i++) { - DtColor usedColor = (DtColor) DtColor.colorsUsed.get(i); + for (int i = 0; i < DtColor.getColorsUsed().size(); i++) { + DtColor usedColor = (DtColor) DtColor.getColorsUsed().get(i); if (usedColor.value.equals(color)) { return usedColor; } @@ -332,8 +332,8 @@ */ private static DtColor findColor(float red, float green, float blue, float alpha) { - for (int i = 0; i < DtColor.colorsUsed.size(); i++) { - DtColor usedColor = (DtColor) DtColor.colorsUsed.get(i); + for (int i = 0; i < DtColor.getColorsUsed().size(); i++) { + DtColor usedColor = (DtColor) DtColor.getColorsUsed().get(i); Color colorValue = usedColor.value; float[] components = colorValue.getRGBComponents(null); if (components == null @@ -350,6 +350,14 @@ return null; } + private static ArrayList getColorsUsed() { + if (DtColor.colorsUsed == null) { + /* For some reason, this won't initialize when declared. */ + DtColor.colorsUsed = new ArrayList(20); + } + return DtColor.colorsUsed; + } + public static DtColor mapNameToColorRGB(String colorName) { // Do a binary search to find the name in the names list. int index = Arrays.binarySearch(names, colorName); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-16 17:36:36
|
Revision: 7650 Author: victormote Date: 2006-06-16 10:36:25 -0700 (Fri, 16 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7650&view=rev Log Message: ----------- 1. Add factory method for the components. 2. Rename factory methods for consistency. Modified Paths: -------------- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Background.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderColor.java trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtColor.java trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtShadowEffect.java Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Background.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Background.java 2006-06-16 16:50:40 UTC (rev 7649) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Background.java 2006-06-16 17:36:25 UTC (rev 7650) @@ -202,7 +202,7 @@ if (keyword > -1) { return Constants.FOPROP_BACKGROUND_POSITION; } - DtColor color = DtColor.makeColorDT(input); + DtColor color = DtColor.makeDtColor(input); if (color != null) { return Constants.FOPROP_BACKGROUND_COLOR; } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderColor.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderColor.java 2006-06-16 16:50:40 UTC (rev 7649) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderColor.java 2006-06-16 17:36:25 UTC (rev 7650) @@ -60,7 +60,7 @@ public PropertyValue createPropertyValue(PropertyList propertyList, short enumeration, String value) throws PropertyException { - DtColor color = DtColor.makeColorDT(value); + DtColor color = DtColor.makeDtColor(value); if (color != null) { return color; } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtColor.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtColor.java 2006-06-16 16:50:40 UTC (rev 7649) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtColor.java 2006-06-16 17:36:25 UTC (rev 7650) @@ -27,11 +27,18 @@ import org.foray.fotree.PropertyException; import java.awt.Color; +import java.util.ArrayList; import java.util.Arrays; import java.util.StringTokenizer; /** - * A "color" property datatype in XSL-FO. See XSL-FO Std. 1.0, Sec. 5.11. + * <p>A "color" property datatype in XSL-FO. See XSL-FO Std. 1.0, Sec. 5.11.</p> + * + * <p>To prevent creation of multiple instances for the same underlying color, + * the constructor is private. + * To obtain an instance, use one of the following static methods instead: + * {@link #makeDtColor(String)}, {@link #makeDtColor(Color)}, or + * {@link #makeDtColor(float, float, float, float)}.</p> */ public class DtColor extends Datatype implements ExprColor { @@ -69,22 +76,22 @@ * the color values. */ private static final DtColor[] vals = { - makeColorDT(new Color(0, 255, 255)), // aqua - makeColorDT(new Color(0, 0, 0)), // black - makeColorDT(new Color(0, 0, 255)), // blue - makeColorDT(new Color(255, 0, 255)), // fuchsia - makeColorDT(new Color(128, 128, 128)), // gray - makeColorDT(new Color(0, 128, 0)), // green - makeColorDT(new Color(0, 255, 0)), // lime - makeColorDT(new Color(128, 0, 0)), // maroon - makeColorDT(new Color(0, 0, 128)), // navy - makeColorDT(new Color(128, 128, 0)), // olive - makeColorDT(new Color(128, 0, 128)), // purple - makeColorDT(new Color(255, 0, 0)), // red - makeColorDT(new Color(192, 192, 192)), // silver - makeColorDT(new Color(0, 128, 128)), // teal - makeColorDT(new Color(255, 255, 255)), // white - makeColorDT(new Color(255, 255, 0)), // yellow + makeDtColor(new Color(0, 255, 255)), // aqua + makeDtColor(new Color(0, 0, 0)), // black + makeDtColor(new Color(0, 0, 255)), // blue + makeDtColor(new Color(255, 0, 255)), // fuchsia + makeDtColor(new Color(128, 128, 128)), // gray + makeDtColor(new Color(0, 128, 0)), // green + makeDtColor(new Color(0, 255, 0)), // lime + makeDtColor(new Color(128, 0, 0)), // maroon + makeDtColor(new Color(0, 0, 128)), // navy + makeDtColor(new Color(128, 128, 0)), // olive + makeDtColor(new Color(128, 0, 128)), // purple + makeDtColor(new Color(255, 0, 0)), // red + makeDtColor(new Color(192, 192, 192)), // silver + makeDtColor(new Color(0, 128, 128)), // teal + makeDtColor(new Color(255, 255, 255)), // white + makeDtColor(new Color(255, 255, 0)), // yellow }; /* @@ -229,11 +236,20 @@ public static final Color COLOR_RGB_TRANSPARENT = new Color(255, 255, 255, 0); + /** + * List of DtColor instances created. The purpose of this list is to + * prevent identical colors from being created more than once. + * TODO: Sort this by the numeric color value stored in the java.awt.Color + * so that a binary search can be used. + */ + private static ArrayList colorsUsed = new ArrayList(20); + private Color value; /** * Private Constructor. Use one of the following static methods instead: - * {@link #makeColorDT(String)}. + * {@link #makeDtColor(String)}, {@link #makeDtColor(Color)}, or + * {@link #makeDtColor(float, float, float, float)}. */ private DtColor(Color color) { this.value = color; @@ -257,14 +273,83 @@ * @return A ColorDT instance, or null if input is not a defined XSL-FO * named color. */ - public static DtColor makeColorDT(String input) { + public static DtColor makeDtColor(String input) { + /* The names colors are static instances anyway, so no need to check + * the list of used colors. */ return mapNameToColorRGB(input); } - public static DtColor makeColorDT(Color color) { + public static DtColor makeDtColor(Color color) { + DtColor foundColor = DtColor.findColor(color); + /* If it has already been created, return the previously-created + * instance. */ + if (foundColor != null) { + return foundColor; + } + /* Otherwise, create a new instance. */ return new DtColor(color); } + public static DtColor makeDtColor(float red, float green, float blue, + float alpha) { + DtColor foundColor = DtColor.findColor(red, green, blue, alpha); + /* If it has already been created, return the previously-created + * instance. */ + if (foundColor != null) { + return foundColor; + } + /* Otherwise, create a new instance. */ + Color newColor = new Color(red, green, blue, alpha); + return new DtColor(newColor); + } + + /** + * Looks for a given color in the list of used colors to see if it has + * already been created. + * @param color The color sought in the list of used colors. + * @return The already-created instance for <code>color</code>, or null + * if it has not yet been created. + */ + private static DtColor findColor(Color color) { + for (int i = 0; i < DtColor.colorsUsed.size(); i++) { + DtColor usedColor = (DtColor) DtColor.colorsUsed.get(i); + if (usedColor.value.equals(color)) { + return usedColor; + } + } + return null; + } + + /** + * Looks for a given color in the list of used colors to see if it has + * already been created. + * @param red The red component of the color sought. + * @param green The green component of the color sought. + * @param blue The blue component of the color sought. + * @param alpha The alpha component of the color sought. + * @return The already-created instance, or null if it has not yet been + * created. + */ + private static DtColor findColor(float red, float green, float blue, + float alpha) { + for (int i = 0; i < DtColor.colorsUsed.size(); i++) { + DtColor usedColor = (DtColor) DtColor.colorsUsed.get(i); + Color colorValue = usedColor.value; + float[] components = colorValue.getRGBComponents(null); + if (components == null + || components.length != 4) { + continue; + } + if (components[0] == red + && components[1] == green + && components[2] == blue + && components[3] == alpha) { + return usedColor; + } + } + return null; + } + public static DtColor mapNameToColorRGB(String colorName) { // Do a binary search to find the name in the names list. int index = Arrays.binarySearch(names, colorName); Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtShadowEffect.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtShadowEffect.java 2006-06-16 16:50:40 UTC (rev 7649) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtShadowEffect.java 2006-06-16 17:36:25 UTC (rev 7650) @@ -101,7 +101,7 @@ } for (int i = 0; i < st.countTokens(); i++) { String token = st.nextToken(); - DtColor aColor = DtColor.makeColorDT(token); + DtColor aColor = DtColor.makeDtColor(token); if (aColor != null) { // If it is a color, it must be either the first or last token. if (i == 0 || i == st.countTokens() - 1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-16 16:50:45
|
Revision: 7649 Author: victormote Date: 2006-06-16 09:50:40 -0700 (Fri, 16 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7649&view=rev Log Message: ----------- Add doc about source of the color definitions, and make conformant to that. Modified Paths: -------------- trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtColor.java Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtColor.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtColor.java 2006-06-16 16:27:10 UTC (rev 7648) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtColor.java 2006-06-16 16:50:40 UTC (rev 7649) @@ -64,6 +64,9 @@ /** * Keep this list in the same order as the name list above (i.e. * alphabetical, to facilitate binary searches. + * See the <a href="http://www.w3.org/TR/CSS21/syndata.html#color-units">CSS + * color definitions</a> for what we think is the authoritative source of + * the color values. */ private static final DtColor[] vals = { makeColorDT(new Color(0, 255, 255)), // aqua @@ -71,7 +74,7 @@ makeColorDT(new Color(0, 0, 255)), // blue makeColorDT(new Color(255, 0, 255)), // fuchsia makeColorDT(new Color(128, 128, 128)), // gray - makeColorDT(new Color(0, 255, 0)), // green + makeColorDT(new Color(0, 128, 0)), // green makeColorDT(new Color(0, 255, 0)), // lime makeColorDT(new Color(128, 0, 0)), // maroon makeColorDT(new Color(0, 0, 128)), // navy @@ -92,14 +95,11 @@ * color definitions. new Color(240, 248, 255), // aliceblue new Color(250, 235, 215), // antiquewhite - new Color(0, 255, 255), // aqua new Color(127, 255, 212), // aquamarine new Color(240, 255, 255), // azure new Color(245, 245, 220), // beige new Color(255, 228, 196), // bisque - new Color(0, 0, 0), // black new Color(255, 235, 205), // blanchedalmond - new Color(0, 0, 255), // blue new Color(138, 43, 226), // blueviolet new Color(165, 42, 42), // brown new Color(222, 184, 135), // burlywood @@ -138,13 +138,10 @@ new Color(178, 34, 34), // firebrick new Color(255, 250, 240), // floralwhite new Color(34, 139, 34), // forestgreen - new Color(255, 0, 255), // fuchsia new Color(220, 220, 220), // gainsboro new Color(248, 248, 255), // ghostwhite new Color(255, 215, 0), // gold new Color(218, 165, 32), // goldenrod - new Color(128, 128, 128), // gray - new Color(0, 255, 0), // green new Color(173, 255, 47), // greenyellow new Color(128, 128, 128), // grey new Color(240, 255, 240), // honeydew @@ -172,11 +169,9 @@ new Color(119, 136, 153), // lightslategrey new Color(176, 196, 222), // lightsteelblue new Color(255, 255, 224), // lightyellow - new Color(0, 255, 0), // lime new Color(50, 205, 50), // limegreen new Color(250, 240, 230), // linen new Color(255, 0, 255), // magenta - new Color(128, 0, 0), // maroon new Color(102, 205, 170), // mediumaquamarine new Color(0, 0, 205), // mediumblue new Color(186, 85, 211), // mediumorchid @@ -191,9 +186,7 @@ new Color(255, 228, 225), // mistyrose new Color(255, 228, 181), // moccasin new Color(255, 222, 173), // navajowhite - new Color(0, 0, 128), // navy new Color(253, 245, 230), // oldlace - new Color(128, 128, 0), // olive new Color(107, 142, 35), // olivedrab new Color(255, 165, 0), // orange new Color(255, 69, 0), // orangered @@ -208,8 +201,6 @@ new Color(255, 192, 203), // pink new Color(221, 160, 221), // plum new Color(176, 224, 230), // powderblue - new Color(128, 0, 128), // purple - new Color(255, 0, 0), // red new Color(188, 143, 143), // rosybrown new Color(65, 105, 225), // royalblue new Color(139, 69, 19), // saddlebrown @@ -218,7 +209,6 @@ new Color(46, 139, 87), // seagreen new Color(255, 245, 238), // seashell new Color(160, 82, 45), // sienna - new Color(192, 192, 192), // silver new Color(135, 206, 235), // skyblue new Color(106, 90, 205), // slateblue new Color(112, 128, 144), // slategray @@ -227,15 +217,12 @@ new Color(0, 255, 127), // springgreen new Color(70, 130, 180), // steelblue new Color(210, 180, 140), // tan - new Color(0, 128, 128), // teal new Color(216, 191, 216), // thistle new Color(255, 99, 71), // tomato new Color(64, 224, 208), // turquoise new Color(238, 130, 238), // violet new Color(245, 222, 179), // wheat - new Color(255, 255, 255), // white new Color(245, 245, 245), // whitesmoke - new Color(255, 255, 0), // yellow new Color(154, 205, 50) // yellowgreen */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-16 16:27:22
|
Revision: 7648 Author: victormote Date: 2006-06-16 09:27:10 -0700 (Fri, 16 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7648&view=rev Log Message: ----------- 1. Make static values instances of DtColor instead of java.awt.Color. 2. Reduce the DtColor named colors parsed to those listed in the XSL-FO standard. Retain others in a comment. Modified Paths: -------------- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Border.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderColor.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Color.java trunk/foray/foray-fotree/src/java/org/foray/fotree/parse/PropertyParser.java trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtColor.java Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Border.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Border.java 2006-06-16 15:49:09 UTC (rev 7647) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Border.java 2006-06-16 16:27:10 UTC (rev 7648) @@ -35,7 +35,6 @@ import org.axsl.common.Constants; -import java.awt.Color; import java.util.StringTokenizer; /** @@ -111,10 +110,10 @@ new PropertyKeyword(keyword)); } // Now check for color keywords - Color color = DtColor.mapNameToColorRGB(token); - if (color != null) { + DtColor dtColor = DtColor.mapNameToColorRGB(token); + if (dtColor != null) { return new BorderColor(Constants.FOPROP_BORDER_COLOR, - DtColor.makeColorDT(color)); + dtColor); } // Now try using the standard parse PropertyValue pv = standardParse(propertyList, token, false, false); Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderColor.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderColor.java 2006-06-16 15:49:09 UTC (rev 7647) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderColor.java 2006-06-16 16:27:10 UTC (rev 7648) @@ -114,7 +114,7 @@ } public static Color getValueNoInstance() { - return DtColor.mapNameToColorRGB("black"); + return DtColor.mapNameToColorRGB("black").getColor(); } /** Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Color.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Color.java 2006-06-16 15:49:09 UTC (rev 7647) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Color.java 2006-06-16 16:27:10 UTC (rev 7648) @@ -60,9 +60,9 @@ public PropertyValue createPropertyValue(PropertyList propertyList, String value) throws PropertyException { - java.awt.Color color = DtColor.mapNameToColorRGB(value); - if (color != null) { - return DtColor.makeColorDT(color); + DtColor dtColor = DtColor.mapNameToColorRGB(value); + if (dtColor != null) { + return dtColor; } PropertyValue pv = checkKeywords(value); if (pv != null) { @@ -112,7 +112,7 @@ } protected static java.awt.Color getDefaultColor() { - return DtColor.mapNameToColorRGB("black"); + return DtColor.mapNameToColorRGB("black").getColor(); } } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/parse/PropertyParser.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/parse/PropertyParser.java 2006-06-16 15:49:09 UTC (rev 7647) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/parse/PropertyParser.java 2006-06-16 16:27:10 UTC (rev 7648) @@ -46,7 +46,6 @@ import org.foray.fotree.value.Function; import org.foray.fotree.value.PropertyValue; -import java.awt.Color; import java.util.ArrayList; import java.util.Stack; @@ -237,13 +236,11 @@ break; case TOK_COLORSPEC: - Color color = null; - try { - color = DtColor.parseColorDescription(currentTokenValue); - } catch (PropertyException e) { - throw new PropertyException(e.getMessage()); - } - prop = DtColor.makeColorDT(color); + try { + prop = DtColor.parseColorDescription(currentTokenValue); + } catch (PropertyException e) { + throw new PropertyException(e.getMessage()); + } break; case TOK_FUNCTION_LPAR: { Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtColor.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtColor.java 2006-06-16 15:49:09 UTC (rev 7647) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtColor.java 2006-06-16 16:27:10 UTC (rev 7648) @@ -35,169 +35,61 @@ */ public class DtColor extends Datatype implements ExprColor { - /* - * Keep this list in alphabetical order, to facilitate binary searches. + /** + * Alphabetical list of named colors supported by XSL-FO. + * The list is kept in alphabetical order to facilitate binary searches. + * (There are only 16 items now, but that may grow in the future). + * The list of these colors is found in XSL-FO 1.0, Section 5.11, in the + * description of the "color" datatype. */ - static final String[] names = { - "aliceblue", - "antiquewhite", + private static final String[] names = { "aqua", - "aquamarine", - "azure", - "beige", - "bisque", "black", - "blanchedalmond", "blue", - "blueviolet", - "brown", - "burlywood", - "cadetblue", - "chartreuse", - "chocolate", - "coral", - "cornflowerblue", - "cornsilk", - "crimson", - "cyan", - "darkblue", - "darkcyan", - "darkgoldenrod", - "darkgray", - "darkgreen", - "darkgrey", - "darkkhaki", - "darkmagenta", - "darkolivegreen", - "darkorange", - "darkorchid", - "darkred", - "darksalmon", - "darkseagreen", - "darkslateblue", - "darkslategray", - "darkslategrey", - "darkturquoise", - "darkviolet", - "deeppink", - "deepskyblue", - "dimgray", - "dimgrey", - "dodgerblue", - "firebrick", - "floralwhite", - "forestgreen", "fuchsia", - "gainsboro", - "ghostwhite", - "gold", - "goldenrod", "gray", "green", - "greenyellow", - "grey", - "honeydew", - "hotpink", - "indianred", - "indigo", - "ivory", - "khaki", - "lavender", - "lavenderblush", - "lawngreen", - "lemonchiffon", - "lightblue", - "lightcoral", - "lightcyan", - "lightgoldenrodyellow", - "lightgray", - "lightgreen", - "lightgrey", - "lightpink", - "lightsalmon", - "lightseagreen", - "lightskyblue", - "lightslategray", - "lightslategrey", - "lightsteelblue", - "lightyellow", "lime", - "limegreen", - "linen", - "magenta", "maroon", - "mediumaquamarine", - "mediumblue", - "mediumorchid", - "mediumpurple", - "mediumseagreen", - "mediumslateblue", - "mediumspringgreen", - "mediumturquoise", - "mediumvioletred", - "midnightblue", - "mintcream", - "mistyrose", - "moccasin", - "navajowhite", "navy", - "oldlace", "olive", - "olivedrab", - "orange", - "orangered", - "orchid", - "palegoldenrod", - "palegreen", - "paleturquoise", - "palevioletred", - "papayawhip", - "peachpuff", - "peru", - "pink", - "plum", - "powderblue", "purple", "red", - "rosybrown", - "royalblue", - "saddlebrown", - "salmon", - "sandybrown", - "seagreen", - "seashell", - "sienna", "silver", - "skyblue", - "slateblue", - "slategray", - "slategrey", - "snow", - "springgreen", - "steelblue", - "tan", "teal", - "thistle", - "tomato", - "turquoise", - "violet", - "wheat", "white", - "whitesmoke", "yellow", - "yellowgreen" -}; + }; - /* + /** * Keep this list in the same order as the name list above (i.e. * alphabetical, to facilitate binary searches. - * - * Don't know where these values and names came from. However, the 16 - * named colors defined in the CSS-1 (Cascading Style Sheets) standard are - * defined and match the values in that standard. XSL 1.0 uses the same - * 16 named colors. */ - static final Color[] vals = { + private static final DtColor[] vals = { + makeColorDT(new Color(0, 255, 255)), // aqua + makeColorDT(new Color(0, 0, 0)), // black + makeColorDT(new Color(0, 0, 255)), // blue + makeColorDT(new Color(255, 0, 255)), // fuchsia + makeColorDT(new Color(128, 128, 128)), // gray + makeColorDT(new Color(0, 255, 0)), // green + makeColorDT(new Color(0, 255, 0)), // lime + makeColorDT(new Color(128, 0, 0)), // maroon + makeColorDT(new Color(0, 0, 128)), // navy + makeColorDT(new Color(128, 128, 0)), // olive + makeColorDT(new Color(128, 0, 128)), // purple + makeColorDT(new Color(255, 0, 0)), // red + makeColorDT(new Color(192, 192, 192)), // silver + makeColorDT(new Color(0, 128, 128)), // teal + makeColorDT(new Color(255, 255, 255)), // white + makeColorDT(new Color(255, 255, 0)), // yellow + }; + + /* + * Here are the RGB values for a bunch of other colors, listed in + * alphabetical order, that are not supported by XSL-FO. They are retained + * here for reference purposes only, and in case these named colors are + * added to the standard in the future. We do not know the source of these + * color definitions. new Color(240, 248, 255), // aliceblue new Color(250, 235, 215), // antiquewhite new Color(0, 255, 255), // aqua @@ -345,7 +237,7 @@ new Color(245, 245, 245), // whitesmoke new Color(255, 255, 0), // yellow new Color(154, 205, 50) // yellowgreen - }; + */ public static final Color COLOR_RGB_TRANSPARENT = new Color(255, 255, 255, 0); @@ -375,28 +267,18 @@ * Factory method which converts a named color into a ColorDT instance. * @param input The named color (for example, "blue" or "teal") to be * converted. - * @return A ColorDT instance, or null if input is not valid. + * @return A ColorDT instance, or null if input is not a defined XSL-FO + * named color. */ public static DtColor makeColorDT(String input) { - /* - * Note: This scheme is not strictly - * conformant to the XSL-FO 1.0 Standard, which lists only 16 named - * colors, the same that are in CSS. The list used in our search has - * many more than that. Not sure whether this is a bonus or a problem - * with regard to standardization. - */ - Color color = mapNameToColorRGB(input); - if (color != null) { - return new DtColor(color); - } - return null; + return mapNameToColorRGB(input); } public static DtColor makeColorDT(Color color) { return new DtColor(color); } - public static Color mapNameToColorRGB(String colorName) { + public static DtColor mapNameToColorRGB(String colorName) { // Do a binary search to find the name in the names list. int index = Arrays.binarySearch(names, colorName); if (index < 0 || index >= names.length) { @@ -410,7 +292,7 @@ * set the colour given a particular String specifying either a * colour name or #RGB or #RRGGBB */ - public static Color parseColorDescription(String value) + public static DtColor parseColorDescription(String value) throws PropertyException { float red = 0; float green = 0; @@ -507,7 +389,7 @@ blue = 0; alpha = 1; } else { - Color foundColor = mapNameToColorRGB(value.toLowerCase()); + DtColor foundColor = mapNameToColorRGB(value.toLowerCase()); if (foundColor == null) { red = 0; green = 0; @@ -515,13 +397,11 @@ throw new PropertyException("Unknown colour name: " + value); } - red = foundColor.getRed(); - green = foundColor.getGreen(); - blue = foundColor.getBlue(); + return foundColor; } } Color newColor = new Color(red, green, blue, alpha); - return newColor; + return new DtColor(newColor); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-16 15:49:21
|
Revision: 7647 Author: victormote Date: 2006-06-16 08:49:09 -0700 (Fri, 16 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7647&view=rev Log Message: ----------- Make DtColor constructor private, and use static factory methods instead. We will eventually try to prevent creation of duplicate Color and DtColor instances. Modified Paths: -------------- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Border.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Color.java trunk/foray/foray-fotree/src/java/org/foray/fotree/parse/PropertyParser.java trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtColor.java Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Border.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Border.java 2006-06-16 15:23:58 UTC (rev 7646) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Border.java 2006-06-16 15:49:09 UTC (rev 7647) @@ -114,7 +114,7 @@ Color color = DtColor.mapNameToColorRGB(token); if (color != null) { return new BorderColor(Constants.FOPROP_BORDER_COLOR, - new DtColor(color)); + DtColor.makeColorDT(color)); } // Now try using the standard parse PropertyValue pv = standardParse(propertyList, token, false, false); Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Color.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Color.java 2006-06-16 15:23:58 UTC (rev 7646) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Color.java 2006-06-16 15:49:09 UTC (rev 7647) @@ -62,7 +62,7 @@ String value) throws PropertyException { java.awt.Color color = DtColor.mapNameToColorRGB(value); if (color != null) { - return new DtColor(color); + return DtColor.makeColorDT(color); } PropertyValue pv = checkKeywords(value); if (pv != null) { Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/parse/PropertyParser.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/parse/PropertyParser.java 2006-06-16 15:23:58 UTC (rev 7646) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/parse/PropertyParser.java 2006-06-16 15:49:09 UTC (rev 7647) @@ -243,7 +243,7 @@ } catch (PropertyException e) { throw new PropertyException(e.getMessage()); } - prop = new DtColor(color); + prop = DtColor.makeColorDT(color); break; case TOK_FUNCTION_LPAR: { Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtColor.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtColor.java 2006-06-16 15:23:58 UTC (rev 7646) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtColor.java 2006-06-16 15:49:09 UTC (rev 7647) @@ -353,10 +353,10 @@ private Color value; /** - * Constructor. - * @param color The Color instance that is the value for this property. + * Private Constructor. Use one of the following static methods instead: + * {@link #makeColorDT(String)}. */ - public DtColor(Color color) { + private DtColor(Color color) { this.value = color; } @@ -372,13 +372,14 @@ } /** - * Factory method which converts a String input into a ColorDT instance. - * @param input The String to be converted into a ColorDT instance. + * Factory method which converts a named color into a ColorDT instance. + * @param input The named color (for example, "blue" or "teal") to be + * converted. * @return A ColorDT instance, or null if input is not valid. */ public static DtColor makeColorDT(String input) { /* - * Look for named colors first. Note: This scheme is not strictly + * Note: This scheme is not strictly * conformant to the XSL-FO 1.0 Standard, which lists only 16 named * colors, the same that are in CSS. The list used in our search has * many more than that. Not sure whether this is a bonus or a problem @@ -391,6 +392,10 @@ return null; } + public static DtColor makeColorDT(Color color) { + return new DtColor(color); + } + public static Color mapNameToColorRGB(String colorName) { // Do a binary search to find the name in the names list. int index = Arrays.binarySearch(names, colorName); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-16 15:24:08
|
Revision: 7646 Author: victormote Date: 2006-06-16 08:23:58 -0700 (Fri, 16 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7646&view=rev Log Message: ----------- Fix opacity on java.awt.Color instances created. Modified Paths: -------------- trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtColor.java Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtColor.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtColor.java 2006-06-16 01:00:38 UTC (rev 7645) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtColor.java 2006-06-16 15:23:58 UTC (rev 7646) @@ -410,7 +410,8 @@ float red = 0; float green = 0; float blue = 0; - float alpha = 0; + /* Default opacity is opaque, which is 1. */ + float alpha = 1; if (value.startsWith("#")) { try { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-16 01:00:44
|
Revision: 7645 Author: victormote Date: 2006-06-15 18:00:38 -0700 (Thu, 15 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7645&view=rev Log Message: ----------- Conform to axsl changes: Remove unneeded method parameters. Modified Paths: -------------- trunk/foray/foray-areatree/src/java/org/foray/area/Area.java trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.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-16 01:00:22 UTC (rev 7644) +++ trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2006-06-16 01:00:38 UTC (rev 7645) @@ -886,11 +886,11 @@ } public int traitPageWidth() { - return traitGeneratedBy().traitPageWidth(this); + return traitGeneratedBy().traitPageWidth(); } public int traitPageHeight() { - return traitGeneratedBy().traitPageHeight(this); + return traitGeneratedBy().traitPageHeight(); } /** 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-16 01:00:22 UTC (rev 7644) +++ trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java 2006-06-16 01:00:38 UTC (rev 7645) @@ -152,11 +152,11 @@ } public int getHeight() { - return traitGeneratedBy().traitPageHeight(this); + return traitGeneratedBy().traitPageHeight(); } public int getWidth() { - return traitGeneratedBy().traitPageWidth(this); + return traitGeneratedBy().traitPageWidth(); } public void registerMarker(Marker marker) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-16 01:00:34
|
Revision: 7644 Author: victormote Date: 2006-06-15 18:00:22 -0700 (Thu, 15 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7644&view=rev Log Message: ----------- Conform to axsl changes: Remove unneeded method parameters. Modified Paths: -------------- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RegionBefore.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RegionBody.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/SimplePageMaster.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Extent.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Margin.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/PageDimension.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Size.java Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2006-06-16 00:50:15 UTC (rev 7643) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2006-06-16 01:00:22 UTC (rev 7644) @@ -753,15 +753,15 @@ /** * {@inheritDoc} */ - public int traitPageWidth(FOContext context) { - return propertyList.getPageWidth(context); + public int traitPageWidth() { + return propertyList.getPageWidth(); } /** * {@inheritDoc} */ - public int traitPageHeight(FOContext context) { - return propertyList.getPageHeight(context); + public int traitPageHeight() { + return propertyList.getPageHeight(); } /** Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2006-06-16 00:50:15 UTC (rev 7643) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2006-06-16 01:00:22 UTC (rev 7644) @@ -1017,13 +1017,15 @@ return MaximumRepeats.getValueNoInstance(); } - private int getPageDimension(FOContext context, byte axis) { + private int getPageDimension(byte axis) { short propertyType = PageDimension.rawPropertyType(axis); PageDimension property = (PageDimension) getProperty(propertyType); if (property != null) { - return property.getValue(context, axis, fobj); + return property.getValue(axis, fobj); } // Try the shorthand. + /* Null context is OK, because the object can't be inside a marker. */ + FOContext context = null; Size sizeProperty = (Size) getProperty(Constants.FOPROP_SIZE); if (sizeProperty != null) { return sizeProperty.getValue(context, fobj, axis); @@ -1031,12 +1033,12 @@ return PageDimension.getValueNoInstance(axis); } - public int getPageWidth(FOContext context) { - return getPageDimension(context, Constants.AXIS_HORIZONTAL); + public int getPageWidth() { + return getPageDimension(Constants.AXIS_HORIZONTAL); } - public int getPageHeight(FOContext context) { - return getPageDimension(context, Constants.AXIS_VERTICAL); + public int getPageHeight() { + return getPageDimension(Constants.AXIS_VERTICAL); } public short getTextAlign(FOContext context) { Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RegionBefore.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RegionBefore.java 2006-06-16 00:50:15 UTC (rev 7643) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RegionBefore.java 2006-06-16 01:00:22 UTC (rev 7644) @@ -57,7 +57,7 @@ * Inherited documentation: @inheritDoc */ public int getXPositionVP_CR(FOContext context) { - int pageWidth = getPageMaster().traitPageWidth(context); + int pageWidth = getPageMaster().traitPageWidth(); int xPosition = getPageMaster().getMarginLeft(context, pageWidth); if (traitPrecedence() == false) { xPosition += getPageMaster().getStartExtent(); @@ -69,8 +69,8 @@ * Inherited documentation: @inheritDoc */ public int getYPositionVP_CR(FOContext context) { - int pageWidth = getPageMaster().traitPageWidth(context); - return getPageMaster().traitPageHeight(context) + int pageWidth = getPageMaster().traitPageWidth(); + return getPageMaster().traitPageHeight() - getPageMaster().getMarginTop(context, pageWidth); } @@ -78,8 +78,8 @@ * Inherited documentation: @inheritDoc */ public int getWidthVP_CR(FOContext context) { - int pageWidth = getPageMaster().traitPageWidth(context); - int width = getPageMaster().traitPageWidth(context) + int pageWidth = getPageMaster().traitPageWidth(); + int width = getPageMaster().traitPageWidth() - getPageMaster().getMarginLeft(context, pageWidth) - getPageMaster().getMarginRight(context, pageWidth); if (traitPrecedence() == false) { Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RegionBody.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RegionBody.java 2006-06-16 00:50:15 UTC (rev 7643) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RegionBody.java 2006-06-16 01:00:22 UTC (rev 7644) @@ -57,7 +57,7 @@ * Inherited documentation: @inheritDoc */ public int getXPositionVP_CR(FOContext context) { - int pageWidth = getPageMaster().traitPageWidth(context); + int pageWidth = getPageMaster().traitPageWidth(); int pageMarginLeft = getPageMaster().getMarginLeft(context, pageWidth); int regionMarginLeft = this.getMarginLeft(context, pageWidth); return pageMarginLeft + regionMarginLeft; @@ -67,8 +67,8 @@ * Inherited documentation: @inheritDoc */ public int getYPositionVP_CR(FOContext context) { - int pageWidth = getPageMaster().traitPageWidth(context); - int pageHeight = getPageMaster().traitPageHeight(context); + int pageWidth = getPageMaster().traitPageWidth(); + int pageHeight = getPageMaster().traitPageHeight(); int pageMarginTop = getPageMaster().getMarginTop(context, pageWidth); int regionMarginTop = this.getMarginTop(context, pageWidth); return pageHeight - pageMarginTop - regionMarginTop; @@ -78,8 +78,8 @@ * Inherited documentation: @inheritDoc */ public int getWidthVP_CR(FOContext context) { - int pageWidth = getPageMaster().traitPageWidth(context); - return getPageMaster().traitPageWidth(context) + int pageWidth = getPageMaster().traitPageWidth(); + return getPageMaster().traitPageWidth() - getPageMaster().getMarginLeft(context, pageWidth) - getPageMaster().getMarginRight(context, pageWidth) - this.getMarginLeft(context, pageWidth) @@ -90,8 +90,8 @@ * Inherited documentation: @inheritDoc */ public int getHeightVP_CR(FOContext context) { - int pageWidth = getPageMaster().traitPageWidth(context); - return getPageMaster().traitPageHeight(context) + int pageWidth = getPageMaster().traitPageWidth(); + return getPageMaster().traitPageHeight() - getPageMaster().getMarginTop(context, pageWidth) - getPageMaster().getMarginBottom(context, pageWidth) - this.getMarginTop(context, pageWidth) Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/SimplePageMaster.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/SimplePageMaster.java 2006-06-16 00:50:15 UTC (rev 7643) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/SimplePageMaster.java 2006-06-16 01:00:22 UTC (rev 7644) @@ -214,7 +214,7 @@ public int getXPositionRA_CR() { /* TODO: Handle context better. */ FOContext context = null; - return getMarginLeft(context, traitPageWidth(context)); + return getMarginLeft(context, traitPageWidth()); } /** @@ -224,8 +224,8 @@ public int getYPositionRA_CR() { /* TODO: Handle context better. */ FOContext context = null; - return traitPageHeight(context) - - getMarginTop(context, traitPageWidth(context)); + return traitPageHeight() + - getMarginTop(context, traitPageWidth()); } /** @@ -235,9 +235,9 @@ public int getWidthRA_CR() { /* TODO: Handle context better. */ FOContext context = null; - return traitPageWidth(context) - - getMarginLeft(context, traitPageWidth(context)) - - getMarginRight(context, traitPageWidth(context)); + return traitPageWidth() + - getMarginLeft(context, traitPageWidth()) + - getMarginRight(context, traitPageWidth()); } /** @@ -247,9 +247,9 @@ public int getHeightRA_CR() { /* TODO: Handle context better. */ FOContext context = null; - return traitPageHeight(context) - - getMarginTop(context, traitPageWidth(context)) - - getMarginBottom(context, traitPageWidth(context)); + return traitPageHeight() + - getMarginTop(context, traitPageWidth()) + - getMarginBottom(context, traitPageWidth()); } public Namespace getNamespace() { Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Extent.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Extent.java 2006-06-16 00:50:15 UTC (rev 7643) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Extent.java 2006-06-16 01:00:22 UTC (rev 7644) @@ -111,10 +111,10 @@ } switch (absoluteAxis) { case Constants.AXIS_VERTICAL: { - return fobj.traitPageHeight(context); + return fobj.traitPageHeight(); } case Constants.AXIS_HORIZONTAL: { - return fobj.traitPageWidth(context); + return fobj.traitPageWidth(); } } return getValueNoInstance(); Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Margin.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Margin.java 2006-06-16 00:50:15 UTC (rev 7643) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Margin.java 2006-06-16 01:00:22 UTC (rev 7644) @@ -118,7 +118,7 @@ int base = 0; if (fobj instanceof SimplePageMaster) { SimplePageMaster spm = (SimplePageMaster) fobj; - base = spm.traitPageHeight(context); + base = spm.traitPageHeight(); } else { base = widthContainingBlock; } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/PageDimension.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/PageDimension.java 2006-06-16 00:50:15 UTC (rev 7643) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/PageDimension.java 2006-06-16 01:00:22 UTC (rev 7644) @@ -68,20 +68,22 @@ propertyList)); } - public int getValue(FOContext context, byte axis, FObj fobj) { + public int getValue(byte axis, FObj fobj) { + /* Null context is OK, because the object can't be inside a marker. */ + FOContext context = null; if (this.value instanceof PropertyKeyword) { short keyword = ((PropertyKeyword) value).getValue(); switch (keyword) { case Constants.FOVAL_INHERIT: { - FObj parent = fobj.effectiveParent(context); + FObj parent = fobj.realParent(); if (parent == null) { return getValueNoInstance(axis); } if (axis == Constants.AXIS_HORIZONTAL) { - return parent.traitPageWidth(context); + return parent.traitPageWidth(); } if (axis == Constants.AXIS_VERTICAL) { - return parent.traitPageHeight(context); + return parent.traitPageHeight(); } break; } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Size.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Size.java 2006-06-16 00:50:15 UTC (rev 7643) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Size.java 2006-06-16 01:00:22 UTC (rev 7644) @@ -138,10 +138,10 @@ if (parent != null) { switch (axis) { case Constants.AXIS_HORIZONTAL: { - return fobj.traitPageWidth(context); + return fobj.traitPageWidth(); } case Constants.AXIS_VERTICAL: { - return fobj.traitPageHeight(context); + return fobj.traitPageHeight(); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-16 00:50:20
|
Revision: 7643 Author: victormote Date: 2006-06-15 17:50:15 -0700 (Thu, 15 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7643&view=rev Log Message: ----------- Conform to axsl change: Move trait method to more appropriate interface. Modified Paths: -------------- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2006-06-16 00:38:13 UTC (rev 7642) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2006-06-16 00:50:15 UTC (rev 7643) @@ -708,7 +708,7 @@ } /** - * {@inheritDoc} + * @see org.axsl.foR.fo.Region#traitRegionName() */ public String traitRegionName() { return propertyList.getRegionName(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-16 00:38:18
|
Revision: 7642 Author: victormote Date: 2006-06-15 17:38:13 -0700 (Thu, 15 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7642&view=rev Log Message: ----------- Conform to axsl change: Remove unneeded parameter. Modified Paths: -------------- trunk/foray/foray-areatree/src/java/org/foray/area/Area.java trunk/foray/foray-areatree/src/java/org/foray/area/RegionRA.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-16 00:37:58 UTC (rev 7641) +++ trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2006-06-16 00:38:13 UTC (rev 7642) @@ -1018,7 +1018,7 @@ } public int traitExtent() { - return traitGeneratedBy().traitExtent(this); + return traitGeneratedBy().traitExtent(); } public short traitWhiteSpaceTreatment() { 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-16 00:37:58 UTC (rev 7641) +++ trunk/foray/foray-areatree/src/java/org/foray/area/RegionRA.java 2006-06-16 00:38:13 UTC (rev 7642) @@ -53,7 +53,7 @@ public int crBPD() { if (this.generatedBy.getFONode() instanceof RegionBefore || this.generatedBy.getFONode() instanceof RegionAfter) { - return traitGeneratedBy().traitExtent(this); + return traitGeneratedBy().traitExtent(); } return getParentArea().brBPD(); } @@ -61,7 +61,7 @@ public int crIPD() { if (this.generatedBy.getFONode() instanceof RegionStart || this.generatedBy.getFONode() instanceof RegionEnd) { - return traitGeneratedBy().traitExtent(this); + return traitGeneratedBy().traitExtent(); } return getParentArea().brIPD(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-06-16 00:38:10
|
Revision: 7641 Author: victormote Date: 2006-06-15 17:37:58 -0700 (Thu, 15 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7641&view=rev Log Message: ----------- Conform to axsl change: Remove unneeded parameter. Modified Paths: -------------- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RegionAfter.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RegionBefore.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RegionEnd.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RegionStart.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/SimplePageMaster.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbsoluteOffset.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ColumnGap.java trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Extent.java Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2006-06-15 23:43:42 UTC (rev 7640) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2006-06-16 00:37:58 UTC (rev 7641) @@ -721,8 +721,8 @@ /** * {@inheritDoc} */ - public int traitExtent(FOContext context) { - return propertyList.getExtent(context); + public int traitExtent() { + return propertyList.getExtent(); } /** Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2006-06-15 23:43:42 UTC (rev 7640) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2006-06-16 00:37:58 UTC (rev 7641) @@ -963,10 +963,10 @@ Constants.FOPROP_PRECEDENCE); } - public int getExtent(FOContext context) { + public int getExtent() { Extent property = (Extent) getProperty(Constants.FOPROP_EXTENT); if (property != null) { - return property.getValue(context, fobj); + return property.getValue(fobj); } return Extent.getValueNoInstance(); } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RegionAfter.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RegionAfter.java 2006-06-15 23:43:42 UTC (rev 7640) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RegionAfter.java 2006-06-16 00:37:58 UTC (rev 7641) @@ -70,7 +70,7 @@ public int getYPositionVP_CR(FOContext context) { return getPageMaster().getYPositionRA_CR() - getPageMaster().getHeightRA_CR() - + traitExtent(context); + + traitExtent(); } /** @@ -89,7 +89,7 @@ * {@inheritDoc} */ public int getHeightVP_CR(FOContext context) { - return traitExtent(context); + return traitExtent(); } public FONodeProxy makeProxy(ProxyFactory factory) { Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RegionBefore.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RegionBefore.java 2006-06-15 23:43:42 UTC (rev 7640) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RegionBefore.java 2006-06-16 00:37:58 UTC (rev 7641) @@ -93,7 +93,7 @@ * Inherited documentation: @inheritDoc */ public int getHeightVP_CR(FOContext context) { - return traitExtent(context); + return traitExtent(); } public FONodeProxy makeProxy(ProxyFactory factory) { Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RegionEnd.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RegionEnd.java 2006-06-15 23:43:42 UTC (rev 7640) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RegionEnd.java 2006-06-16 00:37:58 UTC (rev 7641) @@ -58,7 +58,7 @@ public int getXPositionVP_CR(FOContext context) { return getPageMaster().getXPositionRA_CR() + getPageMaster().getWidthRA_CR() - - traitExtent(context); + - traitExtent(); } /** @@ -76,7 +76,7 @@ * Inherited documentation: @inheritDoc */ public int getWidthVP_CR(FOContext context) { - return traitExtent(context); + return traitExtent(); } /** Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RegionStart.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RegionStart.java 2006-06-15 23:43:42 UTC (rev 7640) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RegionStart.java 2006-06-16 00:37:58 UTC (rev 7641) @@ -75,7 +75,7 @@ * Inherited documentation: @inheritDoc */ public int getWidthVP_CR(FOContext context) { - return traitExtent(context); + return traitExtent(); } /** Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/SimplePageMaster.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/SimplePageMaster.java 2006-06-15 23:43:42 UTC (rev 7640) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/SimplePageMaster.java 2006-06-16 00:37:58 UTC (rev 7641) @@ -168,12 +168,10 @@ * @return The extent, in millipoints, of this pages's region-before. */ public int getBeforeExtent() { - /* TODO: Handle context better. */ - FOContext context = null; if (getRegionBefore() == null) { return 0; } - return getRegionBefore().traitExtent(context); + return getRegionBefore().traitExtent(); } /** @@ -181,12 +179,10 @@ * @return The extent, in millipoints, of this pages's region-after. */ public int getAfterExtent() { - /* TODO: Handle context better. */ - FOContext context = null; if (getRegionAfter() == null) { return 0; } - return getRegionAfter().traitExtent(context); + return getRegionAfter().traitExtent(); } /** @@ -194,12 +190,10 @@ * @return The extent, in millipoints, of this pages's region-start. */ public int getStartExtent() { - /* TODO: Handle context better. */ - FOContext context = null; if (getRegionStart() == null) { return 0; } - return getRegionStart().traitExtent(context); + return getRegionStart().traitExtent(); } /** @@ -207,12 +201,10 @@ * @return The extent, in millipoints, of this pages's region-end. */ public int getEndExtent() { - /* TODO: Handle context better. */ - FOContext context = null; if (getRegionEnd() == null) { return 0; } - return getRegionEnd().traitExtent(context); + return getRegionEnd().traitExtent(); } /** Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbsoluteOffset.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbsoluteOffset.java 2006-06-15 23:43:42 UTC (rev 7640) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbsoluteOffset.java 2006-06-16 00:37:58 UTC (rev 7641) @@ -85,7 +85,7 @@ if (parent == null) { return getValueNoInstance(); } - return parent.traitExtent(context); + return parent.traitExtent(); } } } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ColumnGap.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ColumnGap.java 2006-06-15 23:43:42 UTC (rev 7640) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ColumnGap.java 2006-06-16 00:37:58 UTC (rev 7641) @@ -77,7 +77,7 @@ if (parent == null) { return getValueNoInstance(); } - return parent.traitExtent(context); + return parent.traitExtent(); } } } Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Extent.java =================================================================== --- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Extent.java 2006-06-15 23:43:42 UTC (rev 7640) +++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Extent.java 2006-06-16 00:37:58 UTC (rev 7641) @@ -72,16 +72,19 @@ propertyList)); } - public int getValue(FOContext context, FObj fobj) { + public int getValue(FObj fobj) { + /* Null context is OK. The objects for these cannot be inside a + * marker.*/ + FOContext context = null; if (this.value instanceof PropertyKeyword) { short keyword = ((PropertyKeyword) value).getValue(); switch (keyword) { case Constants.FOVAL_INHERIT: { - FObj parent = fobj.effectiveParent(context); + FObj parent = fobj.realParent(); if (parent == null) { return getValueNoInstance(); } - return parent.traitExtent(context); + return parent.traitExtent(); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |