Thread: [FOray-commit] SF.net SVN: foray: [9020] trunk/foray (Page 9)
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2007-03-26 21:34:24
|
Revision: 9020
http://svn.sourceforge.net/foray/?rev=9020&view=rev
Author: victormote
Date: 2007-03-26 14:34:08 -0700 (Mon, 26 Mar 2007)
Log Message:
-----------
Conform to axsl changes renaming method.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java
trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java 2007-03-26 21:19:48 UTC (rev 9019)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java 2007-03-26 21:34:08 UTC (rev 9020)
@@ -195,7 +195,7 @@
/**
* {@inheritDoc}
*/
- public PageArea getNextPage(final Force forceValue,
+ public PageArea makePage(final Force forceValue,
final boolean inputIsBlank) throws AreaWException {
boolean isBlank = inputIsBlank;
if (Force.ODD.equals(forceValue)) {
@@ -365,7 +365,7 @@
* needed to create the page.
*/
private void makeBlankPage() throws AreaWException {
- final PageArea pageArea = getNextPage(Force.NONE, true);
+ final PageArea pageArea = makePage(Force.NONE, true);
pageArea.layoutComplete();
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java 2007-03-26 21:19:48 UTC (rev 9019)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java 2007-03-26 21:34:08 UTC (rev 9020)
@@ -475,7 +475,7 @@
*/
public Area getOverflowArea(final Area childRequesting)
throws AreaWException {
- return (PageRA) getPageCollection().getNextPage(Force.NONE, false);
+ return (PageRA) getPageCollection().makePage(Force.NONE, false);
}
/**
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java 2007-03-26 21:19:48 UTC (rev 9019)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java 2007-03-26 21:34:08 UTC (rev 9020)
@@ -198,7 +198,7 @@
isBlankPage = true;
}
}
- final PageArea newPage = pageCollection.getNextPage(
+ final PageArea newPage = pageCollection.makePage(
PageCollection.Force.NONE, isBlankPage);
setPendingFootnotes(newPage);
currentPage = newPage;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-03-26 21:54:47
|
Revision: 9021
http://svn.sourceforge.net/foray/?rev=9021&view=rev
Author: victormote
Date: 2007-03-26 14:54:48 -0700 (Mon, 26 Mar 2007)
Log Message:
-----------
Conform to axsl changes removing one method and changing the signature of another.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java
trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java 2007-03-26 21:34:08 UTC (rev 9020)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java 2007-03-26 21:54:48 UTC (rev 9021)
@@ -162,7 +162,8 @@
}
/**
- * {@inheritDoc}
+ * Returns the current page number.
+ * @return The current page number.
*/
public int getCurrentPageNumber() {
return currentPageNumber;
@@ -195,9 +196,8 @@
/**
* {@inheritDoc}
*/
- public PageArea makePage(final Force forceValue,
- final boolean inputIsBlank) throws AreaWException {
- boolean isBlank = inputIsBlank;
+ public PageArea makePage(final Force forceValue) throws AreaWException {
+ boolean isBlank = false;
if (Force.ODD.equals(forceValue)) {
if (getCurrentPageNumber() % 2 == 0) {
isBlank = true;
@@ -365,7 +365,7 @@
* needed to create the page.
*/
private void makeBlankPage() throws AreaWException {
- final PageArea pageArea = makePage(Force.NONE, true);
+ final PageArea pageArea = makePage(Force.NONE);
pageArea.layoutComplete();
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java 2007-03-26 21:34:08 UTC (rev 9020)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java 2007-03-26 21:54:48 UTC (rev 9021)
@@ -475,7 +475,7 @@
*/
public Area getOverflowArea(final Area childRequesting)
throws AreaWException {
- return (PageRA) getPageCollection().makePage(Force.NONE, false);
+ return (PageRA) getPageCollection().makePage(Force.NONE);
}
/**
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java 2007-03-26 21:34:08 UTC (rev 9020)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java 2007-03-26 21:54:48 UTC (rev 9021)
@@ -185,21 +185,13 @@
Status status = Status.UNKNOWN;
PageArea currentPage = null;
while (status.isIncomplete()) {
- boolean isBlankPage = false;
-
- // for this calculation we are already on the
- // blank page
+ PageCollection.Force force = PageCollection.Force.NONE;
if (status == Status.FORCE_PAGE_BREAK_EVEN) {
- if ((pageCollection.getCurrentPageNumber() % 2) == 1) {
- isBlankPage = true;
- }
+ force = PageCollection.Force.EVEN;
} else if (status == Status.FORCE_PAGE_BREAK_ODD) {
- if ((pageCollection.getCurrentPageNumber() % 2) == 0) {
- isBlankPage = true;
- }
+ force = PageCollection.Force.ODD;
}
- final PageArea newPage = pageCollection.makePage(
- PageCollection.Force.NONE, isBlankPage);
+ final PageArea newPage = pageCollection.makePage(force);
setPendingFootnotes(newPage);
currentPage = newPage;
/*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-03-26 22:05:25
|
Revision: 9022
http://svn.sourceforge.net/foray/?rev=9022&view=rev
Author: victormote
Date: 2007-03-26 15:05:24 -0700 (Mon, 26 Mar 2007)
Log Message:
-----------
Conform to axsl changes renaming a method.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/NormalBlockArea.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/BlockPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FONodePL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FOTextPL.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/NormalBlockArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/NormalBlockArea.java 2007-03-26 21:54:48 UTC (rev 9021)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/NormalBlockArea.java 2007-03-26 22:05:24 UTC (rev 9022)
@@ -98,7 +98,7 @@
/**
* {@inheritDoc}
*/
- public LineArea createNextLineArea(
+ public LineArea makeLineArea(
final boolean allowOverflow) throws AreaWException {
/* The size of the next line does not need to consider the half-leading
* that follows the line. That half-leading will be automatically
@@ -111,7 +111,7 @@
if (allowOverflow) {
final NormalBlockArea newArea = (NormalBlockArea)
this.getOverflowArea(this);
- return newArea.createNextLineArea(allowOverflow);
+ return newArea.makeLineArea(allowOverflow);
} else {
return null;
}
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/BlockPL.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/BlockPL.java 2007-03-26 21:54:48 UTC (rev 9021)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/BlockPL.java 2007-03-26 22:05:24 UTC (rev 9022)
@@ -197,7 +197,7 @@
* this passed as a parameter.
* TODO: Rename this method. */
if (this.currentLineArea == null) {
- this.currentLineArea = blockArea.createNextLineArea(false);
+ this.currentLineArea = blockArea.makeLineArea(false);
}
return this.currentLineArea;
}
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FONodePL.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FONodePL.java 2007-03-26 21:54:48 UTC (rev 9021)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FONodePL.java 2007-03-26 22:05:24 UTC (rev 9022)
@@ -296,7 +296,7 @@
// It did not fit on the line. Create new line & try again.
final NormalBlockArea blockArea
= (NormalBlockArea) lineArea.getParentArea();
- lineArea = blockArea.createNextLineArea(false);
+ lineArea = blockArea.makeLineArea(false);
final BlockPL blockPL = this.layout.getBlockPL(blockArea);
blockPL.setCurrentLineArea(lineArea);
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FOTextPL.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FOTextPL.java 2007-03-26 21:54:48 UTC (rev 9021)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FOTextPL.java 2007-03-26 22:05:24 UTC (rev 9022)
@@ -101,7 +101,7 @@
start = addTextItemToLine(la, lineText, start, end, retrieveMarker);
while (start != -1) {
final BlockPL blockPL = getLayout().getBlockPL(ba);
- la = ba.createNextLineArea(false);
+ la = ba.makeLineArea(false);
blockPL.setCurrentLineArea(la);
if (la == null) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-03-27 21:36:20
|
Revision: 9035
http://svn.sourceforge.net/foray/?rev=9035&view=rev
Author: victormote
Date: 2007-03-27 14:36:20 -0700 (Tue, 27 Mar 2007)
Log Message:
-----------
Implement new axsl method, and use it to handle table-omit-header-at-break.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TablePL.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java 2007-03-27 21:13:50 UTC (rev 9034)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java 2007-03-27 21:36:20 UTC (rev 9035)
@@ -202,10 +202,9 @@
}
/**
- * Indicates whether this is the first child of this area's "generated-by".
- * @return True iff this is the first child of this area's "generated-by".
+ * {@inheritDoc}
*/
- protected boolean isFirstChildOfGeneratedBy() {
+ public boolean isFirstChildOfGeneratedBy() {
return this.getNormalLinkage().isFirstGeneratedBy(this);
}
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TablePL.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TablePL.java 2007-03-27 21:13:50 UTC (rev 9034)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TablePL.java 2007-03-27 21:36:20 UTC (rev 9035)
@@ -122,15 +122,22 @@
final TableArea tableArea = bcArea.makeTableArea(table,
retrieveMarker);
- /* Process the table header. */
- Status status = layoutTableHeader(tableArea, retrieveMarker);
- if (status.isIncomplete()) {
- this.resetAll(tableArea);
- return Status.AREA_FULL_NONE;
+ Status status = null;
+
+ /* Process the table header if we are on the first page/column, or if
+ * we are not to omit at breaks. */
+ if (tableArea.isFirstChildOfGeneratedBy()
+ || ! this.table.traitTableOmitHeaderAtBreak(tableArea)) {
+ status = layoutTableHeader(tableArea, retrieveMarker);
+ if (status.isIncomplete()) {
+ this.resetAll(tableArea);
+ return Status.AREA_FULL_NONE;
+ }
}
/* See if the table footer will fit.
- * The AreaTree is responsible to keep the order and position of the
+ * We don't really want the footer to come before the body, but the
+ * AreaTree is responsible to keep the order and position of the
* Areas correct. */
status = layoutTableFooter(tableArea, retrieveMarker);
if (status.isIncomplete()) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-03-27 22:08:15
|
Revision: 9036
http://svn.sourceforge.net/foray/?rev=9036&view=rev
Author: victormote
Date: 2007-03-27 15:08:16 -0700 (Tue, 27 Mar 2007)
Log Message:
-----------
Conform to axsl changes removing method.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/Area.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/AbstractTableBodyPL.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/Area.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2007-03-27 21:36:20 UTC (rev 9035)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2007-03-27 22:08:16 UTC (rev 9036)
@@ -304,7 +304,11 @@
}
/**
- * {@inheritDoc}
+ * Returns the "absolute-position" trait for this Area.
+ * @return The "absolute-position" trait, one of
+ * {@link FoValue#AUTO},
+ * {@link FoValue#ABSOLUTE}, or
+ * {@link FoValue#FIXED}.
*/
public FoValue traitAbsolutePosition() {
return traitGeneratedBy().traitAbsolutePosition(this);
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/AbstractTableBodyPL.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/AbstractTableBodyPL.java 2007-03-27 21:36:20 UTC (rev 9035)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/AbstractTableBodyPL.java 2007-03-27 22:08:16 UTC (rev 9036)
@@ -31,9 +31,7 @@
import org.axsl.areaW.AbstractTableContainer;
import org.axsl.areaW.Area;
import org.axsl.areaW.AreaWException;
-import org.axsl.areaW.BlockContainerRA;
import org.axsl.areaW.TableArea;
-import org.axsl.common.FoValue;
import org.axsl.foR.FOContext;
import org.axsl.foR.FONode;
import org.axsl.foR.fo.AbstractTableBody;
@@ -92,30 +90,6 @@
}
/**
- * Return true if the passed area is on the left edge of its nearest
- * absolute AreaContainer (generally a page column).
- * @param inputArea The area to be tested.
- * @return True iff the passed area is one the left edge.
- */
- private boolean startsAC(final Area inputArea) {
- Area area = inputArea;
- Area parent = null;
-
- while ((parent = area.getParentArea()) != null &&
- parent.hasChildren() == false) {
- // The area will be the first non-space child in its parent
- // Note: it's not added yet!
- if (parent instanceof BlockContainerRA &&
- ((BlockContainerRA) parent).traitAbsolutePosition()
- == FoValue.ABSOLUTE) {
- return true;
- }
- area = parent;
- }
- return false;
- }
-
- /**
* {@inheritDoc}
*/
public abstract AbstractTableBody getFONode();
@@ -205,8 +179,7 @@
}
/* Tell the row whether it is at the top of this area: if so, the
- * row should not honor keep-together.
- */
+ * row should not honor keep-together. */
boolean bRowStartsArea = i == getProgress();
if (bRowStartsArea == false && keepWith.size() > 0) {
if (node.getChildren().indexOf(keepWith.get(0))
@@ -214,7 +187,7 @@
bRowStartsArea = true;
}
}
- rowPL.setIgnoreKeepTogether(bRowStartsArea && startsAC(tableArea));
+ rowPL.setIgnoreKeepTogether(bRowStartsArea);
Status status = rowPL.layout(areaContainer, retrieveMarker);
if (status.isIncomplete()) {
// BUG!!! don't distinguish between break-before and after!
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-03-27 22:14:04
|
Revision: 9037
http://svn.sourceforge.net/foray/?rev=9037&view=rev
Author: victormote
Date: 2007-03-27 15:14:04 -0700 (Tue, 27 Mar 2007)
Log Message:
-----------
Conform to axsl change renaming method.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/Area.java
trunk/foray/foray-areatree/src/java/org/foray/area/AreaFixed.java
trunk/foray/foray-areatree/src/java/org/foray/area/AreaFlexible.java
trunk/foray/foray-areatree/src/java/org/foray/area/FootnoteRA.java
trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/NormalBlockArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/SpanRA.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/ExternalGraphicPL.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/Area.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2007-03-27 22:08:16 UTC (rev 9036)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2007-03-27 22:14:04 UTC (rev 9037)
@@ -1220,7 +1220,7 @@
/**
* {@inheritDoc}
*/
- public abstract int progressionDimensionAvailable();
+ public abstract int pdAvailable();
/**
* {@inheritDoc}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AreaFixed.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/AreaFixed.java 2007-03-27 22:08:16 UTC (rev 9036)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaFixed.java 2007-03-27 22:14:04 UTC (rev 9037)
@@ -48,7 +48,7 @@
/**
* {@inheritDoc}
*/
- public int progressionDimensionAvailable() {
+ public int pdAvailable() {
int dimension = brBPD();
final List<AreaNode> children = getChildren();
for (int i = 0; i < children.size(); i++) {
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AreaFlexible.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/AreaFlexible.java 2007-03-27 22:08:16 UTC (rev 9036)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaFlexible.java 2007-03-27 22:14:04 UTC (rev 9037)
@@ -292,8 +292,8 @@
/**
* {@inheritDoc}
*/
- public int progressionDimensionAvailable() {
- return getParentArea().progressionDimensionAvailable();
+ public int pdAvailable() {
+ return getParentArea().pdAvailable();
}
/**
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/FootnoteRA.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/FootnoteRA.java 2007-03-27 22:08:16 UTC (rev 9036)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/FootnoteRA.java 2007-03-27 22:14:04 UTC (rev 9037)
@@ -118,11 +118,11 @@
/**
* {@inheritDoc}
*/
- public int progressionDimensionAvailable() {
+ public int pdAvailable() {
/* The amount of space available to the footnote area is what is
* available in the body region. */
final Area parentArea = this.getParentArea();
- return parentArea.progressionDimensionAvailable();
+ return parentArea.pdAvailable();
}
/**
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2007-03-27 22:08:16 UTC (rev 9036)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2007-03-27 22:14:04 UTC (rev 9037)
@@ -121,9 +121,9 @@
case START:
return 0;
case END:
- return this.progressionDimensionAvailable();
+ return this.pdAvailable();
case CENTER:
- return this.progressionDimensionAvailable() / 2;
+ return this.pdAvailable() / 2;
case JUSTIFY:
return 0;
case NOT_A_KEYWORD: {
@@ -208,7 +208,7 @@
* as possible.
*/
private void optimizeLeaders() {
- final int unusedSpace = this.progressionDimensionAvailable();
+ final int unusedSpace = this.pdAvailable();
// If line is already justified, no optimization possible.
if (unusedSpace == 0) {
return;
@@ -303,7 +303,7 @@
* Optimize the specified word-spacing.
*/
private void optimizeSpecifiedWordSpacing() {
- final int unusedSpace = this.progressionDimensionAvailable();
+ final int unusedSpace = this.pdAvailable();
// If line is already justified, no optimization possible.
if (unusedSpace == 0) {
return;
@@ -388,7 +388,7 @@
* Optimize the specified word-spacing.
*/
private void optimizeSpecifiedLetterSpacing() {
- final int unusedSpace = this.progressionDimensionAvailable();
+ final int unusedSpace = this.pdAvailable();
// If line is already justified, no optimization possible.
if (unusedSpace == 0) {
return;
@@ -474,7 +474,7 @@
* Optimize this line for implied word-spacing.
*/
private void optimizeImpliedWordSpacing() {
- final int unusedSpace = this.progressionDimensionAvailable();
+ final int unusedSpace = this.pdAvailable();
// If line is already justified, no optimization possible.
if (unusedSpace == 0) {
return;
@@ -658,7 +658,7 @@
* What LineArea needs to report here is its own content rectangle IPD
* less the amount used by its children.
*/
- public int progressionDimensionAvailable() {
+ public int pdAvailable() {
// First, get the total usable line length.
int dimension = crIPD();
// Now, subtract the amount already used by children.
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/NormalBlockArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/NormalBlockArea.java 2007-03-27 22:08:16 UTC (rev 9036)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/NormalBlockArea.java 2007-03-27 22:14:04 UTC (rev 9037)
@@ -107,7 +107,7 @@
final int sizeNextLineArea = this.traitFontSize()
+ this.traitHalfLeadingOpt();
if (sizeNextLineArea
- > this.progressionDimensionAvailable()) {
+ > this.pdAvailable()) {
if (allowOverflow) {
final NormalBlockArea newArea = (NormalBlockArea)
this.getOverflowArea(this);
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/SpanRA.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/SpanRA.java 2007-03-27 22:08:16 UTC (rev 9036)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/SpanRA.java 2007-03-27 22:14:04 UTC (rev 9037)
@@ -280,7 +280,7 @@
+ blockArea.traitGeneratedBy().traitHalfLeadingOpt(this);
if (nf.bpdUsedByChildren()
+ sizeNextLine
- <= this.progressionDimensionAvailable()) {
+ <= this.pdAvailable()) {
return true;
}
}
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/ExternalGraphicPL.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/ExternalGraphicPL.java 2007-03-27 22:08:16 UTC (rev 9036)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/ExternalGraphicPL.java 2007-03-27 22:14:04 UTC (rev 9037)
@@ -67,7 +67,7 @@
area.nearestGeneratedByBlockLevelFO();
final int height = realFONode.viewportBPD(area,
parentForDimensions.crBPD());
- if (area.progressionDimensionAvailable()
+ if (area.pdAvailable()
< (height + realFONode.traitSpaceBeforeOptimum(area))) {
return Status.AREA_FULL_NONE;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-03-30 22:42:35
|
Revision: 9049
http://svn.sourceforge.net/foray/?rev=9049&view=rev
Author: victormote
Date: 2007-03-30 15:42:35 -0700 (Fri, 30 Mar 2007)
Log Message:
-----------
Convert a FOray integral array to an aXSL enumeration of SVG elements.
Modified Paths:
--------------
trunk/foray/foray-fotree/.project
trunk/foray/foray-fotree/src/java/org/foray/fotree/svg/ObjectMakerSVG.java
trunk/foray/scripts/checkstyle-suppressions.xml
Modified: trunk/foray/foray-fotree/.project
===================================================================
--- trunk/foray/foray-fotree/.project 2007-03-30 21:41:07 UTC (rev 9048)
+++ trunk/foray/foray-fotree/.project 2007-03-30 22:42:35 UTC (rev 9049)
@@ -10,14 +10,8 @@
<arguments>
</arguments>
</buildCommand>
- <buildCommand>
- <name>com.atlassw.tools.eclipse.checkstyle.CheckstyleBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
- <nature>com.atlassw.tools.eclipse.checkstyle.CheckstyleNature</nature>
</natures>
</projectDescription>
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/svg/ObjectMakerSVG.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/svg/ObjectMakerSVG.java 2007-03-30 21:41:07 UTC (rev 9048)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/svg/ObjectMakerSVG.java 2007-03-30 22:42:35 UTC (rev 9049)
@@ -33,154 +33,24 @@
import org.foray.fotree.PropertyListUnparsed;
import org.foray.fotree.svg.obj.SVGElement;
+import org.axsl.common.SvgObject;
+
import org.xml.sax.Locator;
-import java.util.Arrays;
-
/**
* Factory class for creating formatting objects in the "svg" namespace.
*/
public final class ObjectMakerSVG {
- public static final byte A = 1;
- public static final byte ALTGLYPH = 2;
- public static final byte ANIMATE = 3;
- public static final byte ANIMATECOLOR = 4;
- public static final byte ANIMATEMOTION = 5;
- public static final byte ANIMATETRANSFORM = 6;
- public static final byte CIRCLE = 7;
- public static final byte CLIPPATH = 8;
- public static final byte CURSOR = 9;
- public static final byte DEFS = 10;
- public static final byte DESC = 11;
- public static final byte ELLIPSE = 12;
- public static final byte FEFLOOD = 13;
- public static final byte FEGAUSSIANBLUR = 14;
- public static final byte FEMERGE = 15;
- public static final byte FEMERGENODE = 16;
- public static final byte FEOFFSET = 17;
- public static final byte FILTER = 18;
- public static final byte FONT = 19;
- public static final byte FONT_FACE = 20;
- public static final byte FONT_FACE_SRC = 21;
- public static final byte FONT_FACE_URI = 22;
- public static final byte G = 23;
- public static final byte GLYPH = 24;
- public static final byte HKERN = 25;
- public static final byte IMAGE = 26;
- public static final byte LINE = 27;
- public static final byte LINEARGRADIENT = 28;
- public static final byte MARKER = 29;
- public static final byte MASK = 30;
- public static final byte MISSING_GLYPH = 31;
- public static final byte PATH = 32;
- public static final byte PATTERN = 33;
- public static final byte POLYGON = 34;
- public static final byte POLYLINE = 35;
- public static final byte RADIALGRADIENT = 36;
- public static final byte RECT = 37;
- public static final byte SET = 38;
- public static final byte STOP = 39;
- public static final byte STYLE = 40;
- public static final byte SVG = 41;
- public static final byte SWITCH = 42;
- public static final byte SYMBOL = 43;
- public static final byte TEXT = 44;
- public static final byte TEXTPATH = 45;
- public static final byte TITLE = 46;
- public static final byte TREF = 47;
- public static final byte TSPAN = 48;
- public static final byte USE = 49;
- public static final byte VKERN = 50;
-
/**
- * Keep this list sorted alphabetically, so that we can use a binary
- * search on it.
- */
- private static final String[] OBJECT_NAME_LIST = {
- "", // Use element 0 as a default
- "a",
- "altGlyph",
- "animate",
- "animateColor",
- "animateMotion",
- "animateTransform",
- "circle",
- "clipPath",
- "cursor",
- "defs",
- "desc",
- "ellipse",
- "feFlood",
- "feGaussianBlur",
- "feMerge",
- "feMergeNode",
- "feOffset",
- "filter",
- "font",
- "font-face",
- "font-face-src",
- "font-face-uri",
- "g",
- "glyph",
- "hkern",
- "image",
- "line",
- "linearGradient",
- "marker",
- "mask",
- "missing-glyph",
- "path",
- "pattern",
- "polygon",
- "polyline",
- "radialGradient",
- "rect",
- "set",
- "stop",
- "style",
- "svg",
- "switch",
- "symbol",
- "text",
- "textPath",
- "title",
- "tref",
- "tspan",
- "use",
- "vkern",
- };
-
- /**
* Private constructor. This is a utility class and should never be
* instantiated.
*/
private ObjectMakerSVG() { }
- /**
- * Converts an object name to its integral equivalent.
- * @param objectName The object name to be enumerated.
- * @return The enumerated value of the object name.
- */
- public static byte enumerateObjectName(final String objectName) {
- return (byte) Arrays.binarySearch(OBJECT_NAME_LIST, objectName);
- }
-
- /**
- * Converts an object name enumeration to its String equivalent.
- * @param enumeration The object name enumeration.
- * @return The object name as a String.
- */
- public static String expandObjectNameEnumeration(final byte enumeration) {
- if (enumeration < 1 || enumeration > (OBJECT_NAME_LIST.length - 1)) {
- return OBJECT_NAME_LIST[0];
- }
- return OBJECT_NAME_LIST[enumeration];
- }
-
public static FObj makeObject(final String objectName, final FObj parent,
final PropertyList propertyList, final Locator locator) {
- final byte enumeration = enumerateObjectName(objectName);
+ final SvgObject enumeration = SvgObject.svgValueOf(objectName);
String systemId = null;
int line = 0;
int column = 0;
@@ -189,7 +59,7 @@
line = locator.getLineNumber();
column = locator.getColumnNumber();
}
- if (enumeration < 1 || enumeration >= OBJECT_NAME_LIST.length) {
+ if (enumeration == null) {
return null;
}
// The PropertyList must be of the unparsed variety
@@ -198,7 +68,7 @@
switch (enumeration) {
default: {
return new SVGElement(parent, propertyListUnparsed,
- expandObjectNameEnumeration(enumeration), systemId, line,
+ enumeration.toSVG(), systemId, line,
column);
}
}
Modified: trunk/foray/scripts/checkstyle-suppressions.xml
===================================================================
--- trunk/foray/scripts/checkstyle-suppressions.xml 2007-03-30 21:41:07 UTC (rev 9048)
+++ trunk/foray/scripts/checkstyle-suppressions.xml 2007-03-30 22:42:35 UTC (rev 9049)
@@ -9,7 +9,7 @@
<!-- Suppress partially-implemented checks where not yet implemented. -->
<suppress checks="Javadoc[MV].*"
- files="org.foray.fotree.*"/>
+ files="org.foray.fotree.fo.prop.*"/>
<suppress checks="Javadoc[MV].*"
files="org.foray.pdf.*"/>
<suppress checks="Javadoc[MV].*"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-03-30 22:59:53
|
Revision: 9050
http://svn.sourceforge.net/foray/?rev=9050&view=rev
Author: victormote
Date: 2007-03-30 15:59:52 -0700 (Fri, 30 Mar 2007)
Log Message:
-----------
Javadoc improvements.
Modified Paths:
--------------
trunk/foray/foray-fotree/.project
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/ObjectMakerFO.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/foray/ObjectMakerExtensions.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/svg/NamespaceSVG.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/svg/ObjectMakerSVG.java
trunk/foray/scripts/checkstyle-suppressions.xml
Modified: trunk/foray/foray-fotree/.project
===================================================================
--- trunk/foray/foray-fotree/.project 2007-03-30 22:42:35 UTC (rev 9049)
+++ trunk/foray/foray-fotree/.project 2007-03-30 22:59:52 UTC (rev 9050)
@@ -10,8 +10,14 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>com.atlassw.tools.eclipse.checkstyle.CheckstyleBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>com.atlassw.tools.eclipse.checkstyle.CheckstyleNature</nature>
</natures>
</projectDescription>
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/ObjectMakerFO.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/ObjectMakerFO.java 2007-03-30 22:42:35 UTC (rev 9049)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/ObjectMakerFO.java 2007-03-30 22:59:52 UTC (rev 9050)
@@ -106,6 +106,15 @@
*/
private ObjectMakerFO() { }
+ /**
+ * Converts an unparsed XSL-FO element into an FObj instance that can be
+ * added to the FO Tree.
+ * @param objectName The unparsed XSL-FO element name.
+ * @param parent The parent FObj.
+ * @param propertyList The property list of the parent FObj.
+ * @param locator The SAX Locator object.
+ * @return The new FObj instance for this XSL-FO element.
+ */
public static FObj makeObject(final String objectName, final FObj parent,
final PropertyList propertyList, final Locator locator) {
final FoObject enumeration = FoObject.xslValueOf(objectName);
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/foray/ObjectMakerExtensions.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/foray/ObjectMakerExtensions.java 2007-03-30 22:42:35 UTC (rev 9049)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/foray/ObjectMakerExtensions.java 2007-03-30 22:59:52 UTC (rev 9050)
@@ -79,6 +79,15 @@
return OBJECT_NAME_LIST[enumeration];
}
+ /**
+ * Converts an unparsed extension element into an FObj instance that can be
+ * added to the FO Tree.
+ * @param objectName The unparsed extension element name.
+ * @param parent The parent FObj.
+ * @param propertyList The property list of the parent FObj.
+ * @param locator The SAX Locator object.
+ * @return The new FObj instance for this extension element.
+ */
public static FObj makeObject(final String objectName, final FObj parent,
final PropertyList propertyList, final Locator locator) {
final byte enumeration = enumerateObjectName(objectName);
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/svg/NamespaceSVG.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/svg/NamespaceSVG.java 2007-03-30 22:42:35 UTC (rev 9049)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/svg/NamespaceSVG.java 2007-03-30 22:59:52 UTC (rev 9050)
@@ -48,31 +48,41 @@
*/
public class NamespaceSVG extends Namespace {
+ /**
+ * Constructor.
+ * @param parserClassName The class to be used to parse the SVG.
+ */
public NamespaceSVG(final String parserClassName) {
super();
- // this sets the parser that will be used
- // by default (SVGBrokenLinkProvider)
- // normally the user agent value is used
-// FOTreeBuilder builder = this.getParent();
-// FOTreeControl control = builder.getFOTreeControl();
-// String parserClassName = control.getParserClassName();
XMLResourceDescriptor.setXMLParserClassName(parserClassName);
}
+ /**
+ * {@inheritDoc}
+ */
public String getNamespaceURI() {
return "http://www.w3.org/2000/svg";
}
+ /**
+ * {@inheritDoc}
+ */
public String getTypicalPrefix() {
return "svg";
}
+ /**
+ * {@inheritDoc}
+ */
public FObj parseElementForNS(final String localName,
final FObj currentFObj, final PropertyList list,
final Locator locator) throws FOTreeException {
return ObjectMakerSVG.makeObject(localName, currentFObj, list, locator);
}
+ /**
+ * {@inheritDoc}
+ */
public void parseAttributes(final PropertyList propertyList,
final Attributes attlist, final FObj currentFObj,
final Locator locator, final FOTreeBuilder builder) {
@@ -83,17 +93,21 @@
return;
}
- /*
- * This method is required by the abstract superclass Namespace, but is not
- * used, because the parseAttributes method does all of the work.
+ /**
+ * {@inheritDoc}
*/
public Property parseAttributeForNS(final Attributes attributes,
final String attributeName, final String attributeValue,
final PropertyList propertyList, final Locator locator)
throws PropertyException {
+ /* This method is required by the abstract superclass Namespace, but is
+ * not used, because the parseAttributes method does all of the work. */
return null;
}
+ /**
+ * {@inheritDoc}
+ */
protected PropertyList createNewPropertyList(final String localName,
final Attributes attlist) {
return new PropertyListUnparsed(attlist);
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/svg/ObjectMakerSVG.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/svg/ObjectMakerSVG.java 2007-03-30 22:42:35 UTC (rev 9049)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/svg/ObjectMakerSVG.java 2007-03-30 22:59:52 UTC (rev 9050)
@@ -48,6 +48,15 @@
*/
private ObjectMakerSVG() { }
+ /**
+ * Converts an unparsed SVG element into an FObj instance that can be added
+ * to the FO Tree.
+ * @param objectName The unparsed SVG element name.
+ * @param parent The parent FObj.
+ * @param propertyList The property list of the parent FObj.
+ * @param locator The SAX Locator object.
+ * @return The new FObj instance for this SVG element.
+ */
public static FObj makeObject(final String objectName, final FObj parent,
final PropertyList propertyList, final Locator locator) {
final SvgObject enumeration = SvgObject.svgValueOf(objectName);
Modified: trunk/foray/scripts/checkstyle-suppressions.xml
===================================================================
--- trunk/foray/scripts/checkstyle-suppressions.xml 2007-03-30 22:42:35 UTC (rev 9049)
+++ trunk/foray/scripts/checkstyle-suppressions.xml 2007-03-30 22:59:52 UTC (rev 9050)
@@ -9,8 +9,12 @@
<!-- Suppress partially-implemented checks where not yet implemented. -->
<suppress checks="Javadoc[MV].*"
+ files="org.foray.fotree.fo.obj.*"/>
+ <suppress checks="Javadoc[MV].*"
files="org.foray.fotree.fo.prop.*"/>
<suppress checks="Javadoc[MV].*"
+ files="org.foray.fotree.fo.value.*"/>
+ <suppress checks="Javadoc[MV].*"
files="org.foray.pdf.*"/>
<suppress checks="Javadoc[MV].*"
files="org.foray.render.*"/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-03-30 23:18:57
|
Revision: 9051
http://svn.sourceforge.net/foray/?rev=9051&view=rev
Author: victormote
Date: 2007-03-30 16:18:58 -0700 (Fri, 30 Mar 2007)
Log Message:
-----------
Convert a FOray integral array to an aXSL enumeration of Extension elements.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/java/org/foray/fotree/foray/ObjectMakerExtensions.java
trunk/foray/scripts/checkstyle-suppressions.xml
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/foray/ObjectMakerExtensions.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/foray/ObjectMakerExtensions.java 2007-03-30 22:59:52 UTC (rev 9050)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/foray/ObjectMakerExtensions.java 2007-03-30 23:18:58 UTC (rev 9051)
@@ -32,54 +32,22 @@
import org.foray.fotree.PropertyList;
import org.foray.fotree.foray.obj.ContinuedLabel;
+import org.axsl.common.ExtensionObject;
+
import org.xml.sax.Locator;
-import java.util.Arrays;
-
/**
* Factory class for creating formatting objects in the "foray" namespace.
*/
public final class ObjectMakerExtensions {
- public static final byte CONTINUED_LABEL = 1;
-
/**
- * Keep this list sorted alphabetically, so that we can use a binary
- * search on it.
- */
- private static final String[] OBJECT_NAME_LIST = {
- "", // Use element 0 as a default
- "continued-label",
- };
-
- /**
* Private Constructor. This is a utility class and should never be
* instantiated.
*/
private ObjectMakerExtensions() { }
/**
- * Converts an object name to its integral equivalent.
- * @param objectName The object name to be enumerated.
- * @return The enumerated value of the object name.
- */
- public static byte enumerateObjectName(final String objectName) {
- return (byte) Arrays.binarySearch(OBJECT_NAME_LIST, objectName);
- }
-
- /**
- * Converts an object name enumeration to its String equivalent.
- * @param enumeration The object name enumeration.
- * @return The object name as a String.
- */
- public static String expandObjectNameEnumeration(final byte enumeration) {
- if (enumeration < 1 || enumeration > (OBJECT_NAME_LIST.length - 1)) {
- return OBJECT_NAME_LIST[0];
- }
- return OBJECT_NAME_LIST[enumeration];
- }
-
- /**
* Converts an unparsed extension element into an FObj instance that can be
* added to the FO Tree.
* @param objectName The unparsed extension element name.
@@ -90,7 +58,8 @@
*/
public static FObj makeObject(final String objectName, final FObj parent,
final PropertyList propertyList, final Locator locator) {
- final byte enumeration = enumerateObjectName(objectName);
+ final ExtensionObject enumeration = ExtensionObject.extensionValueOf(
+ objectName);
String systemId = null;
int line = 0;
int column = 0;
Modified: trunk/foray/scripts/checkstyle-suppressions.xml
===================================================================
--- trunk/foray/scripts/checkstyle-suppressions.xml 2007-03-30 22:59:52 UTC (rev 9050)
+++ trunk/foray/scripts/checkstyle-suppressions.xml 2007-03-30 23:18:58 UTC (rev 9051)
@@ -13,7 +13,7 @@
<suppress checks="Javadoc[MV].*"
files="org.foray.fotree.fo.prop.*"/>
<suppress checks="Javadoc[MV].*"
- files="org.foray.fotree.fo.value.*"/>
+ files="org.foray.fotree.value.*"/>
<suppress checks="Javadoc[MV].*"
files="org.foray.pdf.*"/>
<suppress checks="Javadoc[MV].*"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-04-02 23:14:38
|
Revision: 9067
http://svn.sourceforge.net/foray/?rev=9067&view=rev
Author: victormote
Date: 2007-04-02 16:14:39 -0700 (Mon, 02 Apr 2007)
Log Message:
-----------
Javadoc improvements.
Modified Paths:
--------------
trunk/foray/foray-render/src/java/org/foray/render/PrintRenderer.java
trunk/foray/foray-render/src/java/org/foray/render/TempImage.java
trunk/foray/foray-render/src/java/org/foray/render/pcl/PCLRenderer.java
trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java
trunk/foray/foray-render/src/java/org/foray/render/ps/PSGraphics2D.java
trunk/foray/scripts/checkstyle-suppressions.xml
Modified: trunk/foray/foray-render/src/java/org/foray/render/PrintRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/PrintRenderer.java 2007-04-02 22:24:21 UTC (rev 9066)
+++ trunk/foray/foray-render/src/java/org/foray/render/PrintRenderer.java 2007-04-02 23:14:39 UTC (rev 9067)
@@ -47,6 +47,10 @@
*/
public abstract class PrintRenderer extends Renderer {
+ /** A magic-number constant used to compute the width of leaders when they
+ * are "double". Presumably the logic is that the width is divided into
+ * three portions, one for one of the double components, one for the other,
+ * and one for the space between them. */
private static final byte DOUBLE_LEADER_CONSTANT = 3;
/**
Modified: trunk/foray/foray-render/src/java/org/foray/render/TempImage.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/TempImage.java 2007-04-02 22:24:21 UTC (rev 9066)
+++ trunk/foray/foray-render/src/java/org/foray/render/TempImage.java 2007-04-02 23:14:39 UTC (rev 9067)
@@ -43,15 +43,33 @@
*/
public class TempImage implements Graphic {
+ /** The image height, in millipoints. */
private int height;
+
+ /** The image width, in millipoints. */
private int width;
+
+ /** The image color space. */
private ColorSpace colorSpace;
+
+ /** The bitmap data for the image. */
private byte[] bitmaps;
+
+ /** The transparent color. */
private Color transparent = Color.white;
+
+ /** The image's URL. */
private URL url;
+ /**
+ * Constructor.
+ * @param url The image's URL.
+ * @param width The image width, in millipoints.
+ * @param height The image height, in millipoints.
+ * @param result The bitmap data for the image.
+ */
public TempImage(final URL url, final int width, final int height,
- final byte[] result) throws GraphicException {
+ final byte[] result) {
this.url = url;
this.height = height;
this.width = width;
Modified: trunk/foray/foray-render/src/java/org/foray/render/pcl/PCLRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/pcl/PCLRenderer.java 2007-04-02 22:24:21 UTC (rev 9066)
+++ trunk/foray/foray-render/src/java/org/foray/render/pcl/PCLRenderer.java 2007-04-02 23:14:39 UTC (rev 9067)
@@ -66,53 +66,81 @@
*/
public class PCLRenderer extends PrintRenderer {
+ /** Magic number adjustment to allow for an implicit PCL margin. */
private static final int OFFSET_LANDSCAPE = -180;
+ /** Magic number adjustment to allow for an implicit PCL margin. */
private static final int OFFSET_PORTRAIT = -144;
+ /** Constant indicating a portait orientation. */
+ private static final int ORIENTATION_1 = 1;
+
+ /** Constant indicating a (different ??) portait orientation. */
private static final int ORIENTATION_3 = 3;
- private static final int ORIENTATION_1 = 1;
-
+ /** The "dash-on" value for the "dashed" dash pattern. */
private static final int DASHPATTERN_DASHED_DASHON = 3;
+ /** The "dash-off" value for the "dashed" dash pattern. */
private static final int DASHPATTERN_DASHED_DASHOFF = 3;
+ /** The "dash-on" value for the "dotted" dash pattern. */
private static final int DASHPATTERN_DOTTED_DASHON = 1;
+ /** The "dash-off" value for the "dotted" dash pattern. */
private static final int DASHPATTERN_DOTTED_DASHOFF = 3;
+ /** The value into which the font size for the Courier typefaces is divided
+ * when setting their values in the PCL stream. Presumably this is because
+ * they area measured in picas instead of points??? */
private static final float COURIER_FONT_SIZE_FACTOR = 120.01f;
- private static final int FONT_CODE_ZAPF_DINGBATS = 14;
+ /** Constant indicating the font "Helvetica". */
+ private static final int FONT_CODE_HELVETICA = 1;
- private static final int FONT_CODE_SYMBOL = 13;
+ /** Constant indicating the font "Helvetica Oblique". */
+ private static final int FONT_CODE_HELVETICA_OBLIQUE = 2;
- private static final int FONT_CODE_COURIER_BOLD_OBLIQUE = 12;
+ /** Constant indicating the font "Helvetica Bold". */
+ private static final int FONT_CODE_HELVETICA_BOLD = 3;
- private static final int FONT_CODE_COURIER_BOLD = 11;
+ /** Constant indicating the font "Helvetica Bold Oblique". */
+ private static final int FONT_CODE_HELVETICA_BOLD_OBLIQUE = 4;
- private static final int FONT_CODE_COURIER_OBLIQUE = 10;
+ /** Constant indicating the font "Times Roman". */
+ private static final int FONT_CODE_TIMES_ROMAN = 5;
- private static final int FONT_CODE_COURIER = 9;
+ /** Constant indicating the font "Times Italic". */
+ private static final int FONT_CODE_TIMES_ITALIC = 6;
+ /** Constant indicating the font "Times Bold". */
+ private static final int FONT_CODE_TIMES_BOLD = 7;
+
+ /** Constant indicating the font "Times Bold Italic". */
private static final int FONT_CODE_TIMES_BOLD_ITALIC = 8;
- private static final int FONT_CODE_TIMES_BOLD = 7;
+ /** Constant indicating the font "Courier". */
+ private static final int FONT_CODE_COURIER = 9;
- private static final int FONT_CODE_TIMES_ITALIC = 6;
+ /** Constant indicating the font "Courier Oblique". */
+ private static final int FONT_CODE_COURIER_OBLIQUE = 10;
- private static final int FONT_CODE_TIMES_ROMAN = 5;
+ /** Constant indicating the font "Courier Bold". */
+ private static final int FONT_CODE_COURIER_BOLD = 11;
- private static final int FONT_CODE_HELVETICA_BOLD_OBLIQUE = 4;
+ /** Constant indicating the font "Courier Bold Oblique". */
+ private static final int FONT_CODE_COURIER_BOLD_OBLIQUE = 12;
- private static final int FONT_CODE_HELVETICA_BOLD = 3;
+ /** Constant indicating the font "Symbol". */
+ private static final int FONT_CODE_SYMBOL = 13;
- private static final int FONT_CODE_HELVETICA_OBLIQUE = 2;
+ /** Constant indicating the font "Zapf Dingbats". */
+ private static final int FONT_CODE_ZAPF_DINGBATS = 14;
- private static final int FONT_CODE_HELVETICA = 1;
+ /** The thresholds triggering normalization change in resolution. */
+ private static final short[] RESOLUTION_THRESHOLDS = {300, 150, 100, 75};
- private static final short[] RESOLUTION_THRESHOLDS = {300, 150, 100, 75};
+ /** The resolution values to which threshold values should be normalized. */
private static final short[] RESOLUTION_NORMALIZED = {600, 300, 150, 100};
/** Some unexplained margin constant, apparently expressed in decipoints. */
@@ -137,13 +165,29 @@
* WKConstants.POINTS_PER_INCH
* WKConstants.DECIPOINTS_PER_POINT);
- // These variables control the virtual pagination functionality.
+ /** The "curdiv" variable for virtual pagination. */
private int curdiv = 0;
+
+ /** The "divisions" variable for virtual pagination. */
private int divisions = -1;
- private int paperheight = -1; // Paper height in decipoints?
- private int orientation = 0; // 0=default/portrait, 1=landscape.
- private int topmargin = -1; // Top margin in decipoints?
- private int leftmargin = -1; // Left margin in decipoints?
+
+ /** The "paperheight" variable for virtual pagination. This is the paper
+ * height, in decipoints?? */
+ private int paperheight = -1;
+
+ /** The "orientation" variable for virtual pagination. 0 = default/portrait,
+ * 1 = landscape.*/
+ private int orientation = 0;
+
+ /** The "topmargin" variable, in decipoints (??), for virtual pagination. */
+ private int topmargin = -1;
+
+ /** The "leftmargin" variable, in decipoints (??), for virtual
+ * pagination. */
+ private int leftmargin = -1;
+
+ /** The "fullmargin" variable, in decipoints (??), for virtual
+ * pagination. */
private int fullmargin = 0;
/** X Offset to allow for PCL implicit 1/4" left margin. */
@@ -330,6 +374,16 @@
/* TODO: Implement this. */
}
+ /**
+ * Prints the bitmapped image.
+ * @param img The image to print.
+ * @param x The x location on the page.
+ * @param y The y location on the page.
+ * @param w The width of the image.
+ * @param h The height of the image.
+ * @return True iff the printing is successful.
+ * @throws GraphicException For errors during printing.
+ */
boolean printBMP(final Graphic img, final int x, final int y, final int w,
final int h) throws GraphicException {
// Print the passed image file in PCL.
@@ -542,7 +596,12 @@
// currentStream.add("Q\n");
}
-
+ /**
+ * Sets the font to a specifed value.
+ * @param font The font to be set.
+ * @param size The font size to be set, in points.
+ * @param name The "F1", "F2" name of the font???
+ */
public void setFont(final Font font, final float size, final String name) {
int fontcode = 0;
if (name.length() > 1 && name.charAt(0) == 'F') {
Modified: trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2007-04-02 22:24:21 UTC (rev 9066)
+++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2007-04-02 23:14:39 UTC (rev 9067)
@@ -458,6 +458,10 @@
}
}
+ /**
+ * Marks a specified area as being a link.
+ * @param area The area which should be marked as a link.
+ */
protected void createBasicLink(final Area area) {
boolean externalLink = false;
if (area.linkType() == LinkType.EXTERNAL) {
Modified: trunk/foray/foray-render/src/java/org/foray/render/ps/PSGraphics2D.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/ps/PSGraphics2D.java 2007-04-02 22:24:21 UTC (rev 9066)
+++ trunk/foray/foray-render/src/java/org/foray/render/ps/PSGraphics2D.java 2007-04-02 23:14:39 UTC (rev 9067)
@@ -120,6 +120,7 @@
/**
* Constructor supporting the {@link #create()} method.
+ * @param g The wrapped graphic.
*/
public PSGraphics2D(final PSGraphics2D g) {
super(g);
@@ -150,9 +151,9 @@
if (width == -1 || height == -1) {
return false;
}
-
final Dimension size = new Dimension(width, height);
- final BufferedImage buf = buildBufferedImage(size);
+ final BufferedImage buf = new BufferedImage(size.width, size.height,
+ BufferedImage.TYPE_INT_ARGB);
final int colorComponents = ColorSpace.getInstance(ColorSpace.CS_sRGB)
.getNumComponents();
@@ -225,11 +226,6 @@
return true;
}
- public BufferedImage buildBufferedImage(final Dimension size) {
- return new BufferedImage(size.width, size.height,
- BufferedImage.TYPE_INT_ARGB);
- }
-
/**
* {@inheritDoc}
*/
@@ -355,6 +351,12 @@
this.psRenderer.write("clippath");
}
+ /**
+ * Apply the paint to this graphic.
+ * @param paint The paint to use.
+ * @param fill Indicates whether the paint is for fill (true) or stroke
+ * (false).
+ */
protected void applyPaint(final Paint paint, final boolean fill) {
if (paint instanceof GradientPaint) {
final GradientPaint gp = (GradientPaint) paint;
@@ -395,6 +397,10 @@
} else if (paint instanceof TexturePaint) { }
}
+ /**
+ * Draw the graphic using a specified Stroke.
+ * @param stroke The stroke to use for drawing.
+ */
protected void applyStroke(final Stroke stroke) {
if (stroke instanceof BasicStroke) {
final BasicStroke bs = (BasicStroke) stroke;
@@ -666,6 +672,12 @@
this.psRenderer.write("grestore");
}
+ /**
+ * Write the command to the renderer.
+ * @param fill Set to true if filling.
+ * @param stroke Set to true if stroking.
+ * @param nonzero An unknown parameter which seems to have no effect.
+ */
protected void doDrawing(final boolean fill, final boolean stroke,
final boolean nonzero) {
if (fill) {
Modified: trunk/foray/scripts/checkstyle-suppressions.xml
===================================================================
--- trunk/foray/scripts/checkstyle-suppressions.xml 2007-04-02 22:24:21 UTC (rev 9066)
+++ trunk/foray/scripts/checkstyle-suppressions.xml 2007-04-02 23:14:39 UTC (rev 9067)
@@ -17,7 +17,7 @@
<suppress checks="Javadoc[MV].*"
files="org.foray.pdf.*"/>
<suppress checks="Javadoc[MV].*"
- files="org.foray.render.*"/>
+ files="org.foray.render.awt.*"/>
<!-- Suppress Javadoc package documentation for test directories. -->
<suppress checks="PackageHtml"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-04-03 20:39:00
|
Revision: 9084
http://svn.sourceforge.net/foray/?rev=9084&view=rev
Author: victormote
Date: 2007-04-03 13:38:55 -0700 (Tue, 03 Apr 2007)
Log Message:
-----------
Javadoc improvements.
Modified Paths:
--------------
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFEncryption.java
trunk/foray/scripts/checkstyle-suppressions.xml
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFEncryption.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFEncryption.java 2007-04-03 20:12:03 UTC (rev 9083)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFEncryption.java 2007-04-03 20:38:55 UTC (rev 9084)
@@ -54,10 +54,14 @@
* Private inner class for the encryption filter.
*/
public class EncryptionFilter extends PSEncodeFilter {
+
+ /** The encryption object computing the filtering. */
private PDFEncryption encryption;
/**
* The constructor for the internal PDFEncryption filter.
+ * @param outputStream The stream to which the encrypted data should be
+ * written.
* @param encryption The encryption object to use.
*/
public EncryptionFilter(final OutputStream outputStream,
@@ -99,13 +103,6 @@
return encryption.encryptData(data, getNumber(), getGeneration());
}
- /**
- * Unimplemented.
- */
- public byte[] decode(final byte[] input) {
- return input;
- }
-
}
/** Constant for printing permission. */
@@ -120,11 +117,16 @@
/** Constant for annotation editing permission. */
public static final int PERMISSION_EDIT_ANNOTATIONS = 32;
- static final char [] PAD = {
+ /** The padding that is added to the password if it is less than 32 bytes
+ * long. These values are specified in PDF Reference, 3rd Edition,
+ * Section 3.5.2. */
+ static final char[] PAD = {
0x28, 0xBF, 0x4E, 0x5E, 0x4E, 0x75, 0x8A, 0x41,
0x64, 0x00, 0x4E, 0x56, 0xFF, 0xFA, 0x01, 0x08,
0x2E, 0x2E, 0x00, 0xB6, 0xD0, 0x68, 0x3E, 0x80,
0x2F, 0x0C, 0xA9, 0xFE, 0x64, 0x53, 0x69, 0x7A };
+
+ /** The array of valid hexadecimal digits. */
static final char[] DIGITS = {'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
@@ -141,19 +143,46 @@
private static final int DEFAULT_PERMISSIONS = -4;
// Encryption tools
+
+ /** The message digest. */
private MessageDigest digest = null;
+
+ /** The cipher. */
private Cipher cipher = null;
+
+ /** The random number generator. */
private Random random = new Random();
+
// Control attributes
+
+ /** The user password. */
private String userPassword = "";
+
+ /** The owner password. */
private String ownerPassword = "";
+
+ /** Indicates whether printing is allowed. */
private boolean allowPrint = true;
+
+ /** Indicates whether content can be copied. */
private boolean allowCopyContent = true;
+
+ /** Indicates whether content can be edited. */
private boolean allowEditContent = true;
+
+ /** Indicates whether annotations can be edited. */
private boolean allowEditAnnotations = true;
+
// Output attributes
- private byte [] fileID = null;
- private byte [] encryptionKey = null;
+
+ /** A randomly-generated id for the file. */
+ private byte[] fileID = null;
+
+ /** The encryption key. */
+ private byte[] encryptionKey = null;
+
+ /** The dictionary entry to be written into the PDF file describing the
+ * encryption. */
private String dictionary = null;
/**
@@ -232,26 +261,38 @@
this.allowEditAnnotations = value;
}
- // Internal procedures
+ /**
+ * Convert the String password to an array of bytes, truncating or padding
+ * as needed.
+ * @param password The String password.
+ * @return The padded or truncated password.
+ */
+ private byte[] prepPassword(final String password) {
+ final byte[] obuffer = new byte[PASSWORD_SIZE];
+ final byte[] pbuffer = password.getBytes();
- private byte [] prepPassword(final String password) {
- final byte [] obuffer = new byte[PASSWORD_SIZE];
- final byte [] pbuffer = password.getBytes();
-
int i = 0;
int j = 0;
while (i < obuffer.length && i < pbuffer.length) {
- obuffer[i] = pbuffer[i]; i++;
+ obuffer[i] = pbuffer[i];
+ i++;
}
+
+ /* Add padding if necessary. */
while (i < obuffer.length) {
obuffer[i++] = (byte) PAD[j++];
}
-
return obuffer;
}
- private String toHex(final byte [] value) {
+ /**
+ * Converts an array of bytes to String of its hexadecimal equivalent.
+ * @param value The bytes to be converted.
+ * @return A String containing the hex equivalent of the byte input, that
+ * is, a byte whose value is 7B will be converted to the String "7B".
+ */
+ private String toHex(final byte[] value) {
final StringBuilder buffer = new StringBuilder();
for (int i = 0; i < value.length; i++) {
@@ -269,7 +310,7 @@
* Returns the document file ID.
* @return The file ID.
*/
- public byte [] getFileID() {
+ public byte[] getFileID() {
if (fileID == null) {
fileID = new byte[FILE_ID_SIZE];
random.nextBytes(fileID);
@@ -293,7 +334,13 @@
return toHex(id);
}
- private byte [] encryptWithKey(final byte [] data, final byte [] key) {
+ /**
+ * Encrypts a chunk of data with a key.
+ * @param data The data to be encrypted.
+ * @param key The key to use during encryption.
+ * @return The encrypted data.
+ */
+ private byte[] encryptWithKey(final byte[] data, final byte[] key) {
try {
final SecretKeySpec keyspec = new SecretKeySpec(key, "RC4");
cipher.init(Cipher.ENCRYPT_MODE, keyspec);
@@ -307,6 +354,13 @@
}
}
+ /**
+ * Encrypts a chunk of data with a hash.
+ * @param data The data to be encrypted.
+ * @param hash The hash to use during encryption.
+ * @param keySize The size of the key.
+ * @return The encrypted data.
+ */
private byte[] encryptWithHash(final byte[] data, final byte[] hash,
final int keySize) {
final byte[] hashToUse = digest.digest(hash);
@@ -421,6 +475,8 @@
/**
* Creates PSEncodeFilter for the encryption object.
+ * @param outputStream The output stream to which the encrypted data should
+ * be written.
* @return The resulting filter.
*/
public PSEncodeFilter makeFilter(final OutputStream outputStream) {
@@ -438,6 +494,10 @@
return this.dictionary;
}
+ /**
+ * Indicates whether encryption is available in the current environment.
+ * @return True iff encryption is available in the current environment.
+ */
public static boolean encryptionAvailable() {
return true;
}
Modified: trunk/foray/scripts/checkstyle-suppressions.xml
===================================================================
--- trunk/foray/scripts/checkstyle-suppressions.xml 2007-04-03 20:12:03 UTC (rev 9083)
+++ trunk/foray/scripts/checkstyle-suppressions.xml 2007-04-03 20:38:55 UTC (rev 9084)
@@ -15,7 +15,7 @@
<suppress checks="Javadoc[MV].*"
files="org.foray.fotree.value.*"/>
<suppress checks="Javadoc[MV].*"
- files="org.foray.pdf.*"/>
+ files="org.foray.pdf.svg.*"/>
<suppress checks="Javadoc[MV].*"
files="org.foray.render.awt.*"/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-04-03 22:01:22
|
Revision: 9087
http://svn.sourceforge.net/foray/?rev=9087&view=rev
Author: victormote
Date: 2007-04-03 15:01:20 -0700 (Tue, 03 Apr 2007)
Log Message:
-----------
Javadoc improvements.
Modified Paths:
--------------
trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTextPainter.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTranscoder.java
trunk/foray/foray-render/src/java/org/foray/render/ps/PSGraphics2D.java
trunk/foray/scripts/checkstyle-suppressions.xml
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java 2007-04-03 21:45:38 UTC (rev 9086)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java 2007-04-03 22:01:20 UTC (rev 9087)
@@ -549,6 +549,10 @@
currentStream.write("Q\n");
}
+ /**
+ * Clip the document to a specific shape.
+ * @param s The shape to which the document should be clipped.
+ */
protected void writeClip(final Shape s) {
if (s == null) {
return;
@@ -592,6 +596,11 @@
currentStream.write("n\n");
}
+ /**
+ * Apply a color to the document.
+ * @param col The color to be applied.
+ * @param fill Set to true if the color is for fill, false if for stroke.
+ */
protected void applyColor(final Color col, final boolean fill) {
final Color c = col;
if (c.getColorSpace().getType()
@@ -632,6 +641,11 @@
}
}
+ /**
+ * Apply a paint to the document.
+ * @param paint The paint to be applied.
+ * @param fill Set to true if the paint is for fill, false if for stroke.
+ */
protected void applyPaint(final Paint paint, final boolean fill) {
if (paint instanceof GradientPaint) {
final GradientPaint gp = (GradientPaint) paint;
@@ -680,6 +694,10 @@
} else if (paint instanceof TexturePaint) { }
}
+ /**
+ * Apply a stroke to the document.
+ * @param stroke The stroke to be applied.
+ */
protected void applyStroke(final Stroke stroke) {
if (stroke instanceof BasicStroke) {
final BasicStroke bs = (BasicStroke) stroke;
@@ -809,6 +827,7 @@
/**
* This method attempts to obtain an org.foray.font.Font instance from a
* java.awt.Font that comes from the Batik environment.
+ * @return The axsl Font, or null if the internal font cannot be converted.
*/
private org.axsl.fontR.FontUse getImplicitFont() {
final Font gFont = getFont();
@@ -967,6 +986,12 @@
currentStream.write("Q\n");
}
+ /**
+ * Add the commands to do the actual drawing.
+ * @param fill Set to true if the item should be filled.
+ * @param stroke Set to true if the item should be stroked.
+ * @param nonzero Set to true to use the nonzero winding number rule.
+ */
protected void doDrawing(final boolean fill, final boolean stroke,
final boolean nonzero) {
if (fill) {
@@ -996,6 +1021,10 @@
return new PDFGraphicsConfiguration();
}
+ /**
+ * Initializes the graphics environment, specifically by ensuring that one
+ * exists.
+ */
private void initGraphicalEnvironment() {
try {
final BufferedImage bi = new BufferedImage(1, 1,
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTextPainter.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTextPainter.java 2007-04-03 21:45:38 UTC (rev 9086)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTextPainter.java 2007-04-03 22:01:20 UTC (rev 9087)
@@ -127,7 +127,12 @@
}
-
+ /**
+ * Paints a set of text runs.
+ * @param textRuns The text runs to paint.
+ * @param g2d The graphics environment.
+ * @param loc The location at which the text items should be painted.
+ */
protected void paintTextRuns(final List<?> textRuns, final Graphics2D g2d,
final Point2D loc) {
Point2D currentloc = loc;
@@ -139,14 +144,24 @@
}
}
-
+ /**
+ * Paints a text runs.
+ * @param run The text run to paint.
+ * @param g2d The graphics environment.
+ * @param loc The location at which the text item should be painted.
+ * @return The ending point.
+ */
protected Point2D paintTextRun(final StrokingTextPainter.TextRun run,
final Graphics2D g2d, final Point2D loc) {
final AttributedCharacterIterator aci = run.getACI();
return paintACI(aci, g2d, loc);
}
-
+ /**
+ * Converts the text in an AttributedCharacterIterator into a String.
+ * @param aci The iterator containing the needed text.
+ * @return The iterator text as a String.
+ */
protected String getText(final AttributedCharacterIterator aci) {
final StringBuilder sb = new StringBuilder(aci.getEndIndex()
- aci.getBeginIndex());
@@ -157,7 +172,13 @@
return sb.toString();
}
-
+ /**
+ * Paints an AttributedCharacterIterator.
+ * @param aci The iterator whose content should be painted.
+ * @param g2d The graphics environment.
+ * @param loc The location at which the text should be painted.
+ * @return The ending point.
+ */
protected Point2D paintACI(final AttributedCharacterIterator aci,
final Graphics2D g2d, final Point2D loc) {
aci.first();
@@ -282,6 +303,10 @@
* @param aci The attributed character iterator.
* @param g2d The graphics 2D.
* @param size The size, in points, of the text to be written.
+ * @param italic Set to true if the font should be italic.
+ * @param bold Set to true if the font should be bold.
+ * @return The axsl font, or null if one cannot be matched.
+ * @throws FontException For errors during font selection.
*/
private org.axsl.fontR.FontUse getFontToUse(
final AttributedCharacterIterator aci, final Graphics2D g2d,
@@ -357,11 +382,6 @@
return null;
}
- public Mark selectAll(final double x, final double y, final TextNode node) {
- logger.info("PDFText selectAll");
- return null;
- }
-
/**
* {@inheritDoc}
*/
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTranscoder.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTranscoder.java 2007-04-03 21:45:38 UTC (rev 9086)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTranscoder.java 2007-04-03 22:01:20 UTC (rev 9087)
@@ -98,6 +98,8 @@
*/
public class PDFTranscoder extends XMLAbstractTranscoder {
+ /** An constant whose purpose is not understood. TODO: Document this
+ * better. */
public static final TranscodingHints.Key KEY_STROKE_TEXT =
new StringKey();
Modified: trunk/foray/foray-render/src/java/org/foray/render/ps/PSGraphics2D.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/ps/PSGraphics2D.java 2007-04-03 21:45:38 UTC (rev 9086)
+++ trunk/foray/foray-render/src/java/org/foray/render/ps/PSGraphics2D.java 2007-04-03 22:01:20 UTC (rev 9087)
@@ -676,7 +676,7 @@
* Write the command to the renderer.
* @param fill Set to true if filling.
* @param stroke Set to true if stroking.
- * @param nonzero An unknown parameter which seems to have no effect.
+ * @param nonzero Set to true to use the nonzero winding number rule.
*/
protected void doDrawing(final boolean fill, final boolean stroke,
final boolean nonzero) {
Modified: trunk/foray/scripts/checkstyle-suppressions.xml
===================================================================
--- trunk/foray/scripts/checkstyle-suppressions.xml 2007-04-03 21:45:38 UTC (rev 9086)
+++ trunk/foray/scripts/checkstyle-suppressions.xml 2007-04-03 22:01:20 UTC (rev 9087)
@@ -15,8 +15,6 @@
<suppress checks="Javadoc[MV].*"
files="org.foray.fotree.value.*"/>
<suppress checks="Javadoc[MV].*"
- files="org.foray.pdf.svg.*"/>
- <suppress checks="Javadoc[MV].*"
files="org.foray.render.awt.*"/>
<!-- Suppress Javadoc package documentation for test directories. -->
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-04-03 23:29:15
|
Revision: 9090
http://svn.sourceforge.net/foray/?rev=9090&view=rev
Author: victormote
Date: 2007-04-03 16:29:15 -0700 (Tue, 03 Apr 2007)
Log Message:
-----------
Move test of column numbers from layout to FOTree, and change its nature from a test to a reporting function to make sure the Table knows how many columns it actually has.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Table.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/TableCell.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableRowPL.java
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Table.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Table.java 2007-04-03 22:15:28 UTC (rev 9089)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/Table.java 2007-04-03 23:29:15 UTC (rev 9090)
@@ -57,6 +57,9 @@
* order. */
private TableColumn[] columns;
+ /** The maximum column number reported by the cells as they are parsed. */
+ private int maxColumnFromCells;
+
/**
* Constructor.
* @param parent The parent FObj.
@@ -217,7 +220,7 @@
* @return The number of columns in this table.
*/
public int numberOfColumns() {
- return this.columns.length;
+ return Math.max(this.columns.length, this.maxColumnFromCells);
}
/**
@@ -260,4 +263,18 @@
return factory.makeProxy(this);
}
+ /**
+ * This method is used by child cells at parse time to report their maximum
+ * column number, so that the table can adjust the number of columns that
+ * it contains if necessary.
+ * @param maxColumnNumber The maximum column number occupied by the
+ * reporting cell. If the cell starts in column 3 and spans 2 columns, the
+ * maxColumnNumber is 4.
+ */
+ public void reportMaxColumnNumber(final int maxColumnNumber) {
+ if (maxColumnNumber > this.maxColumnFromCells) {
+ this.maxColumnFromCells = maxColumnNumber;
+ }
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/TableCell.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/TableCell.java 2007-04-03 22:15:28 UTC (rev 9089)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/TableCell.java 2007-04-03 23:29:15 UTC (rev 9090)
@@ -70,7 +70,21 @@
* {@inheritDoc}
*/
protected void validateProperties() throws FOTreeException {
- return;
+ /* There is no need to test that the column number is a positive
+ * integer. If specified, the property itself is required to return
+ * the nearest integer value greater than or equal to one. */
+
+ /* There also is no need to test that the column number does not
+ * exceed some limit on the number of columns. It appears instead that
+ * the column number and column span of the cells dictates to the table
+ * how many columns it contains. Therefore, what needs to be done here
+ * is to notify the table so that it knows how many columns it does
+ * have. */
+ final Table ancestorTable = this.getNearestTable(null);
+ final int cellColNum = this.traitColumnNumber(null);
+ final int numCols = this.traitNumberColumnsSpanned();
+ final int maxCellOccupied = cellColNum + numCols - 1;
+ ancestorTable.reportMaxColumnNumber(maxCellOccupied);
}
/**
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableRowPL.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableRowPL.java 2007-04-03 22:15:28 UTC (rev 9089)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableRowPL.java 2007-04-03 23:29:15 UTC (rev 9090)
@@ -97,24 +97,8 @@
final TableCell cell = (TableCell) this.node.getChildren().get(i);
int numCols = cell.traitNumberColumnsSpanned();
- int cellColNum = cell.traitColumnNumber(context);
+ final int cellColNum = cell.traitColumnNumber(context);
- if (cellColNum == 0) {
- // Not explicitly specified, so put in next available colummn
- // cell.setColumnNumber(colNum);
- // If cellColNum "off the end", this cell is in limbo!
- if (colNum < 1) {
- throw new AreaWException("Cell (#" + i + ") implicitly "
- + "positioned beyond number of columns");
- }
- cellColNum = colNum;
- } else if (cellColNum > columns.length) {
- // Explicit colomn number specification out of range, skip it.
- getLayout().getLogger().error("Cell (#" + i + ") explicitly "
- + "positioned beyond number of columns, dropped:\n"
- + cell.getContextMessage());
- continue;
- }
// see if it fits and doesn't overwrite anything
if (cellColNum + numCols - 1 > columns.length) {
// Too many columns spanned.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-04-05 16:58:34
|
Revision: 9110
http://svn.sourceforge.net/foray/?rev=9110&view=rev
Author: victormote
Date: 2007-04-05 09:58:35 -0700 (Thu, 05 Apr 2007)
Log Message:
-----------
Conform to axsl change renaming interface.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/AbstractTableBody.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/AbstractTableBodyPL.java
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/AbstractTableBody.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/AbstractTableBody.java 2007-04-05 16:44:10 UTC (rev 9109)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/AbstractTableBody.java 2007-04-05 16:58:35 UTC (rev 9110)
@@ -40,7 +40,7 @@
* in XSL-FO.
*/
public abstract class AbstractTableBody extends FObj
- implements org.axsl.foR.fo.AbstractTableBody {
+ implements org.axsl.foR.fo.AbstractTablePart {
/** If the children of this are table-cells instead of table-rows, this
* keeps track of the current pseudo row that is inserted as a parent of
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/AbstractTableBodyPL.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/AbstractTableBodyPL.java 2007-04-05 16:44:10 UTC (rev 9109)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/AbstractTableBodyPL.java 2007-04-05 16:58:35 UTC (rev 9110)
@@ -33,7 +33,7 @@
import org.axsl.areaW.AreaWException;
import org.axsl.areaW.TableArea;
import org.axsl.foR.FONode;
-import org.axsl.foR.fo.AbstractTableBody;
+import org.axsl.foR.fo.AbstractTablePart;
import org.axsl.foR.fo.Marker;
import org.axsl.foR.fo.RetrieveMarker;
import org.axsl.foR.fo.Table;
@@ -58,7 +58,7 @@
* @param tableBody The FO Tree object which is being laid out.
* @param layout The ancestor layout system.
*/
- public AbstractTableBodyPL(final AbstractTableBody tableBody,
+ public AbstractTableBodyPL(final AbstractTablePart tableBody,
final PioneerLS layout) {
super(tableBody, layout);
}
@@ -66,14 +66,14 @@
/**
* {@inheritDoc}
*/
- public abstract AbstractTableBody getFONode();
+ public abstract AbstractTablePart getFONode();
/**
* {@inheritDoc}
*/
public Status layout(final Area area, final RetrieveMarker retrieveMarker)
throws AreaWException {
- final AbstractTableBody node = getFONode();
+ final AbstractTablePart node = getFONode();
final TableArea tableArea = (TableArea) area;
final Table table = tableArea.traitGeneratedBy();
if (getProgress() == FONodePL.BREAK_AFTER) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-04-05 17:03:14
|
Revision: 9111
http://svn.sourceforge.net/foray/?rev=9111&view=rev
Author: victormote
Date: 2007-04-05 10:03:14 -0700 (Thu, 05 Apr 2007)
Log Message:
-----------
Conform to axsl change renaming interface.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/AbstractTableContainer.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/AbstractTableBodyPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableRowPL.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AbstractTableContainer.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/AbstractTableContainer.java 2007-04-05 16:58:35 UTC (rev 9110)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/AbstractTableContainer.java 2007-04-05 17:03:14 UTC (rev 9111)
@@ -43,7 +43,7 @@
*/
public abstract class AbstractTableContainer extends ContainerRA
implements BackgroundArea,
- org.axsl.areaW.AbstractTableContainer {
+ org.axsl.areaW.AbstractTablePartContainer {
/** The parent of this node. */
private TableRA parent;
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/AbstractTableBodyPL.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/AbstractTableBodyPL.java 2007-04-05 16:58:35 UTC (rev 9110)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/AbstractTableBodyPL.java 2007-04-05 17:03:14 UTC (rev 9111)
@@ -28,7 +28,7 @@
package org.foray.pioneer;
-import org.axsl.areaW.AbstractTableContainer;
+import org.axsl.areaW.AbstractTablePartContainer;
import org.axsl.areaW.Area;
import org.axsl.areaW.AreaWException;
import org.axsl.areaW.TableArea;
@@ -100,7 +100,7 @@
* of the containing table area, and its relative position is 0,0.
* Strictly speaking (CR), this FO should generate no areas!
*/
- AbstractTableContainer areaContainer = null;
+ AbstractTablePartContainer areaContainer = null;
if (node instanceof TableBody) {
areaContainer = tableArea.makeTableBodyContainer(
(TableBody) node, retrieveMarker);
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableRowPL.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableRowPL.java 2007-04-05 16:58:35 UTC (rev 9110)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableRowPL.java 2007-04-05 17:03:14 UTC (rev 9111)
@@ -28,7 +28,7 @@
package org.foray.pioneer;
-import org.axsl.areaW.AbstractTableContainer;
+import org.axsl.areaW.AbstractTablePartContainer;
import org.axsl.areaW.Area;
import org.axsl.areaW.AreaWException;
import org.axsl.areaW.TableRowContainer;
@@ -91,7 +91,8 @@
}
}
- final AbstractTableContainer container = (AbstractTableContainer) area;
+ final AbstractTablePartContainer container =
+ (AbstractTablePartContainer) area;
final TableRowContainer rowContainer = container.makeTableRowContainer(
this.node, retrieveMarker);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-04-05 17:09:48
|
Revision: 9112
http://svn.sourceforge.net/foray/?rev=9112&view=rev
Author: victormote
Date: 2007-04-05 10:09:15 -0700 (Thu, 05 Apr 2007)
Log Message:
-----------
Rename 3 classes for clarity and for consistency with new aXSL interface names.
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
trunk/foray/foray-areatree/src/java/org/foray/area/TableRA.java
trunk/foray/foray-areatree/src/java/org/foray/area/TableRowContainer.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/TableBody.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/TableCell.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/TableFooter.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/TableHeader.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/TableRow.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableBodyPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableFooterPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableHeaderPL.java
Added Paths:
-----------
trunk/foray/foray-areatree/src/java/org/foray/area/AbstractTablePartContainer.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/AbstractTablePart.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/AbstractTablePartPL.java
Removed Paths:
-------------
trunk/foray/foray-areatree/src/java/org/foray/area/AbstractTableContainer.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/AbstractTableBody.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/AbstractTableBodyPL.java
Deleted: trunk/foray/foray-areatree/src/java/org/foray/area/AbstractTableContainer.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/AbstractTableContainer.java 2007-04-05 17:03:14 UTC (rev 9111)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/AbstractTableContainer.java 2007-04-05 17:09:15 UTC (rev 9112)
@@ -1,142 +0,0 @@
-/*
- * Copyright 2004 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.area;
-
-import org.axsl.areaR.BackgroundArea;
-import org.axsl.areaW.AreaWException;
-import org.axsl.common.RelativeAxis;
-import org.axsl.foR.fo.RetrieveMarker;
-import org.axsl.foR.fo.TableRow;
-import org.axsl.graphicR.Graphic;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Abstract superclass for table-body, table-header, and table-footer areas.
- */
-public abstract class AbstractTableContainer extends ContainerRA
- implements BackgroundArea,
- org.axsl.areaW.AbstractTablePartContainer {
-
- /** The parent of this node. */
- private TableRA parent;
-
- /** The children of this node. */
- private List<TableRowContainer> children
- = new ArrayList<TableRowContainer>();
-
- /** See {@link #getProgressionDimension()} for a description of
- * "progression dimension". */
- private int progressionDimension = 0;
-
- /**
- * Protected Constructor.
- * @param parentArea The parent area.
- */
- protected AbstractTableContainer(final TableRA parentArea) {
- this.parent = parentArea;
- }
-
- /**
- * {@inheritDoc}
- */
- public TableRowContainer makeTableRowContainer(final TableRow node,
- final RetrieveMarker retrieveMarker) {
- final TableRowContainer newRow =
- TableRowContainer.makeTableRowContainer(node, this,
- retrieveMarker);
- this.children.add(newRow);
- return newRow;
- }
-
- /**
- * {@inheritDoc}
- */
- public Graphic getGraphic() {
- return this.traitBackgroundImage();
- }
-
- /**
- * {@inheritDoc}
- */
- public RelativeAxis contentStackingAxisRelative() {
- return RelativeAxis.BLOCK_PROGRESSION;
- }
-
- /**
- * {@inheritDoc}
- */
- public TableRA getParent() {
- return this.parent;
- }
-
- /**
- * {@inheritDoc}
- */
- public void setParent(final AreaNode node) throws AreaWException {
- if (node instanceof TableRA) {
- this.parent = (TableRA) node;
- } else {
- throw new AreaWException("Parent of " + this.getAreaName()
- + " must be a Table");
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public List<TableRowContainer> getChildren() {
- return this.children;
- }
-
- /**
- * {@inheritDoc}
- */
- public void setProgressionDimension(final int progressionDimension) {
- setParentPD(progressionDimension);
- this.progressionDimension = progressionDimension;
- }
-
- /**
- * {@inheritDoc}
- */
- public void incrementProgressionDimension(final int incrementAmount) {
- incrementParentPD(incrementAmount);
- this.progressionDimension += incrementAmount;
- }
-
- /**
- * {@inheritDoc}
- */
- public int getProgressionDimension() {
- return this.progressionDimension;
- }
-
-}
Copied: trunk/foray/foray-areatree/src/java/org/foray/area/AbstractTablePartContainer.java (from rev 9111, trunk/foray/foray-areatree/src/java/org/foray/area/AbstractTableContainer.java)
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/AbstractTablePartContainer.java (rev 0)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/AbstractTablePartContainer.java 2007-04-05 17:09:15 UTC (rev 9112)
@@ -0,0 +1,142 @@
+/*
+ * Copyright 2004 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+
+package org.foray.area;
+
+import org.axsl.areaR.BackgroundArea;
+import org.axsl.areaW.AreaWException;
+import org.axsl.common.RelativeAxis;
+import org.axsl.foR.fo.RetrieveMarker;
+import org.axsl.foR.fo.TableRow;
+import org.axsl.graphicR.Graphic;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Abstract superclass for table-body, table-header, and table-footer areas.
+ */
+public abstract class AbstractTablePartContainer extends ContainerRA
+ implements BackgroundArea,
+ org.axsl.areaW.AbstractTablePartContainer {
+
+ /** The parent of this node. */
+ private TableRA parent;
+
+ /** The children of this node. */
+ private List<TableRowContainer> children
+ = new ArrayList<TableRowContainer>();
+
+ /** See {@link #getProgressionDimension()} for a description of
+ * "progression dimension". */
+ private int progressionDimension = 0;
+
+ /**
+ * Protected Constructor.
+ * @param parentArea The parent area.
+ */
+ protected AbstractTablePartContainer(final TableRA parentArea) {
+ this.parent = parentArea;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public TableRowContainer makeTableRowContainer(final TableRow node,
+ final RetrieveMarker retrieveMarker) {
+ final TableRowContainer newRow =
+ TableRowContainer.makeTableRowContainer(node, this,
+ retrieveMarker);
+ this.children.add(newRow);
+ return newRow;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Graphic getGraphic() {
+ return this.traitBackgroundImage();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public RelativeAxis contentStackingAxisRelative() {
+ return RelativeAxis.BLOCK_PROGRESSION;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public TableRA getParent() {
+ return this.parent;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setParent(final AreaNode node) throws AreaWException {
+ if (node instanceof TableRA) {
+ this.parent = (TableRA) node;
+ } else {
+ throw new AreaWException("Parent of " + this.getAreaName()
+ + " must be a Table");
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public List<TableRowContainer> getChildren() {
+ return this.children;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setProgressionDimension(final int progressionDimension) {
+ setParentPD(progressionDimension);
+ this.progressionDimension = progressionDimension;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void incrementProgressionDimension(final int incrementAmount) {
+ incrementParentPD(incrementAmount);
+ this.progressionDimension += incrementAmount;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int getProgressionDimension() {
+ return this.progressionDimension;
+ }
+
+}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TableBodyContainer.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/TableBodyContainer.java 2007-04-05 17:03:14 UTC (rev 9111)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/TableBodyContainer.java 2007-04-05 17:09:15 UTC (rev 9112)
@@ -36,7 +36,7 @@
/**
* Area containing all or part of a table-body.
*/
-public final class TableBodyContainer extends AbstractTableContainer
+public final class TableBodyContainer extends AbstractTablePartContainer
implements org.axsl.areaR.BackgroundArea,
org.axsl.areaW.TableBodyContainer {
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TableFooterContainer.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/TableFooterContainer.java 2007-04-05 17:03:14 UTC (rev 9111)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/TableFooterContainer.java 2007-04-05 17:09:15 UTC (rev 9112)
@@ -36,7 +36,7 @@
/**
* Area containing all or part of a table-footer.
*/
-public final class TableFooterContainer extends AbstractTableContainer
+public final class TableFooterContainer extends AbstractTablePartContainer
implements org.axsl.areaR.BackgroundArea,
org.axsl.areaW.TableFooterContainer {
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TableHeaderContainer.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/TableHeaderContainer.java 2007-04-05 17:03:14 UTC (rev 9111)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/TableHeaderContainer.java 2007-04-05 17:09:15 UTC (rev 9112)
@@ -36,7 +36,7 @@
/**
* Area containing all or part of a table-header.
*/
-public final class TableHeaderContainer extends AbstractTableContainer
+public final class TableHeaderContainer extends AbstractTablePartContainer
implements org.axsl.areaR.BackgroundArea,
org.axsl.areaW.TableHeaderContainer {
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TableRA.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/TableRA.java 2007-04-05 17:03:14 UTC (rev 9111)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/TableRA.java 2007-04-05 17:09:15 UTC (rev 9112)
@@ -63,8 +63,8 @@
private AreaNode parent;
/** The children of this node. */
- private List<AbstractTableContainer> children
- = new ArrayList<AbstractTableContainer>();
+ private List<AbstractTablePartContainer> children
+ = new ArrayList<AbstractTablePartContainer>();
/** See {@link #getProgressionDimension()} for a description of
* "progression dimension". */
@@ -483,7 +483,7 @@
/* 4. Row groups (presumably rows with a span > 1 in XSL-FO). */
/* TODO: We don't know how to do this yet. */
/* 5. Rows. */
- for (AbstractTableContainer tableSegment : this.children) {
+ for (AbstractTablePartContainer tableSegment : this.children) {
for (TableRowContainer row : tableSegment.getChildren()) {
if (this.hasBackground(row)) {
backgroundAreas.add(row);
@@ -564,7 +564,7 @@
/**
* {@inheritDoc}
*/
- public List<AbstractTableContainer> getChildren() {
+ public List<AbstractTablePartContainer> getChildren() {
return this.children;
}
@@ -631,7 +631,7 @@
if (this.children.size() < 1) {
return null;
}
- for (AbstractTableContainer container : this.children) {
+ for (AbstractTablePartContainer container : this.children) {
if (container instanceof TableHeaderContainer) {
return (TableBodyContainer) container;
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TableRowContainer.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/TableRowContainer.java 2007-04-05 17:03:14 UTC (rev 9111)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/TableRowContainer.java 2007-04-05 17:09:15 UTC (rev 9112)
@@ -53,7 +53,7 @@
private FOLinkage generatedBy;
/** The parent of this node. */
- private AbstractTableContainer parent;
+ private AbstractTablePartContainer parent;
/** The children of this node. */
private List<TableCellRA> children = new ArrayList<TableCellRA>();
@@ -64,11 +64,11 @@
/**
* Private Constructor.
- * Use {@link AbstractTableContainer#makeTableRowContainer(TableRow,
+ * Use {@link AbstractTablePartContainer#makeTableRowContainer(TableRow,
* RetrieveMarker)} to create an instance.
* @param parentArea The parent area.
*/
- private TableRowContainer(final AbstractTableContainer parentArea) {
+ private TableRowContainer(final AbstractTablePartContainer parentArea) {
this.parent = parentArea;
}
@@ -81,7 +81,7 @@
* @return The new instance.
*/
static TableRowContainer makeTableRowContainer(final TableRow generatedBy,
- final AbstractTableContainer parentArea,
+ final AbstractTablePartContainer parentArea,
final RetrieveMarker retrieveMarker) {
final TableRowContainer newRow = new TableRowContainer(parentArea);
newRow.generatedBy = newRow.linkage(generatedBy, retrieveMarker);
@@ -164,7 +164,7 @@
/**
* {@inheritDoc}
*/
- public AbstractTableContainer getParent() {
+ public AbstractTablePartContainer getParent() {
return this.parent;
}
@@ -172,8 +172,8 @@
* {@inheritDoc}
*/
public void setParent(final AreaNode node) throws AreaWException {
- if (node instanceof AbstractTableContainer) {
- this.parent = (AbstractTableContainer) node;
+ if (node instanceof AbstractTablePartContainer) {
+ this.parent = (AbstractTablePartContainer) node;
} else {
throw new AreaWException("Parent of TableRowContainer must be an "
+ "AbstractTableContainer");
Deleted: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/AbstractTableBody.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/AbstractTableBody.java 2007-04-05 17:03:14 UTC (rev 9111)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/AbstractTableBody.java 2007-04-05 17:09:15 UTC (rev 9112)
@@ -1,230 +0,0 @@
-/*
- * Copyright 2004 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.fotree.fo.obj;
-
-import org.foray.fotree.FONode;
-import org.foray.fotree.FObj;
-import org.foray.fotree.Namespace;
-import org.foray.fotree.PropertyList;
-
-import org.axsl.foR.FOTreeException;
-
-/**
- * Abstract superclass for table-body, table-header, and table-footer objects
- * in XSL-FO.
- */
-public abstract class AbstractTableBody extends FObj
- implements org.axsl.foR.fo.AbstractTablePart {
-
- /** If the children of this are table-cells instead of table-rows, this
- * keeps track of the current pseudo row that is inserted as a parent of
- * the table-cells. */
- private transient TableRow currentPseudoTableRow;
-
- /** If the children of this are table-cells instead of table-rows, this
- * keeps track of the last table-cell for which a pseudo table-row was
- * provided. This is needed so that its "ends-row" property can be
- * checked.*/
- private transient TableCell lastTableCell;
-
- /**
- * Constructor.
- * @param parent The parent FObj.
- * @param propertyList The property list for this FObj.
- * @param systemId The system-id indicating the location of this object
- * in the source document.
- * @param line The line number of this object in the source document.
- * @param column The column number of this object in the source document.
- */
- public AbstractTableBody(final FObj parent, final PropertyList propertyList,
- final String systemId, final int line, final int column) {
- super(parent, propertyList, systemId, line, column);
- }
-
- /**
- * {@inheritDoc}
- */
- protected void validateAncestry() throws FOTreeException {
- if (this.getParent() instanceof Table) {
- return;
- }
- throwException(getFullName() + " must be child of fo:table.");
- }
-
- /**
- * {@inheritDoc}
- */
- protected void validateProperties() throws FOTreeException {
- return;
- }
-
- /**
- * {@inheritDoc}
- */
- protected void setup() throws FOTreeException {
- return;
- }
-
- /**
- * {@inheritDoc}
- */
- protected void end() throws FOTreeException {
- return;
- }
-
- /**
- * {@inheritDoc}
- */
- protected void validateDescendants() throws FOTreeException {
- this.validateAtLeastOneChild();
- validateDescendantTypes();
- validateOverlap();
- }
-
- /**
- * Validates that the descendants are all of a correct and consistent type.
- * @throws FOTreeException If the children are not of the correct types, or
- * are not consistent.
- */
- private void validateDescendantTypes() throws FOTreeException {
- /* Children must be either all table-rows or all table-cells. */
- final FONode firstChild = this.getChildren().get(0);
- boolean childIsTableRow = true;
- if (firstChild instanceof TableRow) {
- childIsTableRow = true;
- } else if (firstChild instanceof TableCell) {
- childIsTableRow = false;
- } else {
- firstChild.throwException("Children of " + this.getName()
- + " must be either table-row or table-cell.");
- }
- for (int i = 1; i < this.getChildren().size(); i++) {
- final FONode child = this.getChildren().get(i);
- boolean consistent = true;
- if (child instanceof TableRow) {
- if (! childIsTableRow) {
- consistent = false;
- }
- } else if (child instanceof TableCell) {
- final TableCell cell = (TableCell) child;
- if (cell.traitStartsRow(null)) {
- }
- /* The actual child is not a TableRow. */
- if (childIsTableRow) {
- consistent = false;
- }
- } else {
- child.throwException("Children of " + this.getName()
- + " must be either table-row or table-cell.");
- }
- if (! consistent) {
- child.throwException("Children of " + this.getName()
- + " must be all of the same type.");
- }
- }
- }
-
- /**
- * Validates that the descendant cells do not overlap each other.
- * @throws FOTreeException If a descendant cell overlaps another cell.
- */
- private void validateOverlap() throws FOTreeException {
- /* Per XSL-FO 1.0, Section 6.7.3, "It is an error if two table-cells
- * overlap. Such overlap could be due to the same column-number being
- * assigned to two different cells in the same row, or due to column
- * or row spanning causing an overlap." */
- final Table parentTable = this.getNearestTable(null);
- final int qtyRows = this.getChildCount();
- final int qtyColumns = parentTable.numberOfColumns();
- final TableCell[][] cellArray = new TableCell[qtyRows][qtyColumns];
- for (int startingRow = 0; startingRow < qtyRows; startingRow++) {
- final TableRow tableRow = (TableRow) this.getChildAt(startingRow);
- for (int i = 0; i < tableRow.getChildCount(); i++) {
- final TableCell tableCell = (TableCell) tableRow.getChildAt(i);
- final int endingRow = startingRow
- + tableCell.traitNumberRowsSpanned()
- - 1;
- final int startingColumn = tableCell.traitColumnNumber(null)
- - 1;
- final int endingColumn = startingColumn
- + tableCell.traitNumberColumnsSpanned()
- - 1;
- for (int j = startingRow; j <= endingRow; j++) {
- final TableCell[] cellArrayThisRow = cellArray[j];
- for (int k = startingColumn; k <= endingColumn; k++) {
- final TableCell existingCell = cellArrayThisRow[k];
- if (existingCell == null) {
- cellArrayThisRow[k] = tableCell;
- } else {
- tableCell.throwException(
- "Two table-cells occupy the same "
- + "grid unit:\n"
- + existingCell.getContextMessage());
- }
- }
- }
- }
- }
- }
-
- public Namespace getNamespace() {
- return this.getFOTreeBuilder().getFONamespace();
- }
-
- /**
- * For a given child table cell, provide a pseudo parent table row.
- * @param tableCell The table cell for which a parent table row is needed.
- * @return The pseudo parent table row.
- */
- public TableRow getPseudoTableRow(final TableCell tableCell) {
- if (tableCell == null) {
- throw new IllegalArgumentException("tableCell parameter may not be "
- + "null");
- }
- boolean newRowNeeded = false;
- if (this.currentPseudoTableRow == null) {
- newRowNeeded = true;
- }
- if (tableCell.traitStartsRow(null)) {
- newRowNeeded = true;
- }
- if (this.lastTableCell != null
- && this.lastTableCell.traitEndsRow(null)) {
- newRowNeeded = true;
- }
- if (newRowNeeded) {
- final PropertyList propertyList = new PropertyList(null);
- this.currentPseudoTableRow = new TableRow(this, propertyList, null,
- -1, -1, true);
- }
- this.lastTableCell = tableCell;
- return this.currentPseudoTableRow;
- }
-
-}
Copied: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/AbstractTablePart.java (from rev 9110, trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/AbstractTableBody.java)
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/AbstractTablePart.java (rev 0)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/AbstractTablePart.java 2007-04-05 17:09:15 UTC (rev 9112)
@@ -0,0 +1,230 @@
+/*
+ * Copyright 2004 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+
+package org.foray.fotree.fo.obj;
+
+import org.foray.fotree.FONode;
+import org.foray.fotree.FObj;
+import org.foray.fotree.Namespace;
+import org.foray.fotree.PropertyList;
+
+import org.axsl.foR.FOTreeException;
+
+/**
+ * Abstract superclass for table-body, table-header, and table-footer objects
+ * in XSL-FO.
+ */
+public abstract class AbstractTablePart extends FObj
+ implements org.axsl.foR.fo.AbstractTablePart {
+
+ /** If the children of this are table-cells instead of table-rows, this
+ * keeps track of the current pseudo row that is inserted as a parent of
+ * the table-cells. */
+ private transient TableRow currentPseudoTableRow;
+
+ /** If the children of this are table-cells instead of table-rows, this
+ * keeps track of the last table-cell for which a pseudo table-row was
+ * provided. This is needed so that its "ends-row" property can be
+ * checked.*/
+ private transient TableCell lastTableCell;
+
+ /**
+ * Constructor.
+ * @param parent The parent FObj.
+ * @param propertyList The property list for this FObj.
+ * @param systemId The system-id indicating the location of this object
+ * in the source document.
+ * @param line The line number of this object in the source document.
+ * @param column The column number of this object in the source document.
+ */
+ public AbstractTablePart(final FObj parent, final PropertyList propertyList,
+ final String systemId, final int line, final int column) {
+ super(parent, propertyList, systemId, line, column);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected void validateAncestry() throws FOTreeException {
+ if (this.getParent() instanceof Table) {
+ return;
+ }
+ throwException(getFullName() + " must be child of fo:table.");
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected void validateProperties() throws FOTreeException {
+ return;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected void setup() throws FOTreeException {
+ return;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected void end() throws FOTreeException {
+ return;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected void validateDescendants() throws FOTreeException {
+ this.validateAtLeastOneChild();
+ validateDescendantTypes();
+ validateOverlap();
+ }
+
+ /**
+ * Validates that the descendants are all of a correct and consistent type.
+ * @throws FOTreeException If the children are not of the correct types, or
+ * are not consistent.
+ */
+ private void validateDescendantTypes() throws FOTreeException {
+ /* Children must be either all table-rows or all table-cells. */
+ final FONode firstChild = this.getChildren().get(0);
+ boolean childIsTableRow = true;
+ if (firstChild instanceof TableRow) {
+ childIs...
[truncated message content] |
|
From: <vic...@us...> - 2007-04-05 19:32:36
|
Revision: 9113
http://svn.sourceforge.net/foray/?rev=9113&view=rev
Author: victormote
Date: 2007-04-05 12:32:37 -0700 (Thu, 05 Apr 2007)
Log Message:
-----------
Conform to axsl changes of methods for removal to getter methods.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/TableRA.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TablePL.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TableRA.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/TableRA.java 2007-04-05 17:09:15 UTC (rev 9112)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/TableRA.java 2007-04-05 19:32:37 UTC (rev 9113)
@@ -178,7 +178,7 @@
final TableBodyContainer bodyContainer
= TableBodyContainer.makeTableBodyContainer(tableBody, this,
retrieveMarker);
- if (this.getFooterArea() == null) {
+ if (this.getTableFooterContainer() == null) {
/* If there is not yet a footer area, add it to the end. */
this.children.add(bodyContainer);
} else {
@@ -193,17 +193,6 @@
/**
* {@inheritDoc}
*/
- public void removeTableBodyContainer() {
- final TableBodyContainer bodyContainer = this.getBodyArea();
- if (bodyContainer == null) {
- return;
- }
- this.removeChild(bodyContainer);
- }
-
- /**
- * {@inheritDoc}
- */
public TableHeaderContainer makeTableHeaderContainer(
final TableHeader tableHeader,
final RetrieveMarker retrieveMarker) {
@@ -217,17 +206,6 @@
/**
* {@inheritDoc}
*/
- public void removeTableHeaderContainer() {
- final TableHeaderContainer headerContainer = this.getHeaderArea();
- if (headerContainer == null) {
- return;
- }
- this.removeChild(headerContainer);
- }
-
- /**
- * {@inheritDoc}
- */
public TableFooterContainer makeTableFooterContainer(
final TableFooter tableFooter,
final RetrieveMarker retrieveMarker) {
@@ -241,17 +219,6 @@
/**
* {@inheritDoc}
*/
- public void removeTableFooterContainer() {
- final TableFooterContainer footerContainer = this.getFooterArea();
- if (footerContainer == null) {
- return;
- }
- this.removeChild(footerContainer);
- }
-
- /**
- * {@inheritDoc}
- */
public String getAreaName() {
return "table";
}
@@ -621,10 +588,9 @@
}
/**
- * Returns the child body area, if any.
- * @return The child body area, or null if there is no body child.
+ * {@inheritDoc}
*/
- private TableBodyContainer getBodyArea() {
+ public TableBodyContainer getTableBodyContainer() {
if (this.children == null) {
return null;
}
@@ -640,10 +606,9 @@
}
/**
- * Returns the child header area, if any.
- * @return The child header area, or null if there is no header child.
+ * {@inheritDoc}
*/
- private TableHeaderContainer getHeaderArea() {
+ public TableHeaderContainer getTableHeaderContainer() {
if (this.children == null) {
return null;
}
@@ -658,10 +623,9 @@
}
/**
- * Returns the child footer area, if any.
- * @return The child footer area, or null if there is no footer child.
+ * {@inheritDoc}
*/
- private TableFooterContainer getFooterArea() {
+ public TableFooterContainer getTableFooterContainer() {
if (this.children == null) {
return null;
}
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TablePL.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TablePL.java 2007-04-05 17:09:15 UTC (rev 9112)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TablePL.java 2007-04-05 19:32:37 UTC (rev 9113)
@@ -33,6 +33,8 @@
import org.axsl.areaW.BlockContentFactory;
import org.axsl.areaW.NormalBlockArea;
import org.axsl.areaW.TableArea;
+import org.axsl.areaW.TableFooterContainer;
+import org.axsl.areaW.TableHeaderContainer;
import org.axsl.common.FoValue;
import org.axsl.foR.FONode;
import org.axsl.foR.fo.Marker;
@@ -178,7 +180,9 @@
+ "moving last body row to next page");
final TableFooterPL tableFooterPL
= (TableFooterPL) this.getLayoutProxy(tf);
- tableArea.removeTableFooterContainer();
+ final TableFooterContainer footerArea =
+ tableArea.getTableFooterContainer();
+ tableArea.removeChild(footerArea);
tableFooterPL.resetProgress();
return Status.AREA_FULL_SOME;
}
@@ -264,14 +268,18 @@
if (header != null) {
final TableHeaderPL tableHeaderPL = (TableHeaderPL)
this.getLayoutProxy(header);
- tableArea.removeTableHeaderContainer();
+ final TableHeaderContainer headerContainer =
+ tableArea.getTableHeaderContainer();
+ tableArea.removeChild(headerContainer);
tableHeaderPL.resetProgress();
}
final TableFooter footer = table.getTableFooter();
if (footer != null) {
final TableFooterPL tableFooterPL = (TableFooterPL)
this.getLayoutProxy(footer);
- tableArea.removeTableFooterContainer();
+ final TableFooterContainer footerContainer =
+ tableArea.getTableFooterContainer();
+ tableArea.removeChild(footerContainer);
tableFooterPL.resetProgress();
}
resetProgress();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-04-05 23:30:59
|
Revision: 9120
http://svn.sourceforge.net/foray/?rev=9120&view=rev
Author: victormote
Date: 2007-04-05 16:30:56 -0700 (Thu, 05 Apr 2007)
Log Message:
-----------
Conform to axsl change converting PDF Version to a typesafe enum.
Modified Paths:
--------------
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFDocument.java
trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFDocument.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFDocument.java 2007-04-05 22:25:34 UTC (rev 9119)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFDocument.java 2007-04-05 23:30:56 UTC (rev 9120)
@@ -41,8 +41,8 @@
import org.axsl.fontR.Font;
import org.axsl.fontR.FontUse;
import org.axsl.pdfW.PDFColor;
-import org.axsl.pdfW.PDFException;
import org.axsl.pdfW.PDFPage;
+import org.axsl.pdfW.PDFVersion;
import org.axsl.psR.Encoding;
import org.apache.commons.logging.Log;
@@ -94,7 +94,7 @@
/** The version of PDF that this document should create when it is
* written. */
- private int pdfVersion = PDF_VERSION_1_6;
+ private PDFVersion pdfVersion = PDFVersion.VERSION_1_6;
/** The current character position. */
private int position = 0;
@@ -227,12 +227,11 @@
* {@inheritDoc}
* If not set, the default value is PDF_VERSION_1_6.
*/
- public void setVersion(final int newVersion) throws PDFException {
- if (newVersion >= 0 && newVersion < VALID_VERSIONS.length) {
- this.pdfVersion = newVersion;
- return;
+ public void setVersion(final PDFVersion newVersion) {
+ if (newVersion == null) {
+ throw new IllegalArgumentException("Cannot set a null PDF Version");
}
- throw new PDFException("Unsupported PDF Version: " + newVersion);
+ this.pdfVersion = newVersion;
}
/**
@@ -333,7 +332,8 @@
this.position = 0;
final StringBuilder buffer = new StringBuilder();
// The PDF identifier comment.
- buffer.append("%PDF-" + VERSION_STRINGS[pdfVersion] + PDFObject.EOL);
+ buffer.append("%PDF-" + this.pdfVersion.getVersionString()
+ + PDFObject.EOL);
buffer.append("%" + BINARY_COMMENT + PDFObject.EOL);
final byte[] bytes = PDFObject.bufferToByteArray(buffer);
stream.write(bytes);
Modified: trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2007-04-05 22:25:34 UTC (rev 9119)
+++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2007-04-05 23:30:56 UTC (rev 9120)
@@ -60,14 +60,13 @@
import org.axsl.pdfW.PDFContentStream;
import org.axsl.pdfW.PDFDocument;
import org.axsl.pdfW.PDFEncryption;
-import org.axsl.pdfW.PDFException;
import org.axsl.pdfW.PDFExplicitDestination;
import org.axsl.pdfW.PDFFont;
import org.axsl.pdfW.PDFOutlineItem;
import org.axsl.pdfW.PDFOutlineParent;
import org.axsl.pdfW.PDFPage;
import org.axsl.pdfW.PDFPathPaint;
-import org.axsl.pdfW.PDFUtility;
+import org.axsl.pdfW.PDFVersion;
import org.apache.commons.logging.Log;
@@ -154,14 +153,9 @@
public void startOutput() throws IOException {
final String pdfVersion = this.getOptions().optionPDFVersion();
if (pdfVersion != null) {
- final int pdfVersionConstant = PDFUtility.integralVersion(
+ final PDFVersion pdfVersionConstant = PDFVersion.fromString(
pdfVersion);
- try {
- this.pdfDoc.setVersion(pdfVersionConstant);
- } catch (final PDFException e) {
- // Log the error and go on. The default will be used.
- getLogger().error("Unsupported PDF Version: " + pdfVersion);
- }
+ this.pdfDoc.setVersion(pdfVersionConstant);
}
this.pdfDoc.setProducer(getApplicationNameShort() + " "
+ getApplicationVersion());
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-04-06 00:51:25
|
Revision: 9121
http://svn.sourceforge.net/foray/?rev=9121&view=rev
Author: victormote
Date: 2007-04-05 17:51:26 -0700 (Thu, 05 Apr 2007)
Log Message:
-----------
Encapsulate the output stream in the PDF Document as it is created.
Modified Paths:
--------------
trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java
trunk/foray/foray-app/src/java/org/foray/app/OutputTargetFactory.java
trunk/foray/foray-app/src/java/org/foray/app/ant/FOrayAntTaskStarter.java
trunk/foray/foray-app/src/java/org/foray/app/test/TestConverter.java
trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoFO2PDF.java
trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoObj2PDF.java
trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoXML2PDF.java
trunk/foray/foray-app/src/java/org/foray/demo/servlet/AbstractDemoServlet.java
trunk/foray/foray-app/src/java/org/foray/demo/servlet/DemoServlet.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFDocument.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFDocumentGraphics2D.java
Modified: trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java
===================================================================
--- trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java 2007-04-05 23:30:56 UTC (rev 9120)
+++ trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java 2007-04-06 00:51:26 UTC (rev 9121)
@@ -112,8 +112,10 @@
*/
final int outputType = commandLineOptions.getOutputType();
final OutputConfig outputOptions = this.getOutputConfig();
+ final FileOutputStream outputStream = getFileOutputStream();
final OutputTarget outputTarget = OutputTargetFactory.makeOutputTarget(
- outputType, outputOptions, session.getLogger());
+ outputType, outputOptions, outputStream,
+ session.getLogger());
/*
* Instantiate and configure the FOrayTarget(s). Multiple targets can
@@ -125,9 +127,8 @@
* to null.
*/
final LayoutStrategy layout = new PioneerLS(session.getLogger());
- final FileOutputStream outputFileStream = getFileOutputStream();
final FOrayTarget target = new FOrayTarget(document, outputTarget,
- layout, outputFileStream);
+ layout, outputStream);
/*
* Everything is now ready to go. There are two different processing
Modified: trunk/foray/foray-app/src/java/org/foray/app/OutputTargetFactory.java
===================================================================
--- trunk/foray/foray-app/src/java/org/foray/app/OutputTargetFactory.java 2007-04-05 23:30:56 UTC (rev 9120)
+++ trunk/foray/foray-app/src/java/org/foray/app/OutputTargetFactory.java 2007-04-06 00:51:26 UTC (rev 9121)
@@ -44,6 +44,8 @@
import org.apache.commons.logging.Log;
+import java.io.OutputStream;
+
/**
* This class manages the process of parsing an input FO document and creating
* an FOTree.
@@ -100,13 +102,15 @@
* </ul>
* @param outputOptions Map containing the options to be used with the
* Renderer.
+ * @param outputStream The output stream to which the target will be
+ * written.
* @param logger The logger.
* @return The newly-created OutputTarget instance.
* @throws FOrayException For errors creating the target.
*/
public static OutputTarget makeOutputTarget(final int rendererType,
- final OutputConfig outputOptions, final Log logger)
- throws FOrayException {
+ final OutputConfig outputOptions, final OutputStream outputStream,
+ final Log logger) throws FOrayException {
OutputTarget renderer = null;
switch (rendererType) {
case RENDER_AWT: {
@@ -143,7 +147,7 @@
}
default: {
final PDFDocument document = new org.foray.pdf.object.PDFDocument(
- logger);
+ outputStream, logger);
renderer = new PDFRenderer(logger, outputOptions, document);
break;
}
Modified: trunk/foray/foray-app/src/java/org/foray/app/ant/FOrayAntTaskStarter.java
===================================================================
--- trunk/foray/foray-app/src/java/org/foray/app/ant/FOrayAntTaskStarter.java 2007-04-05 23:30:56 UTC (rev 9120)
+++ trunk/foray/foray-app/src/java/org/foray/app/ant/FOrayAntTaskStarter.java 2007-04-06 00:51:26 UTC (rev 9121)
@@ -311,7 +311,7 @@
}
final OutputTarget outputTarget =
OutputTargetFactory.makeOutputTarget(
- this.task.getRendererType(), this.outputConfig,
+ this.task.getRendererType(), this.outputConfig, out,
session.getLogger());
new FOrayTarget(document, outputTarget, null, out);
Modified: trunk/foray/foray-app/src/java/org/foray/app/test/TestConverter.java
===================================================================
--- trunk/foray/foray-app/src/java/org/foray/app/test/TestConverter.java 2007-04-05 23:30:56 UTC (rev 9120)
+++ trunk/foray/foray-app/src/java/org/foray/app/test/TestConverter.java 2007-04-06 00:51:26 UTC (rev 9121)
@@ -340,7 +340,7 @@
renderOptions.parseOption("consistentOutput", "true",
SessionConfig.PRECEDENCE_DEFAULT);
final OutputTarget renderer = OutputTargetFactory.makeOutputTarget(
- rendererType, renderOptions, session.getLogger());
+ rendererType, renderOptions, bos, session.getLogger());
new FOrayTarget(document, renderer, null, bos);
Modified: trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoFO2PDF.java
===================================================================
--- trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoFO2PDF.java 2007-04-05 23:30:56 UTC (rev 9120)
+++ trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoFO2PDF.java 2007-04-06 00:51:26 UTC (rev 9121)
@@ -70,11 +70,11 @@
null);
//Setup Renderer
+ final OutputStream out = new FileOutputStream(pdf);
final OutputTarget renderer = OutputTargetFactory.makeOutputTarget(
- OutputTargetFactory.RENDER_PDF, null, session.getLogger());
+ OutputTargetFactory.RENDER_PDF, null, out, session.getLogger());
//Setup FOrayTarget
- final OutputStream out = new FileOutputStream(pdf);
new FOrayTarget(document, renderer, null, out);
// Start the processing.
Modified: trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoObj2PDF.java
===================================================================
--- trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoObj2PDF.java 2007-04-05 23:30:56 UTC (rev 9120)
+++ trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoObj2PDF.java 2007-04-06 00:51:26 UTC (rev 9121)
@@ -87,11 +87,11 @@
source);
//Setup Renderer
+ final OutputStream out = new FileOutputStream(pdf);
final OutputTarget renderer = OutputTargetFactory.makeOutputTarget(
- OutputTargetFactory.RENDER_PDF, null, session.getLogger());
+ OutputTargetFactory.RENDER_PDF, null, out, session.getLogger());
//Setup FOrayTarget
- final OutputStream out = new FileOutputStream(pdf);
new FOrayTarget(document, renderer, null, out);
// Start the processing.
Modified: trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoXML2PDF.java
===================================================================
--- trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoXML2PDF.java 2007-04-05 23:30:56 UTC (rev 9120)
+++ trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoXML2PDF.java 2007-04-06 00:51:26 UTC (rev 9121)
@@ -87,11 +87,11 @@
source);
//Setup Renderer
+ final OutputStream out = new FileOutputStream(pdf);
final OutputTarget renderer = OutputTargetFactory.makeOutputTarget(
- OutputTargetFactory.RENDER_PDF, null, session.getLogger());
+ OutputTargetFactory.RENDER_PDF, null, out, session.getLogger());
//Setup FOrayTarget
- final OutputStream out = new FileOutputStream(pdf);
new FOrayTarget(document, renderer, null, out);
// Start the processing.
Modified: trunk/foray/foray-app/src/java/org/foray/demo/servlet/AbstractDemoServlet.java
===================================================================
--- trunk/foray/foray-app/src/java/org/foray/demo/servlet/AbstractDemoServlet.java 2007-04-05 23:30:56 UTC (rev 9120)
+++ trunk/foray/foray-app/src/java/org/foray/demo/servlet/AbstractDemoServlet.java 2007-04-06 00:51:26 UTC (rev 9121)
@@ -190,11 +190,12 @@
inputHandler);
// Setup the Renderer
+ final ByteArrayOutputStream output = new ByteArrayOutputStream();
final OutputTarget renderer = OutputTargetFactory.makeOutputTarget(
- OutputTargetFactory.RENDER_PDF, null, session.getLogger());
+ OutputTargetFactory.RENDER_PDF, null, output,
+ session.getLogger());
// Setup FOrayTarget
- final ByteArrayOutputStream output = new ByteArrayOutputStream();
new FOrayTarget(document, renderer, null, output);
// Run the FOraySession
@@ -235,11 +236,12 @@
transformer, source);
// Setup the Renderer
+ final ByteArrayOutputStream output = new ByteArrayOutputStream();
final OutputTarget renderer = OutputTargetFactory.makeOutputTarget(
- OutputTargetFactory.RENDER_PDF, null, session.getLogger());
+ OutputTargetFactory.RENDER_PDF, null, output,
+ session.getLogger());
// Setup FOrayTarget
- final ByteArrayOutputStream output = new ByteArrayOutputStream();
new FOrayTarget(document, renderer, null, output);
// Run the FOraySession
Modified: trunk/foray/foray-app/src/java/org/foray/demo/servlet/DemoServlet.java
===================================================================
--- trunk/foray/foray-app/src/java/org/foray/demo/servlet/DemoServlet.java 2007-04-05 23:30:56 UTC (rev 9120)
+++ trunk/foray/foray-app/src/java/org/foray/demo/servlet/DemoServlet.java 2007-04-06 00:51:26 UTC (rev 9121)
@@ -135,10 +135,12 @@
private FOrayTarget setupTarget(final FOrayDocument document)
throws FOrayException {
// Setup the Renderer
+ final ByteArrayOutputStream output = new ByteArrayOutputStream();
final OutputTarget renderer = OutputTargetFactory.makeOutputTarget(
- OutputTargetFactory.RENDER_PDF, null, document.getLogger());
+ OutputTargetFactory.RENDER_PDF, null, output,
+ document.getLogger());
+
// Setup FOrayTarget
- final ByteArrayOutputStream output = new ByteArrayOutputStream();
final FOrayTarget target = new FOrayTarget(document, renderer, null,
output);
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFDocument.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFDocument.java 2007-04-05 23:30:56 UTC (rev 9120)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFDocument.java 2007-04-06 00:51:26 UTC (rev 9121)
@@ -192,6 +192,9 @@
/** List of PDFColor instances that have been used by this document. */
private List<PDFColor> usedColors = new ArrayList<PDFColor>();
+ /** The output stream to which this document should be written. */
+ private OutputStream outputStream;
+
/**
* Constructor which creates an empty PDF document.
* The constructor creates a /Root and /Pages object to track the document
@@ -199,9 +202,12 @@
* Note that the object ID of the pages object is determined now, and the
* xref table is updated later.
* This allows Pages to refer to their Parent before we write it out.
+ * @param outputStream The output stream to which this document should be
+ * written.
* @param logger The logger to which user messages should be written.
*/
- public PDFDocument(final Log logger) {
+ public PDFDocument(final OutputStream outputStream, final Log logger) {
+ this.outputStream = outputStream;
this.logger = logger;
// Create the Root object
@@ -302,7 +308,7 @@
* Output the object and increment the character position
* by the object's length
*/
- this.position += object.output(stream);
+ this.position += object.output(this.outputStream);
this.indirectObjects.remove(0);
}
}
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFDocumentGraphics2D.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFDocumentGraphics2D.java 2007-04-05 23:30:56 UTC (rev 9120)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFDocumentGraphics2D.java 2007-04-06 00:51:26 UTC (rev 9121)
@@ -86,7 +86,7 @@
super(textAsShapes);
this.stream = stream;
- setPdfDoc(new PDFDocument(getLogger()));
+ setPdfDoc(new PDFDocument(stream, getLogger()));
getPdfDoc().getInfo().setProducer(appName + " SVG Renderer");
this.width = width;
this.height = height;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-04-06 01:06:10
|
Revision: 9122
http://svn.sourceforge.net/foray/?rev=9122&view=rev
Author: victormote
Date: 2007-04-05 18:06:12 -0700 (Thu, 05 Apr 2007)
Log Message:
-----------
Conform to axsl changes removing OutputStream parameters from PDFDocument methods.
Modified Paths:
--------------
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFDocument.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFDocumentGraphics2D.java
trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFDocument.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFDocument.java 2007-04-06 00:51:26 UTC (rev 9121)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFDocument.java 2007-04-06 01:06:12 UTC (rev 9122)
@@ -287,13 +287,9 @@
}
/**
- * Writes any used but unwritten indirect objects into the stream.
- * This can be done as often as desired.
- * @param stream The OutputStream to which the output should be written.
- * @throws IOException For I/O errors while writing to the output stream.
+ * {@inheritDoc}
*/
- public void writeIndirectObjects(final OutputStream stream)
- throws IOException {
+ public void writeIndirectObjects() throws IOException {
/*
* Use a "while" loop here, because as each object is written, it has
* potential to reference another object indirectly, which will add an
@@ -334,7 +330,7 @@
/**
* {@inheritDoc}
*/
- public void outputHeader(final OutputStream stream) throws IOException {
+ public void writeHeader() throws IOException {
this.position = 0;
final StringBuilder buffer = new StringBuilder();
// The PDF identifier comment.
@@ -342,30 +338,29 @@
+ PDFObject.EOL);
buffer.append("%" + BINARY_COMMENT + PDFObject.EOL);
final byte[] bytes = PDFObject.bufferToByteArray(buffer);
- stream.write(bytes);
+ this.outputStream.write(bytes);
this.position += bytes.length;
}
/**
* {@inheritDoc}
*/
- public void close(final OutputStream stream) throws IOException {
- outputTrailer(stream);
+ public void close() throws IOException {
+ outputTrailer();
}
/**
* Write the document trailer.
- * @param stream The OutputStream to which the trailer should be written.
* @throws IOException For errors while writing to the output stream.
*/
- private void outputTrailer(final OutputStream stream) throws IOException {
- writeIndirectObjects(stream);
+ private void outputTrailer() throws IOException {
+ writeIndirectObjects();
for (int i = 0; i < indirectObjectsLast.size(); i++) {
final PDFObject o = indirectObjectsLast.get(i);
recordLocation(o);
- this.position += o.output(stream);
+ this.position += o.output(this.outputStream);
}
- writeIndirectObjects(stream);
+ writeIndirectObjects();
/* remember position of xref table */
final int xrefPosition = this.position;
@@ -373,7 +368,7 @@
/* output the xref table and increment the character position
by the table's length */
- this.position += outputXref(stream);
+ this.position += outputXref(this.outputStream);
/* construct the trailer */
final StringBuilder buffer = new StringBuilder();
@@ -389,7 +384,7 @@
} catch (final UnsupportedEncodingException ue) {
trailer = buffer.toString().getBytes();
}
- stream.write(trailer);
+ this.outputStream.write(trailer);
}
/**
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFDocumentGraphics2D.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFDocumentGraphics2D.java 2007-04-06 00:51:26 UTC (rev 9121)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFDocumentGraphics2D.java 2007-04-06 01:06:12 UTC (rev 9122)
@@ -57,9 +57,6 @@
*/
public class PDFDocumentGraphics2D extends PDFGraphics2D {
- /** The output stream to which the graphic is written. */
- private OutputStream stream;
-
/** The height of the graphic, in millipoints. */
private int width;
@@ -85,7 +82,6 @@
final String appName, final FontConsumer fontConsumer) {
super(textAsShapes);
- this.stream = stream;
setPdfDoc(new PDFDocument(stream, getLogger()));
getPdfDoc().getInfo().setProducer(appName + " SVG Renderer");
this.width = width;
@@ -150,9 +146,9 @@
if (getCurrentAnnotList() != null) {
currentPage.addAnnotationList(getCurrentAnnotList());
}
- getPdfDoc().outputHeader(stream);
- getPdfDoc().writeIndirectObjects(stream);
- getPdfDoc().close(stream);
+ getPdfDoc().writeHeader();
+ getPdfDoc().writeIndirectObjects();
+ getPdfDoc().close();
}
/**
Modified: trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2007-04-06 00:51:26 UTC (rev 9121)
+++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2007-04-06 01:06:12 UTC (rev 9122)
@@ -168,7 +168,7 @@
final String filter = (String) filters.get(i);
pdfDoc.addDefaultFilter(filter);
}
- pdfDoc.outputHeader(this.getOutputStream());
+ pdfDoc.writeHeader();
}
/**
@@ -180,7 +180,7 @@
* PageCollection.
*/
renderDocumentNodes();
- pdfDoc.close(this.getOutputStream());
+ pdfDoc.close();
// this frees up memory and makes the renderer reusable
this.pdfDoc = null;
@@ -420,7 +420,7 @@
renderDestinations(page);
getLogger().debug("Writing out PDF.");
- this.pdfDoc.writeIndirectObjects(this.getOutputStream());
+ this.pdfDoc.writeIndirectObjects();
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-04-06 16:31:26
|
Revision: 9125
http://svn.sourceforge.net/foray/?rev=9125&view=rev
Author: victormote
Date: 2007-04-06 09:31:25 -0700 (Fri, 06 Apr 2007)
Log Message:
-----------
Conform to new axsl method for setting the line cap style in PDF, and use that method to clean up table borders.
Modified Paths:
--------------
trunk/foray/foray-pdf/src/java/org/foray/pdf/PDFGraphicsState.java
trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFContentStream.java
trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/PDFGraphicsState.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/PDFGraphicsState.java 2007-04-06 01:41:37 UTC (rev 9124)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/PDFGraphicsState.java 2007-04-06 16:31:25 UTC (rev 9125)
@@ -30,6 +30,7 @@
import org.axsl.pdfW.PDFColor;
import org.axsl.pdfW.PDFFont;
+import org.axsl.pdfW.PDFLineCapStyle;
import java.awt.Color;
@@ -66,6 +67,9 @@
/** The dash phase. */
private float dashPhase;
+ /** The line cap style. */
+ private PDFLineCapStyle lineCapStyle;
+
/**
* Create a PDFGraphicsState instance.
*/
@@ -87,6 +91,7 @@
this.fontSize = -1;
this.dashArray = null;
this.dashPhase = 0;
+ this.lineCapStyle = PDFLineCapStyle.BUTT_CAP;
}
/**
@@ -253,4 +258,18 @@
return anyChange;
}
+ /**
+ * Sets the line cap style. See PDF Reference, 3rd Edition, Section 4.3.
+ * @param newLineCapStyle The new line cap style.
+ * @return True if the Graphics State was changed by this operation.
+ */
+ public boolean setLineCapStyle(final PDFLineCapStyle newLineCapStyle) {
+ boolean anyChange = false;
+ if (newLineCapStyle != this.lineCapStyle) {
+ this.lineCapStyle = newLineCapStyle;
+ anyChange = true;
+ }
+ return anyChange;
+ }
+
}
Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFContentStream.java
===================================================================
--- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFContentStream.java 2007-04-06 01:41:37 UTC (rev 9124)
+++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFContentStream.java 2007-04-06 16:31:25 UTC (rev 9125)
@@ -41,6 +41,7 @@
import org.axsl.graphicR.SVGGraphic;
import org.axsl.pdfW.PDFColor;
import org.axsl.pdfW.PDFFont;
+import org.axsl.pdfW.PDFLineCapStyle;
import org.axsl.pdfW.PDFPathPaint;
import org.apache.batik.bridge.BridgeContext;
@@ -215,6 +216,17 @@
/**
* {@inheritDoc}
*/
+ public void setLineCapStyle(final PDFLineCapStyle newLineCapStyle) {
+ if (! this.getGS().setLineCapStyle(newLineCapStyle)) {
+ // Nothing needs to change.
+ return;
+ }
+ add(newLineCapStyle.getPDFValue() + " J" + EOL);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
public void drawLine(final Line2D.Float line, final float thickness,
final float[] dashArray, final float dashPhase,
final PDFPathPaint stroke) {
Modified: trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2007-04-06 01:41:37 UTC (rev 9124)
+++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2007-04-06 16:31:25 UTC (rev 9125)
@@ -62,6 +62,7 @@
import org.axsl.pdfW.PDFEncryption;
import org.axsl.pdfW.PDFExplicitDestination;
import org.axsl.pdfW.PDFFont;
+import org.axsl.pdfW.PDFLineCapStyle;
import org.axsl.pdfW.PDFOutlineItem;
import org.axsl.pdfW.PDFOutlineParent;
import org.axsl.pdfW.PDFPage;
@@ -195,7 +196,7 @@
final Color strokeColor) {
final PDFColor pdfColor = this.getPDFDocument().createPDFColor(
strokeColor);
- float[] dashPattern = null;
+ float[] dashPattern;
switch (ruleStyle) {
case DASHED:
dashPattern = DASHPATTERN_DASHED;
@@ -204,10 +205,12 @@
dashPattern = DASHPATTERN_DOTTED;
break;
default:
- // The null dash pattern is the default.
+ dashPattern = null;
}
final Line2D.Float line = new Line2D.Float(toPoints(startX),
toPoints(startY), toPoints(endX), toPoints(endY));
+ getContentStream().setLineCapStyle(
+ PDFLineCapStyle.PROJECTING_SQUARE_CAP);
getContentStream().drawLine(line, toPoints(thickness), dashPattern, 0,
pdfColor);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-04-06 19:34:05
|
Revision: 9126
http://svn.sourceforge.net/foray/?rev=9126&view=rev
Author: victormote
Date: 2007-04-06 12:34:01 -0700 (Fri, 06 Apr 2007)
Log Message:
-----------
Conform to axsl changes adding an enum for the Table border model.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/Area.java
trunk/foray/foray-areatree/src/java/org/foray/area/TableCellRA.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Enumerated.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/Area.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2007-04-06 16:31:25 UTC (rev 9125)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2007-04-06 19:34:01 UTC (rev 9126)
@@ -35,6 +35,7 @@
import org.axsl.common.AbsoluteAxis;
import org.axsl.common.AbsoluteDirection;
import org.axsl.common.Baseline;
+import org.axsl.common.BorderModel;
import org.axsl.common.FoValue;
import org.axsl.common.LinkType;
import org.axsl.common.RelativeAxis;
@@ -1643,7 +1644,7 @@
* Returns the border-collapse trait for this Area.
* @return The border-collapse trait for this Area.
*/
- public FoValue traitBorderCollapse() {
+ public BorderModel traitBorderCollapse() {
return traitGeneratedBy().traitBorderCollapse(this);
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TableCellRA.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/TableCellRA.java 2007-04-06 16:31:25 UTC (rev 9125)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/TableCellRA.java 2007-04-06 19:34:01 UTC (rev 9126)
@@ -31,6 +31,7 @@
import org.axsl.areaR.RenderVisitor;
import org.axsl.areaR.TableCellArea;
import org.axsl.areaW.AreaWException;
+import org.axsl.common.BorderModel;
import org.axsl.common.FoValue;
import org.axsl.common.RelativeAxis;
import org.axsl.foR.fo.Block;
@@ -235,7 +236,7 @@
*/
public int getStartAdjust() {
final TableCell tableCell = traitGeneratedBy();
- if (tableCell.traitBorderCollapse(this) == FoValue.SEPARATE) {
+ if (tableCell.traitBorderCollapse(this) == BorderModel.SEPARATE) {
final int iSep = tableCell.traitBorderSeparationIPD(this);
return iSep / 2 + tableCell.traitBorderLeftWidth(this)
+ tableCell.traitPaddingLeft(this);
@@ -272,7 +273,7 @@
/* See XSL-FO 1.1, Section 6.7.10, Subsection "Constraints" where the
* table-cell content-rectangle is defined. */
int crIPD = this.getProgressionDimension();
- if (this.traitBorderCollapse() == FoValue.SEPARATE) {
+ if (this.traitBorderCollapse() == BorderModel.SEPARATE) {
crIPD -= this.traitBorderSeparationIPD() / 2;
crIPD -= this.traitBorderStartWidth();
crIPD -= this.traitBorderEndWidth();
@@ -319,7 +320,7 @@
* We are adjusting here for those factors on the start-edge only. */
final TableRA tableRA = this.ancestorTableArea();
int originX = tableRA.getResolvedGridOriginX(this.traitColumnNumber());
- if (this.traitBorderCollapse() == FoValue.SEPARATE) {
+ if (this.traitBorderCollapse() == BorderModel.SEPARATE) {
originX += this.traitBorderSeparationIPD() / 2;
originX += this.traitBorderStartWidth();
} else {
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-04-06 16:31:25 UTC (rev 9125)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-04-06 19:34:01 UTC (rev 9126)
@@ -36,6 +36,7 @@
import org.axsl.common.AbsoluteAxis;
import org.axsl.common.AbsoluteDirection;
import org.axsl.common.Baseline;
+import org.axsl.common.BorderModel;
import org.axsl.common.Compass;
import org.axsl.common.FoValue;
import org.axsl.common.RelativeAxis;
@@ -718,8 +719,18 @@
/**
* {@inheritDoc}
*/
- public FoValue traitBorderCollapse(final FOContext context) {
- return propertyList.getBorderCollapse(context);
+ public BorderModel traitBorderCollapse(final FOContext context) {
+ switch (propertyList.getBorderCollapse(context)) {
+ case COLLAPSE_WITH_PRECEDENCE: {
+ return BorderModel.COLLAPSE_WITH_PRECEDENCE;
+ }
+ case SEPARATE: {
+ return BorderModel.SEPARATE;
+ }
+ default: {
+ return BorderModel.COLLAPSE;
+ }
+ }
}
/**
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Enumerated.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Enumerated.java 2007-04-06 16:31:25 UTC (rev 9125)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Enumerated.java 2007-04-06 19:34:01 UTC (rev 9126)
@@ -101,7 +101,7 @@
switch (propertyType) {
case BORDER_COLLAPSE: {
if (parent != null) {
- return parent.traitBorderCollapse(context);
+ return parent.getPropertyList().getBorderCollapse(context);
}
return FoValue.COLLAPSE;
}
@@ -364,7 +364,7 @@
return fobj.traitBlankOrNotBlank();
}
case BORDER_COLLAPSE: {
- return fobj.traitBorderCollapse(context);
+ return fobj.getPropertyList().getBorderCollapse(context);
}
case BREAK_AFTER: {
return fobj.traitBreakAfter(context);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-04-07 00:09:31
|
Revision: 9128
http://svn.sourceforge.net/foray/?rev=9128&view=rev
Author: victormote
Date: 2007-04-06 17:09:29 -0700 (Fri, 06 Apr 2007)
Log Message:
-----------
Conform to use of new axsl enums for BorderStyle and RuleStyle.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/Area.java
trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderStyle.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Enumerated.java
trunk/foray/foray-render/src/java/org/foray/render/PrintRenderer.java
trunk/foray/foray-render/src/java/org/foray/render/Renderer.java
trunk/foray/foray-render/src/java/org/foray/render/awt/AWTRenderer.java
trunk/foray/foray-render/src/java/org/foray/render/pcl/PCLRenderer.java
trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java
trunk/foray/foray-render/src/java/org/foray/render/ps/PSRenderer.java
trunk/foray/foray-render/src/java/org/foray/render/svg/SVGRenderer.java
trunk/foray/foray-render/src/java/org/foray/render/txt/TXTRenderer.java
trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/Area.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2007-04-06 19:38:01 UTC (rev 9127)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2007-04-07 00:09:29 UTC (rev 9128)
@@ -35,6 +35,7 @@
import org.axsl.common.AbsoluteAxis;
import org.axsl.common.AbsoluteDirection;
import org.axsl.common.Baseline;
+import org.axsl.common.BorderStyle;
import org.axsl.common.FoValue;
import org.axsl.common.LinkType;
import org.axsl.common.RelativeAxis;
@@ -1643,7 +1644,7 @@
* Returns the border style for the "start" edge of this Area.
* @return The border style for the "start" edge of this Area.
*/
- public FoValue traitBorderStartStyle() {
+ public BorderStyle traitBorderStartStyle() {
return traitGeneratedBy().traitBorderStartStyle(this);
}
@@ -1651,7 +1652,7 @@
* Returns the border style for the "end" edge of this Area.
* @return The border style for the "end" edge of this Area.
*/
- public FoValue traitBorderEndStyle() {
+ public BorderStyle traitBorderEndStyle() {
return traitGeneratedBy().traitBorderEndStyle(this);
}
@@ -1659,7 +1660,7 @@
* Returns the border style for the "before" edge of this Area.
* @return The border style for the "before" edge of this Area.
*/
- public FoValue traitBorderBeforeStyle() {
+ public BorderStyle traitBorderBeforeStyle() {
return traitGeneratedBy().traitBorderBeforeStyle(this);
}
@@ -1667,7 +1668,7 @@
* Returns the border style for the "after" edge of this Area.
* @return The border style for the "after" edge of this Area.
*/
- public FoValue traitBorderAfterStyle() {
+ public BorderStyle traitBorderAfterStyle() {
return traitGeneratedBy().traitBorderAfterStyle(this);
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java 2007-04-06 19:38:01 UTC (rev 9127)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java 2007-04-07 00:09:29 UTC (rev 9128)
@@ -30,6 +30,7 @@
import org.axsl.areaR.RenderVisitor;
import org.axsl.common.FoValue;
+import org.axsl.common.RuleStyle;
import org.axsl.foR.FOText;
import org.axsl.foR.FObj;
import org.axsl.foR.fo.ExternalGraphic;
@@ -206,7 +207,7 @@
/**
* {@inheritDoc}
*/
- public FoValue traitRuleStyle() {
+ public RuleStyle traitRuleStyle() {
return traitGeneratedBy().traitRuleStyle(this);
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-04-06 19:38:01 UTC (rev 9127)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-04-07 00:09:29 UTC (rev 9128)
@@ -37,9 +37,11 @@
import org.axsl.common.AbsoluteDirection;
import org.axsl.common.Baseline;
import org.axsl.common.BorderModel;
+import org.axsl.common.BorderStyle;
import org.axsl.common.Compass;
import org.axsl.common.FoValue;
import org.axsl.common.RelativeAxis;
+import org.axsl.common.RuleStyle;
import org.axsl.foR.FOContext;
import org.axsl.foR.FOTreeException;
import org.axsl.foR.ShadowEffect;
@@ -1290,17 +1292,38 @@
* {@inheritDoc}
*/
public int traitRuleThickness(final FOContext context) {
- if (traitRuleStyle(context) == FoValue.NONE) {
+ if (traitRuleStyle(context) == RuleStyle.NONE) {
return 0;
}
return propertyList.getRuleThickness(context);
}
/**
+ * Converts an {@link FoValue} rule-style value to the more generic
+ * {@link RuleStyle} value.
+ * @param foRuleStyle The raw FO rule style to be converted.
+ * @return The matching RuleStyle instance.
+ */
+ private static RuleStyle convertRuleStyle(final FoValue foRuleStyle) {
+ switch (foRuleStyle) {
+ case NONE: return RuleStyle.NONE;
+ case DOTTED: return RuleStyle.DOTTED;
+ case DASHED: return RuleStyle.DASHED;
+ case SOLID: return RuleStyle.SOLID;
+ case DOUBLE: return RuleStyle.DOUBLE;
+ case GROOVE: return RuleStyle.GROOVE;
+ case RIDGE: return RuleStyle.RIDGE;
+ default: throw new IllegalArgumentException("Illegal rule style: "
+ + foRuleStyle.toXslFo());
+ }
+ }
+
+ /**
* {@inheritDoc}
*/
- public FoValue traitRuleStyle(final FOContext context) {
- return propertyList.getRuleStyle(context);
+ public RuleStyle traitRuleStyle(final FOContext context) {
+ final FoValue foRuleStyle = propertyList.getRuleStyle(context);
+ return convertRuleStyle(foRuleStyle);
}
/**
@@ -1511,59 +1534,98 @@
}
/**
+ * Converts an {@link FoValue} border-style value to the more generic
+ * {@link BorderStyle} value.
+ * @param foBorderStyle The raw FO border style to be converted.
+ * @return The matching BorderStyle instance.
+ */
+ private static BorderStyle convertBorderStyle(final FoValue foBorderStyle) {
+ switch (foBorderStyle) {
+ case NONE: return BorderStyle.NONE;
+ case HIDDEN: return BorderStyle.HIDDEN;
+ case DOTTED: return BorderStyle.DOTTED;
+ case DASHED: return BorderStyle.DASHED;
+ case SOLID: return BorderStyle.SOLID;
+ case DOUBLE: return BorderStyle.DOUBLE;
+ case GROOVE: return BorderStyle.GROOVE;
+ case RIDGE: return BorderStyle.RIDGE;
+ case INSET: return BorderStyle.INSET;
+ case OUTSET: return BorderStyle.OUTSET;
+ default: throw new IllegalArgumentException("Illegal border style: "
+ + foBorderStyle.toXslFo());
+ }
+ }
+
+ /**
* {@inheritDoc}
*/
- public FoValue traitBorderBeforeStyle(final FOContext context) {
- return propertyList.getBorderStyle(context, Compass.BEFORE);
+ public BorderStyle traitBorderBeforeStyle(final FOContext context) {
+ final FoValue foValue = propertyList.getBorderStyle(context,
+ Compass.BEFORE);
+ return convertBorderStyle(foValue);
}
/**
* {@inheritDoc}
*/
- public FoValue traitBorderAfterStyle(final FOContext context) {
- return propertyList.getBorderStyle(context, Compass.AFTER);
+ public BorderStyle traitBorderAfterStyle(final FOContext context) {
+ final FoValue foValue = propertyList.getBorderStyle(context,
+ Compass.AFTER);
+ return convertBorderStyle(foValue);
}
/**
* {@inheritDoc}
*/
- public FoValue traitBorderStartStyle(final FOContext context) {
- return propertyList.getBorderStyle(context, Compass.START);
+ public BorderStyle traitBorderStartStyle(final FOContext context) {
+ final FoValue foValue = propertyList.getBorderStyle(context,
+ Compass.START);
+ return convertBorderStyle(foValue);
}
/**
* {@inheritDoc}
*/
- public FoValue traitBorderEndStyle(final FOContext context) {
- return propertyList.getBorderStyle(context, Compass.END);
+ public BorderStyle traitBorderEndStyle(final FOContext context) {
+ final FoValue foValue = propertyList.getBorderStyle(context,
+ Compass.END);
+ return convertBorderStyle(foValue);
}
/**
* {@inheritDoc}
*/
- public FoValue traitBorderLeftStyle(final FOContext context) {
- return propertyList.getBorderStyle(context, Compass.LEFT);
+ public BorderStyle traitBorderLeftStyle(final FOContext context) {
+ final FoValue foValue = propertyList.getBorderStyle(context,
+ Compass.LEFT);
+ return convertBorderStyle(foValue);
}
/**
* {@inheritDoc}
*/
- public FoValue traitBorderRightStyle(final FOContext context) {
- return propertyList.getBorderStyle(context, Compass.RIGHT);
+ public BorderStyle traitBorderRightStyle(final FOContext context) {
+ final FoValue foValue = propertyList.getBorderStyle(context,
+ Compass.RIGHT);
+ return convertBorderStyle(foValue);
}
/**
* {@inheritDoc}
*/
- public FoValue traitBorderTopStyle(final FOContext context) {
- return propertyList.getBorderStyle(context, Compass.TOP);
+ public BorderStyle traitBorderTopStyle(final FOContext context) {
+ final FoValue foValue = propertyList.getBorderStyle(context,
+ Compass.TOP);
+ return convertBorderStyle(foValue);
}
/**
* {@inheritDoc}
*/
- public FoValue traitBorderBottomStyle(final FOContext context) {
- return propertyList.getBorderStyle(context, Compass.BOTTOM);
+ public BorderStyle traitBorderBottomStyle(final FOContext context) {
+ final FoValue foValue = propertyList.getBorderStyle(context,
+ Compass.BOTTOM);
+ return convertBorderStyle(foValue);
}
/**
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderStyle.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderStyle.java 2007-04-06 19:38:01 UTC (rev 9127)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderStyle.java 2007-04-07 00:09:29 UTC (rev 9128)
@@ -135,31 +135,8 @@
return keyword;
}
final FObj effectiveParent = fobj.effectiveParent(context);
- if (direction == Compass.BEFORE) {
- return effectiveParent.traitBorderBeforeStyle(context);
- }
- if (direction == Compass.AFTER) {
- return effectiveParent.traitBorderAfterStyle(context);
- }
- if (direction == Compass.START) {
- return effectiveParent.traitBorderStartStyle(context);
- }
- if (direction == Compass.END) {
- return effectiveParent.traitBorderEndStyle(context);
- }
- if (direction == Compass.LEFT) {
- return effectiveParent.traitBorderLeftStyle(context);
- }
- if (direction == Compass.RIGHT) {
- return effectiveParent.traitBorderRightStyle(context);
- }
- if (direction == Compass.TOP) {
- return effectiveParent.traitBorderTopStyle(context);
- }
- if (direction == Compass.BOTTOM) {
- return effectiveParent.traitBorderBottomStyle(context);
- }
- return getValueNoInstance();
+ final PropertyList propertyList = effectiveParent.getPropertyList();
+ return propertyList.getBorderStyle(context, direction);
}
private FoValue getCollectionValue(final FOContext context,
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Enumerated.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Enumerated.java 2007-04-06 19:38:01 UTC (rev 9127)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Enumerated.java 2007-04-07 00:09:29 UTC (rev 9128)
@@ -167,7 +167,7 @@
}
case RULE_STYLE: {
if (parent != null) {
- return parent.traitRuleStyle(context);
+ return parent.getPropertyList().getRuleStyle(context);
}
return FoValue.SOLID;
}
@@ -418,7 +418,7 @@
return fobj.traitRelativePosition(context);
}
case RULE_STYLE: {
- return fobj.traitRuleStyle(context);
+ return fobj.getPropertyList().getRuleStyle(context);
}
case SCALING: {
return fobj.traitScaling(context);
Modified: trunk/foray/foray-render/src/java/org/foray/render/PrintRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/PrintRenderer.java 2007-04-06 19:38:01 UTC (rev 9127)
+++ trunk/foray/foray-render/src/java/org/foray/render/PrintRenderer.java 2007-04-07 00:09:29 UTC (rev 9128)
@@ -35,6 +35,7 @@
import org.axsl.areaR.LeaderArea;
import org.axsl.areaR.TextArea;
import org.axsl.common.FoValue;
+import org.axsl.common.RuleStyle;
import org.axsl.fontR.Font;
import org.axsl.fontR.FontConsumer;
@@ -76,25 +77,24 @@
final int top = area.traitBorderBeforeWidth();
final int bottom = area.traitBorderAfterWidth();
- // If style is solid, use filled rectangles
if (top != 0) {
- drawLine(rx, ry, rx + w, ry, area.traitBorderBeforeWidth(),
- area.traitBorderBeforeStyle(),
+ drawLine(rx, ry, rx + w, ry, top,
+ area.traitBorderBeforeStyle().getEquivalentRuleStyle(),
area.traitBorderBeforeColor());
}
if (left != 0) {
- drawLine(rx, ry, rx, ry - h, area.traitBorderStartWidth(),
- area.traitBorderStartStyle(),
+ drawLine(rx, ry, rx, ry - h, left,
+ area.traitBorderStartStyle().getEquivalentRuleStyle(),
area.traitBorderStartColor());
}
if (right != 0) {
- drawLine(rx + w, ry, rx + w, ry - h, area.traitBorderEndWidth(),
- area.traitBorderEndStyle(),
+ drawLine(rx + w, ry, rx + w, ry - h, right,
+ area.traitBorderEndStyle().getEquivalentRuleStyle(),
area.traitBorderEndColor());
}
if (bottom != 0) {
- drawLine(rx, ry - h, rx + w, ry - h, area.traitBorderAfterWidth(),
- area.traitBorderAfterStyle(),
+ drawLine(rx, ry - h, rx + w, ry - h, bottom,
+ area.traitBorderAfterStyle().getEquivalentRuleStyle(),
area.traitBorderAfterColor());
}
}
@@ -113,19 +113,19 @@
startY = getUnderlineYPosition(area);
drawLine(startX, startY, endX, startY,
font.underlineSize(area.traitFontSize()),
- FoValue.SOLID, area.traitUnderlineScoreColor());
+ RuleStyle.SOLID, area.traitUnderlineScoreColor());
}
if (area.traitOverlineScore()) {
startY = getOverlineYPosition(area);
drawLine(startX, startY, endX, startY,
font.overlineSize(area.traitFontSize()),
- FoValue.SOLID, area.traitOverlineScoreColor());
+ RuleStyle.SOLID, area.traitOverlineScoreColor());
}
if (area.traitThroughScore()) {
startY = getThroughYPosition(area);
drawLine(startX, startY, endX, startY,
font.strikeoutSize(area.traitFontSize()),
- FoValue.SOLID, area.traitThroughScoreColor());
+ RuleStyle.SOLID, area.traitThroughScoreColor());
}
}
@@ -188,7 +188,7 @@
final int ry = area.crOriginY();
final int w = area.crIPD();
final int th = area.traitRuleThickness();
- final FoValue st = area.traitRuleStyle();
+ final RuleStyle st = area.traitRuleStyle();
// checks whether thickness is = 0, because of bug in pdf (or where?),
// a line with thickness 0 is still displayed
Modified: trunk/foray/foray-render/src/java/org/foray/render/Renderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/Renderer.java 2007-04-06 19:38:01 UTC (rev 9127)
+++ trunk/foray/foray-render/src/java/org/foray/render/Renderer.java 2007-04-07 00:09:29 UTC (rev 9128)
@@ -68,7 +68,7 @@
import org.axsl.areaR.TableArea;
import org.axsl.areaR.TableCellArea;
import org.axsl.areaR.TextArea;
-import org.axsl.common.FoValue;
+import org.axsl.common.RuleStyle;
import org.axsl.graphicR.Graphic;
import org.axsl.graphicR.GraphicException;
import org.axsl.graphicR.SVGGraphic;
@@ -296,7 +296,7 @@
* @param strokeColor The stroke color.
*/
protected abstract void drawLine(int startX, int startY, int endX, int endY,
- int thickness, FoValue ruleStyle, Color strokeColor);
+ int thickness, RuleStyle ruleStyle, Color strokeColor);
/**
* Draw a rectangle in the output document.
Modified: trunk/foray/foray-render/src/java/org/foray/render/awt/AWTRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/awt/AWTRenderer.java 2007-04-06 19:38:01 UTC (rev 9127)
+++ trunk/foray/foray-render/src/java/org/foray/render/awt/AWTRenderer.java 2007-04-07 00:09:29 UTC (rev 9128)
@@ -43,7 +43,7 @@
import org.axsl.areaR.PageArea;
import org.axsl.areaR.SVGArea;
import org.axsl.areaR.TextArea;
-import org.axsl.common.FoValue;
+import org.axsl.common.RuleStyle;
import org.axsl.fontR.FontConsumer;
import org.axsl.fontR.FontUse;
import org.axsl.graphicR.Graphic;
@@ -200,7 +200,7 @@
* {@inheritDoc}
*/
protected void drawLine(final int x1, final int y1, final int x2,
- final int y2, final int th, final FoValue ruleStyle,
+ final int y2, final int th, final RuleStyle ruleStyle,
final Color strokeColor) {
graphics.setColor(strokeColor);
int x = x1;
@@ -472,22 +472,22 @@
if (area.traitBorderBeforeWidth() != 0) {
drawLine(rx, ry, rx + w, ry, -area.traitBorderBeforeWidth(),
- FoValue.SOLID, area.traitBorderBeforeColor());
+ RuleStyle.SOLID, area.traitBorderBeforeColor());
}
if (area.traitBorderStartWidth() != 0) {
drawLine(rx, ry, rx, ry - h, area.traitBorderStartWidth(),
- FoValue.SOLID, area.traitBorderStartColor());
+ RuleStyle.SOLID, area.traitBorderStartColor());
}
if (area.traitBorderEndWidth() != 0) {
drawLine(rx + w, ry, rx + w, ry - h, -area.traitBorderEndWidth(),
- FoValue.SOLID, area.traitBorderEndColor());
+ RuleStyle.SOLID, area.traitBorderEndColor());
}
if (area.traitBorderAfterWidth() != 0) {
drawLine(rx, ry - h, rx + w, ry - h, area.traitBorderAfterWidth(),
- FoValue.SOLID, area.traitBorderAfterColor());
+ RuleStyle.SOLID, area.traitBorderAfterColor());
}
}
Modified: trunk/foray/foray-render/src/java/org/foray/render/pcl/PCLRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/pcl/PCLRenderer.java 2007-04-06 19:38:01 UTC (rev 9127)
+++ trunk/foray/foray-render/src/java/org/foray/render/pcl/PCLRenderer.java 2007-04-07 00:09:29 UTC (rev 9128)
@@ -48,7 +48,7 @@
import org.axsl.areaR.GraphicArea;
import org.axsl.areaR.PageArea;
import org.axsl.areaR.SVGArea;
-import org.axsl.common.FoValue;
+import org.axsl.common.RuleStyle;
import org.axsl.fontR.Font;
import org.axsl.graphicR.Graphic;
import org.axsl.graphicR.GraphicException;
@@ -208,7 +208,7 @@
* {@inheritDoc}
*/
protected void drawLine(final int x1, final int y1, final int x2,
- final int y2, final int th, final FoValue rs,
+ final int y2, final int th, final RuleStyle rs,
final Color strokeColor) {
int dashon = 0;
int dashoff = 0;
Modified: trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2007-04-06 19:38:01 UTC (rev 9127)
+++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2007-04-07 00:09:29 UTC (rev 9128)
@@ -49,8 +49,8 @@
import org.axsl.areaR.PageArea;
import org.axsl.areaR.SVGArea;
import org.axsl.areaR.TextArea;
-import org.axsl.common.FoValue;
import org.axsl.common.LinkType;
+import org.axsl.common.RuleStyle;
import org.axsl.fontR.Font;
import org.axsl.fontR.FontUse;
import org.axsl.graphicR.Graphic;
@@ -192,7 +192,7 @@
* {@inheritDoc}
*/
protected void drawLine(final int startX, final int startY, final int endX,
- final int endY, final int thickness, final FoValue ruleStyle,
+ final int endY, final int thickness, final RuleStyle ruleStyle,
final Color strokeColor) {
final PDFColor pdfColor = this.getPDFDocument().createPDFColor(
strokeColor);
Modified: trunk/foray/foray-render/src/java/org/foray/render/ps/PSRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/ps/PSRenderer.java 2007-04-06 19:38:01 UTC (rev 9127)
+++ trunk/foray/foray-render/src/java/org/foray/render/ps/PSRenderer.java 2007-04-07 00:09:29 UTC (rev 9128)
@@ -49,7 +49,7 @@
import org.axsl.areaR.LeaderArea;
import org.axsl.areaR.PageArea;
import org.axsl.areaR.SVGArea;
-import org.axsl.common.FoValue;
+import org.axsl.common.RuleStyle;
import org.axsl.fontR.Font;
import org.axsl.fontR.FontUse;
import org.axsl.fontR.output.FontPS;
@@ -453,7 +453,7 @@
* {@inheritDoc}
*/
protected void drawLine(final int startX, final int startY, final int endX,
- final int endY, final int thickness, final FoValue ruleStyle,
+ final int endY, final int thickness, final RuleStyle ruleStyle,
final Color strokeColor) {
//TODO: Implement this.
}
@@ -1009,7 +1009,7 @@
break;
case RULE:
- if (area.traitRuleStyle() == FoValue.NONE) {
+ if (area.traitRuleStyle() == RuleStyle.NONE) {
break;
}
useColor(area.getColor());
Modified: trunk/foray/foray-render/src/java/org/foray/render/svg/SVGRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/svg/SVGRenderer.java 2007-04-06 19:38:01 UTC (rev 9127)
+++ trunk/foray/foray-render/src/java/org/foray/render/svg/SVGRenderer.java 2007-04-07 00:09:29 UTC (rev 9128)
@@ -42,7 +42,7 @@
import org.axsl.areaR.PageArea;
import org.axsl.areaR.SVGArea;
import org.axsl.areaR.TextArea;
-import org.axsl.common.FoValue;
+import org.axsl.common.RuleStyle;
import org.axsl.fontR.FontConsumer;
import org.axsl.graphicR.Graphic;
import org.axsl.graphicR.GraphicException;
@@ -118,7 +118,7 @@
* {@inheritDoc}
*/
protected void drawLine(final int x1, final int y1, final int x2,
- final int y2, final int th, final FoValue ruleStyle,
+ final int y2, final int th, final RuleStyle ruleStyle,
final Color strokeColor) {
final Element line = SVGUtilities.createLine(this.svgDocument,
toPoints(x1),
@@ -351,22 +351,22 @@
if (area.traitBorderBeforeWidth() != 0) {
drawLine(rx, ry, rx + w, ry, area.traitBorderBeforeWidth(),
- FoValue.SOLID, area.traitBorderBeforeColor());
+ RuleStyle.SOLID, area.traitBorderBeforeColor());
}
if (area.traitBorderStartWidth() != 0) {
drawLine(rx, ry, rx, ry - h, area.traitBorderStartWidth(),
- FoValue.DASHED, area.traitBorderStartColor());
+ RuleStyle.DASHED, area.traitBorderStartColor());
}
if (area.traitBorderEndWidth() != 0) {
drawLine(rx + w, ry, rx + w, ry - h, area.traitBorderEndWidth(),
- FoValue.DASHED, area.traitBorderEndColor());
+ RuleStyle.DASHED, area.traitBorderEndColor());
}
if (area.traitBorderAfterWidth() != 0) {
drawLine(rx, ry - h, rx + w, ry - h, area.traitBorderAfterWidth(),
- FoValue.DASHED, area.traitBorderAfterColor());
+ RuleStyle.DASHED, area.traitBorderAfterColor());
}
}
Modified: trunk/foray/foray-render/src/java/org/foray/render/txt/TXTRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/txt/TXTRenderer.java 2007-04-06 19:38:01 UTC (rev 9127)
+++ trunk/foray/foray-render/src/java/org/foray/render/txt/TXTRenderer.java 2007-04-07 00:09:29 UTC (rev 9128)
@@ -40,7 +40,7 @@
import org.axsl.areaR.GraphicArea;
import org.axsl.areaR.PageArea;
import org.axsl.areaR.SVGArea;
-import org.axsl.common.FoValue;
+import org.axsl.common.RuleStyle;
import org.axsl.graphicR.Graphic;
import org.axsl.graphicR.GraphicException;
import org.axsl.graphicR.SVGGraphic;
@@ -249,10 +249,10 @@
* {@inheritDoc}
*/
protected void drawLine(final int x1, final int y1, final int x2,
- final int y2, final int th, final FoValue rs,
+ final int y2, final int th, final RuleStyle rs,
final Color strokeColor) {
Color lstroke = null;
- if (rs == FoValue.DOTTED) {
+ if (rs == RuleStyle.DOTTED) {
lstroke = new Color(DOTTED_LINE_GRAY, DOTTED_LINE_GRAY,
DOTTED_LINE_GRAY);
} else {
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 2007-04-06 19:38:01 UTC (rev 9127)
+++ trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java 2007-04-07 00:09:29 UTC (rev 9128)
@@ -61,7 +61,7 @@
import org.axsl.areaR.TableArea;
import org.axsl.areaR.TableCellArea;
import org.axsl.areaR.TextArea;
-import org.axsl.common.FoValue;
+import org.axsl.common.RuleStyle;
import org.axsl.fontR.FontConsumer;
import org.axsl.graphicR.Graphic;
import org.axsl.graphicR.SVGGraphic;
@@ -420,7 +420,7 @@
area.getProgressionDimension());
outputAttribute(buffer, "rule-thickness", area.traitRuleThickness());
outputAttribute(buffer, "rule-style",
- area.traitRuleStyle().toXslFo());
+ area.traitRuleStyle().toString());
outputColor(area, buffer);
writeStartTag(area, buffer);
outputAllRectangles(area);
@@ -579,7 +579,7 @@
* {@inheritDoc}
*/
protected void drawLine(final int startX, final int startY, final int endX,
- final int endY, final int thickness, final FoValue ruleStyle,
+ final int endY, final int thickness, final RuleStyle ruleStyle,
final Color strokeColor) {
// No operation.
return;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-04-07 00:23:44
|
Revision: 9129
http://svn.sourceforge.net/foray/?rev=9129&view=rev
Author: victormote
Date: 2007-04-06 17:23:44 -0700 (Fri, 06 Apr 2007)
Log Message:
-----------
Conform to axsl changes for new generic Scaling enum.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/Area.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Enumerated.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/Area.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2007-04-07 00:09:29 UTC (rev 9128)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2007-04-07 00:23:44 UTC (rev 9129)
@@ -39,6 +39,7 @@
import org.axsl.common.FoValue;
import org.axsl.common.LinkType;
import org.axsl.common.RelativeAxis;
+import org.axsl.common.Scaling;
import org.axsl.foR.FOContext;
import org.axsl.foR.FObj;
import org.axsl.foR.WritingMode;
@@ -1379,7 +1380,7 @@
/**
* {@inheritDoc}
*/
- public FoValue traitScaling() {
+ public Scaling traitScaling() {
return traitGeneratedBy().traitScaling(this);
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-04-07 00:09:29 UTC (rev 9128)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-04-07 00:23:44 UTC (rev 9129)
@@ -42,6 +42,7 @@
import org.axsl.common.FoValue;
import org.axsl.common.RelativeAxis;
import org.axsl.common.RuleStyle;
+import org.axsl.common.Scaling;
import org.axsl.foR.FOContext;
import org.axsl.foR.FOTreeException;
import org.axsl.foR.ShadowEffect;
@@ -1248,10 +1249,26 @@
}
/**
+ * Converts an {@link FoValue} scaling value to the more generic
+ * {@link Scaling} value.
+ * @param foScaling The raw FO scaling value to be converted.
+ * @return The matching Scaling instance.
+ */
+ private static Scaling convertScaling(final FoValue foScaling) {
+ switch (foScaling) {
+ case UNIFORM: return Scaling.UNIFORM;
+ case NON_UNIFORM: return Scaling.NON_UNIFORM;
+ default: throw new IllegalArgumentException("Illegal scaling value: "
+ + foScaling.toXslFo());
+ }
+ }
+
+ /**
* {@inheritDoc}
*/
- public FoValue traitScaling(final FOContext context) {
- return propertyList.getScaling(context);
+ public Scaling traitScaling(final FOContext context) {
+ final FoValue foScaling = propertyList.getScaling(context);
+ return convertScaling(foScaling);
}
/**
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Enumerated.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Enumerated.java 2007-04-07 00:09:29 UTC (rev 9128)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Enumerated.java 2007-04-07 00:23:44 UTC (rev 9129)
@@ -421,7 +421,7 @@
return fobj.getPropertyList().getRuleStyle(context);
}
case SCALING: {
- return fobj.traitScaling(context);
+ return fobj.getPropertyList().getScaling(context);
}
case SCALING_METHOD: {
return fobj.traitScalingMethod(context);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-04-07 00:46:26
|
Revision: 9130
http://svn.sourceforge.net/foray/?rev=9130&view=rev
Author: victormote
Date: 2007-04-06 17:46:22 -0700 (Fri, 06 Apr 2007)
Log Message:
-----------
Conform to axsl changes for new generic Overflow enum.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/Area.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Enumerated.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/Area.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2007-04-07 00:23:44 UTC (rev 9129)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2007-04-07 00:46:22 UTC (rev 9130)
@@ -38,6 +38,7 @@
import org.axsl.common.BorderStyle;
import org.axsl.common.FoValue;
import org.axsl.common.LinkType;
+import org.axsl.common.Overflow;
import org.axsl.common.RelativeAxis;
import org.axsl.common.Scaling;
import org.axsl.foR.FOContext;
@@ -1405,7 +1406,7 @@
/**
* {@inheritDoc}
*/
- public FoValue traitOverflow() {
+ public Overflow traitOverflow() {
return traitGeneratedBy().traitOverflow(this);
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-04-07 00:23:44 UTC (rev 9129)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-04-07 00:46:22 UTC (rev 9130)
@@ -40,6 +40,7 @@
import org.axsl.common.BorderStyle;
import org.axsl.common.Compass;
import org.axsl.common.FoValue;
+import org.axsl.common.Overflow;
import org.axsl.common.RelativeAxis;
import org.axsl.common.RuleStyle;
import org.axsl.common.Scaling;
@@ -966,10 +967,30 @@
}
/**
+ * Converts an {@link FoValue} overflow value to the more generic
+ * {@link Overflow} value.
+ * @param foOverflow The raw FO overflow value to be converted.
+ * @return The matching Overflow instance.
+ */
+ private static Overflow convertOverflow(final FoValue foOverflow) {
+ switch (foOverflow) {
+ case VISIBLE: return Overflow.VISIBLE;
+ case HIDDEN: return Overflow.HIDDEN;
+ case SCROLL: return Overflow.SCROLL;
+ case AUTO: return Overflow.AUTO;
+ case ERROR_IF_OVERFLOW: return Overflow.ERROR_IF_OVERFLOW;
+ case REPEAT: return Overflow.REPEAT;
+ default: throw new IllegalArgumentException("Illegal overflow value: "
+ + foOverflow.toXslFo());
+ }
+ }
+
+ /**
* {@inheritDoc}
*/
- public FoValue traitOverflow(final FOContext context) {
- return propertyList.getOverflow(context);
+ public Overflow traitOverflow(final FOContext context) {
+ final FoValue foOverflow = propertyList.getOverflow(context);
+ return convertOverflow(foOverflow);
}
/**
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Enumerated.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Enumerated.java 2007-04-07 00:23:44 UTC (rev 9129)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Enumerated.java 2007-04-07 00:46:22 UTC (rev 9130)
@@ -403,7 +403,7 @@
return fobj.traitOddOrEven();
}
case OVERFLOW: {
- return fobj.traitOverflow(context);
+ return fobj.getPropertyList().getOverflow(context);
}
case PAGE_POSITION: {
return fobj.getPropertyList().getPagePosition();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|