Thread: [FOray-commit] SF.net SVN: foray: [9927] trunk/foray (Page 17)
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2007-07-05 21:22:55
|
Revision: 9927
http://svn.sourceforge.net/foray/?rev=9927&view=rev
Author: victormote
Date: 2007-07-05 14:22:34 -0700 (Thu, 05 Jul 2007)
Log Message:
-----------
Conform to axsl changes rolling up method parameters into new FoContext methods.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/Area.java
trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.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/PropertyList.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbstractBorderWidth.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderWidth.java
trunk/foray/foray-fotree/src/javatest/org/foray/fotree/AbstractPropertyTest.java
trunk/foray/foray-fotree/src/javatest/org/foray/fotree/fo/prop/AbstractTestBorderWidth.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/OverrideGraftingContext.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableCellPL.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-07-05 20:36:42 UTC (rev 9926)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2007-07-05 21:22:34 UTC (rev 9927)
@@ -869,28 +869,28 @@
* {@inheritDoc}
*/
public int traitBorderStartWidth() {
- return traitGeneratedBy().traitBorderStartWidth(this, traitIsFirst());
+ return traitGeneratedBy().traitBorderStartWidth(this);
}
/**
* {@inheritDoc}
*/
public int traitBorderEndWidth() {
- return traitGeneratedBy().traitBorderEndWidth(this, traitIsLast());
+ return traitGeneratedBy().traitBorderEndWidth(this);
}
/**
* {@inheritDoc}
*/
public int traitBorderBeforeWidth() {
- return traitGeneratedBy().traitBorderBeforeWidth(this, traitIsFirst());
+ return traitGeneratedBy().traitBorderBeforeWidth(this);
}
/**
* {@inheritDoc}
*/
public int traitBorderAfterWidth() {
- return traitGeneratedBy().traitBorderAfterWidth(this, traitIsLast());
+ return traitGeneratedBy().traitBorderAfterWidth(this);
}
/**
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java 2007-07-05 20:36:42 UTC (rev 9926)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java 2007-07-05 21:22:34 UTC (rev 9927)
@@ -770,4 +770,18 @@
return ancestor.crBpd();
}
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isFirst() {
+ return this.nearestArea().traitIsFirst();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isLast() {
+ return this.nearestArea().traitIsLast();
+ }
+
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TableCellRA.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/TableCellRA.java 2007-07-05 20:36:42 UTC (rev 9926)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/TableCellRA.java 2007-07-05 21:22:34 UTC (rev 9927)
@@ -238,10 +238,10 @@
final TableCell tableCell = traitGeneratedBy();
if (tableCell.traitBorderCollapse(this) == BorderModel.SEPARATE) {
final int iSep = tableCell.traitBorderSeparationIpd(this);
- return iSep / 2 + tableCell.traitBorderStartWidth(this, true)
+ return iSep / 2 + tableCell.traitBorderStartWidth(this)
+ tableCell.traitPaddingStart(this, true);
}
- return tableCell.traitBorderStartWidth(this, true) / 2
+ return tableCell.traitBorderStartWidth(this) / 2
+ tableCell.traitPaddingStart(this, true);
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-07-05 20:36:42 UTC (rev 9926)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-07-05 21:22:34 UTC (rev 9927)
@@ -1822,37 +1822,32 @@
/**
* {@inheritDoc}
*/
- public int traitBorderBeforeWidth(final FoContext context,
- final boolean isFirst) {
+ public int traitBorderBeforeWidth(final FoContext context) {
return propertyList.getBorderWidth(this, context,
- RelativeCompass.BEFORE, isFirst);
+ RelativeCompass.BEFORE);
}
/**
* {@inheritDoc}
*/
- public int traitBorderAfterWidth(final FoContext context,
- final boolean isLast) {
- return propertyList.getBorderWidth(this, context, RelativeCompass.AFTER,
- isLast);
+ public int traitBorderAfterWidth(final FoContext context) {
+ return propertyList.getBorderWidth(this, context,
+ RelativeCompass.AFTER);
}
/**
* {@inheritDoc}
*/
- public int traitBorderStartWidth(final FoContext context,
- final boolean isFirst) {
- return propertyList.getBorderWidth(this, context, RelativeCompass.START,
- isFirst);
+ public int traitBorderStartWidth(final FoContext context) {
+ return propertyList.getBorderWidth(this, context,
+ RelativeCompass.START);
}
/**
* {@inheritDoc}
*/
- public int traitBorderEndWidth(final FoContext context,
- final boolean isLast) {
- return propertyList.getBorderWidth(this, context, RelativeCompass.END,
- isLast);
+ public int traitBorderEndWidth(final FoContext context) {
+ return propertyList.getBorderWidth(this, context, RelativeCompass.END);
}
/**
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-07-05 20:36:42 UTC (rev 9926)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-07-05 21:22:34 UTC (rev 9927)
@@ -753,7 +753,7 @@
* specified? Or do we need to look for the properties using just
* the absolute properties? */
indent += this.getPadding(fobj, context, direction, false);
- indent += this.getBorderWidth(fobj, context, direction, false);
+ indent += this.getBorderWidth(fobj, context, direction);
return indent;
}
@@ -2884,14 +2884,10 @@
* @param context An object that knows how to resolve FO Tree context
* issues.
* @param direction The direction for which the border width is needed.
- * @param isOuterEdge For "before" and "start", set this to "true" if the
- * area for which this width is computed "is-first" in the reference area.
- * For "after" and "end", set this to "true" if the area for which this
- * width is computed "is-last" in the reference area.
* @return The width, in millipoints, of the border.
*/
public int getBorderWidth(final FObj fobj, final FoContext context,
- final RelativeCompass direction, final boolean isOuterEdge) {
+ final RelativeCompass direction) {
/* If the border-style is "none", the width is zero. */
if (getBorderStyle(fobj, context, direction)
== org.axsl.common.value.BorderStyle.NONE) {
@@ -2908,7 +2904,7 @@
abstractBorderWidth = (AbstractBorderWidth) getProperty(
rawPropertyType);
if (abstractBorderWidth != null) {
- return abstractBorderWidth.getValue(context, fobj, isOuterEdge);
+ return abstractBorderWidth.getValue(context, fobj);
}
/* Now try the corresponding explicit value, e.g. "border-top-width". */
@@ -2919,7 +2915,7 @@
abstractBorderWidth = (AbstractBorderWidth) getProperty(
rawPropertyType);
if (abstractBorderWidth != null) {
- return abstractBorderWidth.getValue(context, fobj, isOuterEdge);
+ return abstractBorderWidth.getValue(context, fobj);
}
/* Now try the lowest-level shorthand, e.g. "border-top". */
@@ -2929,7 +2925,7 @@
if (abstractBorder != null) {
abstractBorderWidth = abstractBorder.getBorderWidth();
if (abstractBorderWidth != null) {
- return abstractBorderWidth.getValue(context, fobj, isOuterEdge);
+ return abstractBorderWidth.getValue(context, fobj);
}
}
@@ -2937,7 +2933,7 @@
final BorderWidth borderWidth = (BorderWidth) getProperty(
FoProperty.BORDER_WIDTH);
if (borderWidth != null) {
- return borderWidth.getValue(context, direction, fobj, isOuterEdge);
+ return borderWidth.getValue(context, direction, fobj);
}
/* Now try the least-precise shorthand, that is, "border". */
@@ -2948,7 +2944,7 @@
}
if (abstractBorderWidth != null) {
- return abstractBorderWidth.getValue(context, fobj, isOuterEdge);
+ return abstractBorderWidth.getValue(context, fobj);
}
return AbstractBorderWidth.getValueNoInstance();
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbstractBorderWidth.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbstractBorderWidth.java 2007-07-05 20:36:42 UTC (rev 9926)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbstractBorderWidth.java 2007-07-05 21:22:34 UTC (rev 9927)
@@ -110,16 +110,13 @@
* Returns the value of this property.
* @param context An object that knows how to resolve FO context issues.
* @param fobj The FO for which this value is needed.
- * @param isOuterEdge Indicates whether the border width sought is on the
- * outer edge.
* @return The value of this property.
*/
- public int getValue(final FoContext context, final FObj fobj,
- final boolean isOuterEdge) {
+ public int getValue(final FoContext context, final FObj fobj) {
final RelativeCompass direction = this.getRelativeCompass(context,
fobj);
if (value().canEvalKeyword()) {
- return getKeywordValue(context, direction, fobj, isOuterEdge);
+ return getKeywordValue(context, direction, fobj);
}
if (value().canEvalLength()) {
final int length = this.convertValueToLength(value(), fobj,
@@ -140,7 +137,7 @@
* then the border should have a width of zero.
*/
if (condition == FoValue.DISCARD) {
- if (! isOuterEdge) {
+ if (! isOuterEdge(context, fobj)) {
return 0;
}
}
@@ -167,13 +164,10 @@
* @param context An object that knows how to resolve FO context issues.
* @param direction The direction for which the border width is needed.
* @param fobj The FO for which this value is needed.
- * @param isOuterEdge Indicates whether the border width sought is on the
- * outer edge.
* @return The value of this property.
*/
private int getKeywordValue(final FoContext context,
- final RelativeCompass direction,
- final FObj fobj, final boolean isOuterEdge) {
+ final RelativeCompass direction, final FObj fobj) {
final FoPropertyKeyword kw = (FoPropertyKeyword) value();
switch (kw.getValue()) {
case THIN: {
@@ -188,20 +182,16 @@
case INHERIT: {
final FObj effectiveParent = fobj.effectiveParent(context);
if (direction == RelativeCompass.BEFORE) {
- return effectiveParent.traitBorderBeforeWidth(context,
- isOuterEdge);
+ return effectiveParent.traitBorderBeforeWidth(context);
}
if (direction == RelativeCompass.AFTER) {
- return effectiveParent.traitBorderAfterWidth(context,
- isOuterEdge);
+ return effectiveParent.traitBorderAfterWidth(context);
}
if (direction == RelativeCompass.START) {
- return effectiveParent.traitBorderStartWidth(context,
- isOuterEdge);
+ return effectiveParent.traitBorderStartWidth(context);
}
if (direction == RelativeCompass.END) {
- return effectiveParent.traitBorderEndWidth(context,
- isOuterEdge);
+ return effectiveParent.traitBorderEndWidth(context);
}
}
}
@@ -263,4 +253,30 @@
return value;
}
+ /**
+ * Indicates whether the context is on the outer edge of its parent
+ * reference area.
+ * @param context An object that knows how to resolve FO context issues.
+ * @param fobj The FO for which this property exists.
+ * @return True iff the context is on the outer edge of its parent reference
+ * area.
+ */
+ protected boolean isOuterEdge(final FoContext context, final FObj fobj) {
+ final RelativeCompass direction = this.getRelativeCompass(context,
+ fobj);
+ switch (direction) {
+ case BEFORE:
+ case START: {
+ return context.isFirst();
+ }
+ case AFTER:
+ case END: {
+ return context.isLast();
+ }
+ default: {
+ throw new NullPointerException("RelativeCompass cannot be null");
+ }
+ }
+ }
+
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderWidth.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderWidth.java 2007-07-05 20:36:42 UTC (rev 9926)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderWidth.java 2007-07-05 21:22:34 UTC (rev 9927)
@@ -128,18 +128,15 @@
* @param context An object that knows how to resolve FO context issues.
* @param direction The direction for which the border width is needed.
* @param fobj The FO for which this value is needed.
- * @param isOuterEdge Indicates whether the border width sought is on the
- * outer edge.
* @return The value of this property.
*/
public int getValue(final FoContext context,
- final RelativeCompass direction,
- final FObj fobj, final boolean isOuterEdge) {
+ final RelativeCompass direction, final FObj fobj) {
if (value() instanceof ValueCollection) {
- return getCollectionValue(context, direction, fobj, isOuterEdge);
+ return getCollectionValue(context, direction, fobj);
}
if (value().canEvalKeyword()) {
- return getKeywordValue(context, direction, fobj, isOuterEdge);
+ return getKeywordValue(context, direction, fobj);
}
throw this.unexpectedRetrieval();
}
@@ -149,13 +146,10 @@
* @param context An object that knows how to resolve FO context issues.
* @param direction The direction for which the border width is needed.
* @param fobj The FO for which this value is needed.
- * @param isOuterEdge Indicates whether the border width sought is on the
- * outer edge.
* @return The value of this property.
*/
private int getCollectionValue(final FoContext context,
- final RelativeCompass direction, final FObj fobj,
- final boolean isOuterEdge) {
+ final RelativeCompass direction, final FObj fobj) {
final ValueCollection collection = (ValueCollection) value();
final int whichElement = PropertyCollection.whichElementForDirectional(
direction, collection.getCount());
@@ -190,13 +184,10 @@
* @param context An object that knows how to resolve FO context issues.
* @param direction The direction for which the border width is needed.
* @param fobj The FO for which this value is needed.
- * @param isOuterEdge Indicates whether the border width sought is on the
- * outer edge.
* @return The value of this property.
*/
private int getKeywordValue(final FoContext context,
- final RelativeCompass direction,
- final FObj fobj, final boolean isOuterEdge) {
+ final RelativeCompass direction, final FObj fobj) {
/* TODO: Implement this. */
return 0;
}
Modified: trunk/foray/foray-fotree/src/javatest/org/foray/fotree/AbstractPropertyTest.java
===================================================================
--- trunk/foray/foray-fotree/src/javatest/org/foray/fotree/AbstractPropertyTest.java 2007-07-05 20:36:42 UTC (rev 9926)
+++ trunk/foray/foray-fotree/src/javatest/org/foray/fotree/AbstractPropertyTest.java 2007-07-05 21:22:34 UTC (rev 9927)
@@ -64,6 +64,12 @@
public int heightContainingBlock() {
return 9 * 72000;
}
+ public boolean isFirst() {
+ return false;
+ }
+ public boolean isLast() {
+ return false;
+ }
};
/**
Modified: trunk/foray/foray-fotree/src/javatest/org/foray/fotree/fo/prop/AbstractTestBorderWidth.java
===================================================================
--- trunk/foray/foray-fotree/src/javatest/org/foray/fotree/fo/prop/AbstractTestBorderWidth.java 2007-07-05 20:36:42 UTC (rev 9926)
+++ trunk/foray/foray-fotree/src/javatest/org/foray/fotree/fo/prop/AbstractTestBorderWidth.java 2007-07-05 21:22:34 UTC (rev 9927)
@@ -55,8 +55,7 @@
*/
private int getPropertyValue(final AbstractBorderWidth property,
final FObj testFobj) {
- final int testLength = property.getValue(STD_FO_CONTEXT, testFobj,
- false);
+ final int testLength = property.getValue(STD_FO_CONTEXT, testFobj);
return testLength;
}
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/OverrideGraftingContext.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/OverrideGraftingContext.java 2007-07-05 20:36:42 UTC (rev 9926)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/OverrideGraftingContext.java 2007-07-05 21:22:34 UTC (rev 9927)
@@ -111,4 +111,18 @@
return this.wrappedContext.heightContainingBlock();
}
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isFirst() {
+ return this.wrappedContext.isFirst();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isLast() {
+ return this.wrappedContext.isLast();
+ }
+
}
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableCellPL.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableCellPL.java 2007-07-05 20:36:42 UTC (rev 9926)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableCellPL.java 2007-07-05 21:22:34 UTC (rev 9927)
@@ -76,8 +76,8 @@
public int getHeight(final FoContext context) {
return areaContainer.crBpd()
+ this.node.traitBorderSeparationBpd(context)
- - (this.node.traitBorderBeforeWidth(context, true)
- + this.node.traitBorderAfterWidth(context, true))
+ - (this.node.traitBorderBeforeWidth(context)
+ + this.node.traitBorderAfterWidth(context))
/ 2;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-05 21:37:03
|
Revision: 9928
http://svn.sourceforge.net/foray/?rev=9928&view=rev
Author: victormote
Date: 2007-07-05 14:36:16 -0700 (Thu, 05 Jul 2007)
Log Message:
-----------
Conform to axsl changes rolling up method parameters into new FoContext methods.
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/PropertyList.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbstractPadding.java
trunk/foray/foray-fotree/src/javatest/org/foray/fotree/fo/prop/AbstractTestPadding.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-07-05 21:22:34 UTC (rev 9927)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2007-07-05 21:36:16 UTC (rev 9928)
@@ -896,37 +896,33 @@
/**
* Returns the padding-start trait for this area.
* @return The padding-start trait for this area.
- * @see Fo#traitPaddingStart(FoContext, boolean)
*/
public int traitPaddingStart() {
- return traitGeneratedBy().traitPaddingStart(this, traitIsFirst());
+ return traitGeneratedBy().traitPaddingStart(this);
}
/**
* Returns the padding-end trait for this area.
* @return The padding-end trait for this area.
- * @see Fo#traitPaddingEnd(FoContext, boolean)
*/
public int traitPaddingEnd() {
- return traitGeneratedBy().traitPaddingEnd(this, traitIsLast());
+ return traitGeneratedBy().traitPaddingEnd(this);
}
/**
* Returns the padding-before trait for this area.
* @return The padding-before trait for this area.
- * @see Fo#traitPaddingBefore(FoContext, boolean)
*/
public int traitPaddingBefore() {
- return traitGeneratedBy().traitPaddingBefore(this, traitIsFirst());
+ return traitGeneratedBy().traitPaddingBefore(this);
}
/**
* Returns the padding-after trait for this area.
* @return The padding-after trait for this area.
- * @see Fo#traitPaddingAfter(FoContext, boolean)
*/
public int traitPaddingAfter() {
- return traitGeneratedBy().traitPaddingAfter(this, traitIsLast());
+ return traitGeneratedBy().traitPaddingAfter(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-07-05 21:22:34 UTC (rev 9927)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/TableCellRA.java 2007-07-05 21:36:16 UTC (rev 9928)
@@ -118,7 +118,7 @@
* @return The total padding on the top of this cell.
*/
public int getPaddingBefore() {
- return this.traitGeneratedBy().traitPaddingBefore(this, true)
+ return this.traitGeneratedBy().traitPaddingBefore(this)
+ getCenteringPaddingBefore();
}
@@ -127,7 +127,7 @@
* @return The total padding on the left of this cell.
*/
public int getPaddingStart() {
- return this.traitGeneratedBy().traitPaddingStart(this, true)
+ return this.traitGeneratedBy().traitPaddingStart(this)
+ getCenteringPaddingStart();
}
@@ -136,7 +136,7 @@
* @return The total padding on the bottom of this cell.
*/
public int getPaddingAfter() {
- return this.traitGeneratedBy().traitPaddingAfter(this, true)
+ return this.traitGeneratedBy().traitPaddingAfter(this)
+ getCenteringPaddingAfter();
}
@@ -145,7 +145,7 @@
* @return The total padding on the right of this cell.
*/
public int getPaddingEnd() {
- return this.traitGeneratedBy().traitPaddingEnd(this, true)
+ return this.traitGeneratedBy().traitPaddingEnd(this)
+ getCenteringPaddingEnd();
}
@@ -239,10 +239,10 @@
if (tableCell.traitBorderCollapse(this) == BorderModel.SEPARATE) {
final int iSep = tableCell.traitBorderSeparationIpd(this);
return iSep / 2 + tableCell.traitBorderStartWidth(this)
- + tableCell.traitPaddingStart(this, true);
+ + tableCell.traitPaddingStart(this);
}
return tableCell.traitBorderStartWidth(this) / 2
- + tableCell.traitPaddingStart(this, true);
+ + tableCell.traitPaddingStart(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-07-05 21:22:34 UTC (rev 9927)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-07-05 21:36:16 UTC (rev 9928)
@@ -1853,36 +1853,29 @@
/**
* {@inheritDoc}
*/
- public int traitPaddingBefore(final FoContext context,
- final boolean isFirst) {
- return propertyList.getPadding(this, context, RelativeCompass.BEFORE,
- isFirst);
+ public int traitPaddingBefore(final FoContext context) {
+ return propertyList.getPadding(this, context, RelativeCompass.BEFORE);
}
/**
* {@inheritDoc}
*/
- public int traitPaddingAfter(final FoContext context,
- final boolean isLast) {
- return propertyList.getPadding(this, context, RelativeCompass.AFTER,
- isLast);
+ public int traitPaddingAfter(final FoContext context) {
+ return propertyList.getPadding(this, context, RelativeCompass.AFTER);
}
/**
* {@inheritDoc}
*/
- public int traitPaddingStart(final FoContext context,
- final boolean isFirst) {
- return propertyList.getPadding(this, context, RelativeCompass.START,
- isFirst);
+ public int traitPaddingStart(final FoContext context) {
+ return propertyList.getPadding(this, context, RelativeCompass.START);
}
/**
* {@inheritDoc}
*/
- public int traitPaddingEnd(final FoContext context, final boolean isLast) {
- return propertyList.getPadding(this, context, RelativeCompass.END,
- isLast);
+ public int traitPaddingEnd(final FoContext context) {
+ return propertyList.getPadding(this, context, RelativeCompass.END);
}
/**
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-07-05 21:22:34 UTC (rev 9927)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-07-05 21:36:16 UTC (rev 9928)
@@ -752,7 +752,7 @@
* qualify as "padding-corresponding" and "border-corresponding" as
* specified? Or do we need to look for the properties using just
* the absolute properties? */
- indent += this.getPadding(fobj, context, direction, false);
+ indent += this.getPadding(fobj, context, direction);
indent += this.getBorderWidth(fobj, context, direction);
return indent;
}
@@ -2955,15 +2955,10 @@
* @param context An object that knows how to resolve FO Tree context
* issues.
* @param direction The direction for which the padding width is needed.
- * @param isOuterEdge For "before" and "start", set this to "true" if the
- * area for which this width is computed "is-first" in the reference area.
- * For "after" and "end", set this to "true" if the area for which this
- * width is computed "is-last" in the reference area.
* @return The width, in millipoints, of the padding.
*/
public int getPadding(final FObj fobj, final FoContext context,
- final RelativeCompass direction,
- final boolean isOuterEdge) {
+ final RelativeCompass direction) {
AbstractPadding padding = null;
// Try the most explicit setting first, e.g "padding-top"
FoProperty rawPropertyType = AbstractPadding.rawPropertyType(direction);
@@ -2982,7 +2977,7 @@
if (padding == null) {
return AbstractPadding.getValueNoInstance();
}
- return padding.getValue(context, fobj, isOuterEdge);
+ return padding.getValue(context, fobj);
}
/**
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbstractPadding.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbstractPadding.java 2007-07-05 21:22:34 UTC (rev 9927)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbstractPadding.java 2007-07-05 21:36:16 UTC (rev 9928)
@@ -96,14 +96,11 @@
* Returns the value of this property.
* @param context An object that knows how to resolve FO context issues.
* @param fobj The FO for which this value is needed.
- * @param isOuterEdge Indicates whether the direction sought is on the
- * outer edge of the area.
* @return The value of this property.
*/
- public int getValue(final FoContext context,
- final FObj fobj, final boolean isOuterEdge) {
+ public int getValue(final FoContext context, final FObj fobj) {
if (value().canEvalKeyword()) {
- return getKeywordValue(context, fobj, isOuterEdge);
+ return getKeywordValue(context, fobj);
}
if (value().canEvalLength()) {
final int length = this.convertValueToLength(value(), fobj,
@@ -128,7 +125,7 @@
* then the padding should be zero.
*/
if (condition == FoValue.DISCARD) {
- if (! isOuterEdge) {
+ if (! isOuterEdge(context, fobj)) {
return 0;
}
}
@@ -155,12 +152,9 @@
* is a keyword.
* @param context An object that knows how to resolve FO context issues.
* @param fobj The FO for which this value is needed.
- * @param isOuterEdge Indicates whether the direction sought is on the
- * outer edge of the area.
* @return The value of this property.
*/
- private int getKeywordValue(final FoContext context,
- final FObj fobj, final boolean isOuterEdge) {
+ private int getKeywordValue(final FoContext context, final FObj fobj) {
final FoPropertyKeyword kw = (FoPropertyKeyword) value();
final FObj effectiveParent = fobj.effectiveParent(context);
switch (kw.getValue()) {
@@ -168,16 +162,16 @@
final RelativeCompass direction = this.getRelativeCompass(context,
fobj);
if (direction == RelativeCompass.BEFORE) {
- return effectiveParent.traitPaddingBefore(context, isOuterEdge);
+ return effectiveParent.traitPaddingBefore(context);
}
if (direction == RelativeCompass.AFTER) {
- return effectiveParent.traitPaddingAfter(context, isOuterEdge);
+ return effectiveParent.traitPaddingAfter(context);
}
if (direction == RelativeCompass.START) {
- return effectiveParent.traitPaddingStart(context, isOuterEdge);
+ return effectiveParent.traitPaddingStart(context);
}
if (direction == RelativeCompass.END) {
- return effectiveParent.traitPaddingEnd(context, isOuterEdge);
+ return effectiveParent.traitPaddingEnd(context);
}
}
}
@@ -239,4 +233,30 @@
return value;
}
+ /**
+ * Indicates whether the context is on the outer edge of its parent
+ * reference area.
+ * @param context An object that knows how to resolve FO context issues.
+ * @param fobj The FO for which this property exists.
+ * @return True iff the context is on the outer edge of its parent reference
+ * area.
+ */
+ protected boolean isOuterEdge(final FoContext context, final FObj fobj) {
+ final RelativeCompass direction = this.getRelativeCompass(context,
+ fobj);
+ switch (direction) {
+ case BEFORE:
+ case START: {
+ return context.isFirst();
+ }
+ case AFTER:
+ case END: {
+ return context.isLast();
+ }
+ default: {
+ throw new NullPointerException("RelativeCompass cannot be null");
+ }
+ }
+ }
+
}
Modified: trunk/foray/foray-fotree/src/javatest/org/foray/fotree/fo/prop/AbstractTestPadding.java
===================================================================
--- trunk/foray/foray-fotree/src/javatest/org/foray/fotree/fo/prop/AbstractTestPadding.java 2007-07-05 21:22:34 UTC (rev 9927)
+++ trunk/foray/foray-fotree/src/javatest/org/foray/fotree/fo/prop/AbstractTestPadding.java 2007-07-05 21:36:16 UTC (rev 9928)
@@ -52,8 +52,7 @@
*/
private int getPropertyValue(final AbstractPadding property,
final FObj testFobj) {
- final int testLength = property.getValue(STD_FO_CONTEXT, testFobj,
- false);
+ final int testLength = property.getValue(STD_FO_CONTEXT, testFobj);
return testLength;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-05 22:20:48
|
Revision: 9929
http://svn.sourceforge.net/foray/?rev=9929&view=rev
Author: victormote
Date: 2007-07-05 15:20:37 -0700 (Thu, 05 Jul 2007)
Log Message:
-----------
Conform to axsl change removing unnecessary method.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/Area.java
trunk/foray/foray-render/src/java/org/foray/render/svg/SVGRenderer.java
trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/Area.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2007-07-05 21:36:16 UTC (rev 9928)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2007-07-05 22:20:37 UTC (rev 9929)
@@ -1262,7 +1262,14 @@
public abstract int pdAvailable();
/**
- * {@inheritDoc}
+ * <p>Returns the actual total value, in millipoints, of the size of this
+ * area (not counting space-before, etc.) in its progression direction.
+ * This value does <em>not</em> include space-before, etc., but
+ * <em>does</em> include borders and padding.
+ * For block areas, the progression dimension is the
+ * block-progression-dimension.
+ * For inline areas, it is the inline-progression-dimension.</p>
+ * @return The progressionDimension.
*/
public abstract int getProgressionDimension();
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-07-05 21:36:16 UTC (rev 9928)
+++ trunk/foray/foray-render/src/java/org/foray/render/svg/SVGRenderer.java 2007-07-05 22:20:37 UTC (rev 9929)
@@ -544,7 +544,7 @@
public void render(final LeaderArea area) {
final int rx = area.crOriginX();
final int ry = area.crOriginY();
- final int w = area.getProgressionDimension();
+ final int w = area.crIpd();
final int th = area.traitRuleThickness();
addRect(rx, ry, w, th, false);
}
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-07-05 21:36:16 UTC (rev 9928)
+++ trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java 2007-07-05 22:20:37 UTC (rev 9929)
@@ -234,11 +234,11 @@
public void render(final BlockContainerArea area) {
final StringBuilder buffer = new StringBuilder();
outputGeneratedBy(area, buffer);
- outputDimension(area, buffer);
writeStartTag(area, buffer);
outputAllRectangles(area);
renderChildren(area);
writeEndTag(area);
+ this.outputContentRectangle(area);
}
/**
@@ -315,11 +315,11 @@
public void render(final NormalBlockArea area) {
final StringBuilder buffer = new StringBuilder();
outputGeneratedBy(area, buffer);
- outputDimension(area, buffer);
writeStartTag(area, buffer);
outputAllRectangles(area);
renderChildren(area);
writeEndTag(area);
+ this.outputContentRectangle(area);
}
/**
@@ -340,11 +340,11 @@
public void render(final ForeignObjectArea area) {
final StringBuilder buffer = new StringBuilder();
outputGeneratedBy(area, buffer);
- outputDimension(area, buffer);
writeStartTag(area, buffer);
outputAllRectangles(area);
renderChildren(area);
writeEndTag(area);
+ this.outputContentRectangle(area);
}
/**
@@ -353,10 +353,10 @@
public void render(final SvgArea area) {
final StringBuilder buffer = new StringBuilder();
outputGeneratedBy(area, buffer);
- outputDimension(area, buffer);
writeStartTag(area, buffer);
outputAllRectangles(area);
writeEndTag(area);
+ this.outputContentRectangle(area);
}
/**
@@ -365,12 +365,12 @@
public void render(final ExternalGraphicArea area) {
final StringBuilder attributes = new StringBuilder();
outputGeneratedBy(area, attributes);
- outputDimension(area, attributes);
outputAttribute(attributes, "url",
area.getGraphic().getUrl().toExternalForm());
writeStartTag(area, attributes);
outputAllRectangles(area);
writeEndTag(area);
+ this.outputContentRectangle(area);
}
/**
@@ -390,7 +390,6 @@
}
final StringBuilder buffer = new StringBuilder();
outputGeneratedBy(area, buffer);
- outputDimension(area, buffer);
outputFontTraits(area, buffer);
writeStartTag(area, buffer);
/* Line areas have no border or padding, so write only the content
@@ -399,6 +398,7 @@
outputContentRectangle(area);
renderChildren(area);
writeEndTag(area);
+ this.outputContentRectangle(area);
}
/**
@@ -419,11 +419,9 @@
outputGeneratedBy(area, buffer);
outputAttribute(buffer, "leader-pattern",
area.traitLeaderPattern().toString());
- outputAttribute(buffer, "leader-length",
- area.getProgressionDimension());
+ outputAttribute(buffer, "leader-length", area.crIpd());
outputAttribute(buffer, "rule-thickness", area.traitRuleThickness());
- outputAttribute(buffer, "rule-style",
- area.traitRuleStyle().toString());
+ outputAttribute(buffer, "rule-style", area.traitRuleStyle().toString());
outputColor(area, buffer);
writeStartTag(area, buffer);
outputAllRectangles(area);
@@ -436,7 +434,6 @@
public void render(final TextArea area) {
final StringBuilder buffer = new StringBuilder();
outputGeneratedBy(area, buffer);
- outputDimension(area, buffer);
writeStartTag(area, buffer);
outputAllRectangles(area);
final char[] rawText = area.getText();
@@ -444,6 +441,7 @@
final String content = new String(cookedText);
renderContent(content);
writeEndTag(area);
+ this.outputContentRectangle(area);
}
/**
@@ -463,11 +461,11 @@
public void render(final PageNumberCitationArea area) {
final StringBuilder buffer = new StringBuilder();
outputGeneratedBy(area, buffer);
- outputDimension(area, buffer);
writeStartTag(area, buffer);
outputAllRectangles(area);
renderContent(area.resolve());
writeEndTag(area);
+ this.outputContentRectangle(area);
}
/**
@@ -476,11 +474,11 @@
public void render(final InlineArea area) {
final StringBuilder buffer = new StringBuilder();
outputGeneratedBy(area, buffer);
- outputDimension(area, buffer);
writeStartTag(area, buffer);
outputAllRectangles(area);
renderChildren(area);
writeEndTag(area);
+ this.outputContentRectangle(area);
}
/**
@@ -489,11 +487,11 @@
public void render(final TableArea area) {
final StringBuilder buffer = new StringBuilder();
outputGeneratedBy(area, buffer);
- outputDimension(area, buffer);
writeStartTag(area, buffer);
outputAllRectangles(area);
renderChildren(area);
writeEndTag(area);
+ this.outputContentRectangle(area);
}
/**
@@ -502,11 +500,11 @@
public void render(final TableCellArea area) {
final StringBuilder buffer = new StringBuilder();
outputGeneratedBy(area, buffer);
- outputDimension(area, buffer);
writeStartTag(area, buffer);
outputAllRectangles(area);
renderChildren(area);
writeEndTag(area);
+ this.outputContentRectangle(area);
}
/**
@@ -524,11 +522,11 @@
public void render(final Area area) {
final StringBuilder buffer = new StringBuilder();
outputGeneratedBy(area, buffer);
- outputDimension(area, buffer);
writeStartTag(area, buffer);
outputAllRectangles(area);
renderChildren(area);
writeEndTag(area);
+ this.outputContentRectangle(area);
}
/**
@@ -686,24 +684,11 @@
}
/**
- * Writes information about an area's progression dimension to a given
- * buffer.
- * @param area The area whose progress dimension information should be
- * written.
- * @param buffer The buffer to which the attributes should be added.
- */
- public void outputDimension(final Area area,
- final StringBuilder buffer) {
- outputAttribute(buffer, "dim", area.getProgressionDimension());
- }
-
- /**
* Writes information about an area's color to a given buffer.
* @param area The area whose color information should be written.
* @param buffer The buffer to which the attributes should be added.
*/
- public void outputColor(final Area area,
- final StringBuilder buffer) {
+ public void outputColor(final Area area, final StringBuilder buffer) {
final String color = colorToFloat(area.traitColor().getRed())
+ ", "
+ colorToFloat(area.traitColor().getGreen())
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-05 22:45:39
|
Revision: 9930
http://svn.sourceforge.net/foray/?rev=9930&view=rev
Author: victormote
Date: 2007-07-05 15:45:41 -0700 (Thu, 05 Jul 2007)
Log Message:
-----------
Conform to axsl change removing unnecessary methods.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/Area.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-07-05 22:20:37 UTC (rev 9929)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2007-07-05 22:45:41 UTC (rev 9930)
@@ -1812,20 +1812,6 @@
/**
* {@inheritDoc}
*/
- public Font.Weight traitFontWeight() {
- return traitGeneratedBy().traitFontWeight(this);
- }
-
- /**
- * {@inheritDoc}
- */
- public Font.Style traitFontStyle() {
- return traitGeneratedBy().traitFontStyle(this);
- }
-
- /**
- * {@inheritDoc}
- */
@Override
public Area nearestArea() {
/* Overrides the AreaNode implementation, because this is the nearest
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-07-05 22:20:37 UTC (rev 9929)
+++ trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java 2007-07-05 22:45:41 UTC (rev 9930)
@@ -390,7 +390,6 @@
}
final StringBuilder buffer = new StringBuilder();
outputGeneratedBy(area, buffer);
- outputFontTraits(area, buffer);
writeStartTag(area, buffer);
/* Line areas have no border or padding, so write only the content
* rectangle.
@@ -698,16 +697,6 @@
}
/**
- * Writes information about an area's font traits to a given buffer.
- * @param area The area whose font traits should be written.
- * @param buffer The buffer to which the attributes should be added.
- */
- public void outputFontTraits(final Area area, final StringBuilder buffer) {
- outputAttribute(buffer, "font-weight",
- area.traitFontWeight().toString());
- }
-
- /**
* Writes information about a specific attribute to a given buffer.
* @param buffer The buffer to which the attribute should be added.
* @param attributeName The name of the attribute.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-05 22:53:07
|
Revision: 9931
http://svn.sourceforge.net/foray/?rev=9931&view=rev
Author: victormote
Date: 2007-07-05 15:53:09 -0700 (Thu, 05 Jul 2007)
Log Message:
-----------
Conform to axsl change moving method from Area to GeneralInlineArea.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/AbstractInlineArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/Area.java
trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AbstractInlineArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/AbstractInlineArea.java 2007-07-05 22:45:41 UTC (rev 9930)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/AbstractInlineArea.java 2007-07-05 22:53:09 UTC (rev 9931)
@@ -32,6 +32,8 @@
import org.axsl.common.value.RelativeAxis;
import org.axsl.galley.GeneralInlineArea;
+import java.awt.Color;
+
/**
* Common superclass for all areas generated by inline formatting objects.
* This should not be confused with the more specific class {@link InlineArea}
@@ -204,4 +206,11 @@
return false;
}
+ /**
+ * {@inheritDoc}
+ */
+ public Color traitColor() {
+ return traitGeneratedBy().traitColor(this);
+ }
+
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/Area.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2007-07-05 22:45:41 UTC (rev 9930)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2007-07-05 22:53:09 UTC (rev 9931)
@@ -1805,13 +1805,6 @@
/**
* {@inheritDoc}
*/
- public Color traitColor() {
- return traitGeneratedBy().traitColor(this);
- }
-
- /**
- * {@inheritDoc}
- */
@Override
public Area nearestArea() {
/* Overrides the AreaNode implementation, because this is the nearest
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-07-05 22:45:41 UTC (rev 9930)
+++ trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java 2007-07-05 22:53:09 UTC (rev 9931)
@@ -687,7 +687,8 @@
* @param area The area whose color information should be written.
* @param buffer The buffer to which the attributes should be added.
*/
- public void outputColor(final Area area, final StringBuilder buffer) {
+ public void outputColor(final GeneralInlineArea area,
+ final StringBuilder buffer) {
final String color = colorToFloat(area.traitColor().getRed())
+ ", "
+ colorToFloat(area.traitColor().getGreen())
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-05 23:02:38
|
Revision: 9932
http://svn.sourceforge.net/foray/?rev=9932&view=rev
Author: victormote
Date: 2007-07-05 16:02:40 -0700 (Thu, 05 Jul 2007)
Log Message:
-----------
Conform to axsl change renaming interface.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java
trunk/foray/foray-core/src/java/org/foray/core/FOrayTarget.java
trunk/foray/foray-render/src/java/org/foray/render/Renderer.java
trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java 2007-07-05 22:53:09 UTC (rev 9931)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java 2007-07-05 23:02:40 UTC (rev 9932)
@@ -50,7 +50,7 @@
/**
* The root of the AreaTree.
*/
-public final class AreaTree extends NonArea implements org.axsl.galley.AreaTree,
+public final class AreaTree extends NonArea implements org.axsl.galley.Galley,
org.axsl.area.AreaTree {
/** The initial size at which the linkage map should be created. */
Modified: trunk/foray/foray-core/src/java/org/foray/core/FOrayTarget.java
===================================================================
--- trunk/foray/foray-core/src/java/org/foray/core/FOrayTarget.java 2007-07-05 22:53:09 UTC (rev 9931)
+++ trunk/foray/foray-core/src/java/org/foray/core/FOrayTarget.java 2007-07-05 23:02:40 UTC (rev 9932)
@@ -250,7 +250,7 @@
getLogger().info("Starting layout of page-sequence "
+ pageSequenceCount + ".");
final Renderer renderer = (Renderer) this.outputTarget;
- final org.axsl.galley.AreaTree areaTreeR = getRenderedAreaTree();
+ final org.axsl.galley.Galley areaTreeR = getRenderedAreaTree();
renderer.setAreaTree(areaTreeR);
final org.axsl.area.PageCollection pageCollection;
try {
@@ -285,13 +285,13 @@
* @return The readable area tree.
* @throws FOrayException If the area tree for this target is not readable.
*/
- private org.axsl.galley.AreaTree getRenderedAreaTree()
+ private org.axsl.galley.Galley getRenderedAreaTree()
throws FOrayException {
final org.axsl.area.AreaTree areaTreeW = getCreatedAreaTree();
- if (! (areaTreeW instanceof org.axsl.galley.AreaTree)) {
+ if (! (areaTreeW instanceof org.axsl.galley.Galley)) {
throw new FOrayException("Area Tree cannot be rendered.");
}
- return (org.axsl.galley.AreaTree) areaTreeW;
+ return (org.axsl.galley.Galley) areaTreeW;
}
/**
Modified: trunk/foray/foray-render/src/java/org/foray/render/Renderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/Renderer.java 2007-07-05 22:53:09 UTC (rev 9931)
+++ trunk/foray/foray-render/src/java/org/foray/render/Renderer.java 2007-07-05 23:02:40 UTC (rev 9932)
@@ -41,7 +41,7 @@
import org.axsl.common.value.RuleStyle;
import org.axsl.galley.Area;
import org.axsl.galley.AreaNode;
-import org.axsl.galley.AreaTree;
+import org.axsl.galley.Galley;
import org.axsl.galley.BackgroundArea;
import org.axsl.galley.BeforeFloatArea;
import org.axsl.galley.BlockContainerArea;
@@ -97,7 +97,7 @@
protected static final float SHADING_WEIGHT_BLUE = 0.11f;
/** The AreaTree being rendered. */
- private AreaTree areaTree;
+ private Galley areaTree;
/**
* Constructor.
@@ -112,7 +112,7 @@
* Sets the AreaTree to be rendered.
* @param areaTree The AreaTree to be rendered.
*/
- public void setAreaTree(final AreaTree areaTree) {
+ public void setAreaTree(final Galley areaTree) {
this.areaTree = areaTree;
}
@@ -648,7 +648,7 @@
* Returns the area tree being rendered.
* @return The area tree being rendered.
*/
- protected AreaTree getAreaTree() {
+ protected Galley getAreaTree() {
return this.areaTree;
}
Modified: trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2007-07-05 22:53:09 UTC (rev 9931)
+++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2007-07-05 23:02:40 UTC (rev 9932)
@@ -43,7 +43,7 @@
import org.axsl.font.FontUse;
import org.axsl.galley.Area;
import org.axsl.galley.AreaNode;
-import org.axsl.galley.AreaTree;
+import org.axsl.galley.Galley;
import org.axsl.galley.BookmarkArea;
import org.axsl.galley.BookmarkTitleArea;
import org.axsl.galley.BookmarkTreeArea;
@@ -582,7 +582,7 @@
* Add the document metadata to the PDF.
*/
private void renderDocumentMetadata() {
- final AreaTree areaTree = this.getAreaTree();
+ final Galley areaTree = this.getAreaTree();
this.pdfDoc.setTitle(areaTree.getTitle());
this.pdfDoc.setAuthor(areaTree.getAuthor());
this.pdfDoc.setSubject(areaTree.getSubject());
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-05 23:11:12
|
Revision: 9933
http://svn.sourceforge.net/foray/?rev=9933&view=rev
Author: victormote
Date: 2007-07-05 16:11:15 -0700 (Thu, 05 Jul 2007)
Log Message:
-----------
Conform to axsl changes renaming exception classes.
Modified Paths:
--------------
trunk/foray/foray-app/src/javatest/org/foray/app/area/AreaTreeCreator.java
trunk/foray/foray-areatree/src/java/org/foray/area/AbstractInlineArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/AbstractListItemContent.java
trunk/foray/foray-areatree/src/java/org/foray/area/AbstractTablePartContainer.java
trunk/foray/foray-areatree/src/java/org/foray/area/Area.java
trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java
trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java
trunk/foray/foray-areatree/src/java/org/foray/area/BeforeFloatRA.java
trunk/foray/foray-areatree/src/java/org/foray/area/BlockContainerRA.java
trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkTitleArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkTreeArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/FOLinkageMarker.java
trunk/foray/foray-areatree/src/java/org/foray/area/FootnoteRA.java
trunk/foray/foray-areatree/src/java/org/foray/area/InlineArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/ListBlockArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/ListItemArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/MainRA.java
trunk/foray/foray-areatree/src/java/org/foray/area/NormalBlockArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/NormalFlowRA.java
trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java
trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java
trunk/foray/foray-areatree/src/java/org/foray/area/RegionRA.java
trunk/foray/foray-areatree/src/java/org/foray/area/RegionRABody.java
trunk/foray/foray-areatree/src/java/org/foray/area/SVGArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/SpanRA.java
trunk/foray/foray-areatree/src/java/org/foray/area/TableBodyContainer.java
trunk/foray/foray-areatree/src/java/org/foray/area/TableCellRA.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-core/src/java/org/foray/core/FOrayTarget.java
trunk/foray/foray-layout/src/java/org/foray/layout/LayoutStrategy.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/AbstractTablePartPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/BasicLinkPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/BlockContainerPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/BlockPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/CharacterPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/ContinuedLabelPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/ExternalGraphicPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FONodePL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FOTextPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FObjPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FlowPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FootnoteBodyPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/FootnotePL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/InlinePL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/InstreamForeignObjectPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/LeaderPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/ListBlockPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/ListItemBodyPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/ListItemLabelPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/ListItemPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/NoLayoutPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PageNumberCitationPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PageNumberPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/RetrieveMarkerPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/StaticContentPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableCellPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TablePL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableRowPL.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/WrapperPL.java
Modified: trunk/foray/foray-app/src/javatest/org/foray/app/area/AreaTreeCreator.java
===================================================================
--- trunk/foray/foray-app/src/javatest/org/foray/app/area/AreaTreeCreator.java 2007-07-05 23:02:40 UTC (rev 9932)
+++ trunk/foray/foray-app/src/javatest/org/foray/app/area/AreaTreeCreator.java 2007-07-05 23:11:15 UTC (rev 9933)
@@ -41,7 +41,7 @@
import org.foray.pioneer.PioneerFactory;
import org.foray.pioneer.PioneerLS;
-import org.axsl.area.WritableAreaException;
+import org.axsl.area.AreaTreeException;
import java.io.IOException;
@@ -111,7 +111,7 @@
final PageCollection collection = areaTree.makePageCollection(
pageSequence);
layout.formatPageSequence(collection);
- } catch (final WritableAreaException e) {
+ } catch (final AreaTreeException e) {
throw new FOrayException(e);
}
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AbstractInlineArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/AbstractInlineArea.java 2007-07-05 23:02:40 UTC (rev 9932)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/AbstractInlineArea.java 2007-07-05 23:11:15 UTC (rev 9933)
@@ -28,7 +28,7 @@
package org.foray.area;
-import org.axsl.area.WritableAreaException;
+import org.axsl.area.AreaTreeException;
import org.axsl.common.value.RelativeAxis;
import org.axsl.galley.GeneralInlineArea;
@@ -84,7 +84,7 @@
* {@inheritDoc}
*/
public Area getOverflowArea(final Area childRequesting)
- throws WritableAreaException {
+ throws AreaTreeException {
return ancestorArea().getOverflowArea(this);
}
@@ -167,11 +167,11 @@
/**
* {@inheritDoc}
*/
- public void setParent(final AreaNode node) throws WritableAreaException {
+ public void setParent(final AreaNode node) throws AreaTreeException {
if (node instanceof LineArea) {
this.parent = (LineArea) node;
} else {
- throw new WritableAreaException("Parent of AbstractInlineArea must "
+ throw new AreaTreeException("Parent of AbstractInlineArea must "
+ "be a LineArea");
}
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AbstractListItemContent.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/AbstractListItemContent.java 2007-07-05 23:02:40 UTC (rev 9932)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/AbstractListItemContent.java 2007-07-05 23:11:15 UTC (rev 9933)
@@ -29,7 +29,7 @@
package org.foray.area;
import org.axsl.area.BlockContentFactory;
-import org.axsl.area.WritableAreaException;
+import org.axsl.area.AreaTreeException;
import org.axsl.fo.fo.Block;
import org.axsl.fo.fo.BlockContainer;
import org.axsl.fo.fo.GraftingPoint;
@@ -81,11 +81,11 @@
/**
* {@inheritDoc}
*/
- public void setParent(final AreaNode node) throws WritableAreaException {
+ public void setParent(final AreaNode node) throws AreaTreeException {
if (node instanceof ListItemArea) {
this.parent = (ListItemArea) node;
} else {
- throw new WritableAreaException("Parent of "
+ throw new AreaTreeException("Parent of "
+ this.getClass().getName()
+ "must be a " + ListItemArea.class.getName());
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AbstractTablePartContainer.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/AbstractTablePartContainer.java 2007-07-05 23:02:40 UTC (rev 9932)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/AbstractTablePartContainer.java 2007-07-05 23:11:15 UTC (rev 9933)
@@ -28,7 +28,7 @@
package org.foray.area;
-import org.axsl.area.WritableAreaException;
+import org.axsl.area.AreaTreeException;
import org.axsl.common.value.RelativeAxis;
import org.axsl.fo.fo.GraftingPoint;
import org.axsl.fo.fo.TableRow;
@@ -100,11 +100,11 @@
/**
* {@inheritDoc}
*/
- public void setParent(final AreaNode node) throws WritableAreaException {
+ public void setParent(final AreaNode node) throws AreaTreeException {
if (node instanceof TableRA) {
this.parent = (TableRA) node;
} else {
- throw new WritableAreaException("Parent of " + this.getAreaName()
+ throw new AreaTreeException("Parent of " + this.getAreaName()
+ " must be a Table");
}
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/Area.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2007-07-05 23:02:40 UTC (rev 9932)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2007-07-05 23:11:15 UTC (rev 9933)
@@ -31,7 +31,7 @@
import org.foray.common.WKConstants;
import org.axsl.area.BlockContainerRefArea;
-import org.axsl.area.WritableAreaException;
+import org.axsl.area.AreaTreeException;
import org.axsl.common.value.AbsoluteAxis;
import org.axsl.common.value.AbsoluteDirection;
import org.axsl.common.value.AbsolutePosition;
@@ -1309,11 +1309,11 @@
* @param childRequesting Child Areas ask
* @return The younger sister Area that should be used to handle the
* overflow condition.
- * @throws WritableAreaException If the Area is unable to find or create the
+ * @throws AreaTreeException If the Area is unable to find or create the
* overflow area.
*/
public abstract Area getOverflowArea(Area childRequesting)
- throws WritableAreaException;
+ throws AreaTreeException;
/**
* Returns the half-leading minimum trait for this area.
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java 2007-07-05 23:02:40 UTC (rev 9932)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java 2007-07-05 23:11:15 UTC (rev 9933)
@@ -31,7 +31,7 @@
import org.foray.common.AbstractOrderedTreeNode;
import org.foray.common.OrderedTreeNode;
-import org.axsl.area.WritableAreaException;
+import org.axsl.area.AreaTreeException;
import org.axsl.fo.Fo;
import org.axsl.fo.FoNode;
import org.axsl.fo.fo.GraftingPoint;
@@ -82,11 +82,11 @@
/**
* Sets the parent node.
* @param node The new parent node.
- * @throws WritableAreaException If the parent node is not compatible with
+ * @throws AreaTreeException If the parent node is not compatible with
* the implementations specification for a parent node.
*/
public abstract void setParent(final AreaNode node)
- throws WritableAreaException;
+ throws AreaTreeException;
/**
* {@inheritDoc}
@@ -157,7 +157,7 @@
foNode);
markerLinkage.getNormalLinkage(graftingPoint);
linkage = markerLinkage;
- } catch (final WritableAreaException e) {
+ } catch (final AreaTreeException e) {
/* Ignore this. It should never happen as we have already tested
* for the condition that causes the exception, i.e. that foNode
* has no ancestor marker. */
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java 2007-07-05 23:02:40 UTC (rev 9932)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java 2007-07-05 23:11:15 UTC (rev 9933)
@@ -30,7 +30,7 @@
import org.axsl.area.AreaTreeEvent;
import org.axsl.area.AreaTreeListener;
-import org.axsl.area.WritableAreaException;
+import org.axsl.area.AreaTreeException;
import org.axsl.fo.Fo;
import org.axsl.fo.FoNode;
import org.axsl.fo.fo.Bookmark;
@@ -145,7 +145,7 @@
* {@inheritDoc}
*/
public PageCollection makePageCollection(
- final PageSequence pageSequence) throws WritableAreaException {
+ final PageSequence pageSequence) throws AreaTreeException {
final int lastPageNumber;
final int collectionsProcessed = this.pageCollectionsProcessed.size();
if (collectionsProcessed > 0) {
@@ -370,8 +370,8 @@
/**
* {@inheritDoc}
*/
- public void setParent(final AreaNode node) throws WritableAreaException {
- throw new WritableAreaException("The AreaTree has no parent.");
+ public void setParent(final AreaNode node) throws AreaTreeException {
+ throw new AreaTreeException("The AreaTree has no parent.");
}
/**
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/BeforeFloatRA.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/BeforeFloatRA.java 2007-07-05 23:02:40 UTC (rev 9932)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/BeforeFloatRA.java 2007-07-05 23:11:15 UTC (rev 9933)
@@ -28,7 +28,7 @@
package org.foray.area;
-import org.axsl.area.WritableAreaException;
+import org.axsl.area.AreaTreeException;
import org.axsl.common.value.RelativeAxis;
import org.axsl.fo.Fo;
import org.axsl.galley.RenderVisitor;
@@ -110,7 +110,7 @@
* {@inheritDoc}
*/
public Area getOverflowArea(final Area childRequesting)
- throws WritableAreaException {
+ throws AreaTreeException {
return ancestorArea().getOverflowArea(this);
}
@@ -168,7 +168,7 @@
/**
* {@inheritDoc}
*/
- public void setParent(final AreaNode node) throws WritableAreaException {
+ public void setParent(final AreaNode node) throws AreaTreeException {
this.parent = node;
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/BlockContainerRA.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/BlockContainerRA.java 2007-07-05 23:02:40 UTC (rev 9932)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/BlockContainerRA.java 2007-07-05 23:11:15 UTC (rev 9933)
@@ -28,7 +28,7 @@
package org.foray.area;
-import org.axsl.area.WritableAreaException;
+import org.axsl.area.AreaTreeException;
import org.axsl.common.value.AbsolutePosition;
import org.axsl.common.value.RelativeAxis;
import org.axsl.fo.Fo;
@@ -176,7 +176,7 @@
/**
* {@inheritDoc}
*/
- public void setParent(final AreaNode node) throws WritableAreaException {
+ public void setParent(final AreaNode node) throws AreaTreeException {
this.parent = node;
}
@@ -191,7 +191,7 @@
* {@inheritDoc}
*/
public Area getOverflowArea(final Area childRequesting)
- throws WritableAreaException {
+ throws AreaTreeException {
return ancestorArea().getOverflowArea(this);
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkArea.java 2007-07-05 23:02:40 UTC (rev 9932)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkArea.java 2007-07-05 23:11:15 UTC (rev 9933)
@@ -28,7 +28,7 @@
package org.foray.area;
-import org.axsl.area.WritableAreaException;
+import org.axsl.area.AreaTreeException;
import org.axsl.fo.Fo;
import org.axsl.fo.fo.Bookmark;
import org.axsl.fo.fo.BookmarkTitle;
@@ -122,8 +122,8 @@
/**
* {@inheritDoc}
*/
- public void setParent(final AreaNode node) throws WritableAreaException {
- throw new WritableAreaException("BookmarkArea should never need to be "
+ public void setParent(final AreaNode node) throws AreaTreeException {
+ throw new AreaTreeException("BookmarkArea should never need to be "
+ "reparented.");
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkTitleArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkTitleArea.java 2007-07-05 23:02:40 UTC (rev 9932)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkTitleArea.java 2007-07-05 23:11:15 UTC (rev 9933)
@@ -28,7 +28,7 @@
package org.foray.area;
-import org.axsl.area.WritableAreaException;
+import org.axsl.area.AreaTreeException;
import org.axsl.fo.fo.BookmarkTitle;
import org.axsl.font.Font;
import org.axsl.galley.RenderVisitor;
@@ -106,11 +106,11 @@
/**
* {@inheritDoc}
*/
- public void setParent(final AreaNode node) throws WritableAreaException {
+ public void setParent(final AreaNode node) throws AreaTreeException {
if (node instanceof BookmarkArea) {
this.parent = (BookmarkArea) node;
} else {
- throw new WritableAreaException("Parent of BookmarkTitleArea must "
+ throw new AreaTreeException("Parent of BookmarkTitleArea must "
+ "be BookmarkArea");
}
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkTreeArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkTreeArea.java 2007-07-05 23:02:40 UTC (rev 9932)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkTreeArea.java 2007-07-05 23:11:15 UTC (rev 9933)
@@ -28,7 +28,7 @@
package org.foray.area;
-import org.axsl.area.WritableAreaException;
+import org.axsl.area.AreaTreeException;
import org.axsl.fo.fo.BookmarkTree;
import org.axsl.galley.RenderVisitor;
@@ -98,8 +98,8 @@
/**
* {@inheritDoc}
*/
- public void setParent(final AreaNode node) throws WritableAreaException {
- throw new WritableAreaException("BookmarkAreaTree should never need to "
+ public void setParent(final AreaNode node) throws AreaTreeException {
+ throw new AreaTreeException("BookmarkAreaTree should never need to "
+ "be reparented.");
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/FOLinkageMarker.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/FOLinkageMarker.java 2007-07-05 23:02:40 UTC (rev 9932)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/FOLinkageMarker.java 2007-07-05 23:11:15 UTC (rev 9933)
@@ -29,7 +29,7 @@
package org.foray.area;
import org.axsl.area.PageArea;
-import org.axsl.area.WritableAreaException;
+import org.axsl.area.AreaTreeException;
import org.axsl.fo.FoNode;
import org.axsl.fo.fo.GraftingPoint;
import org.axsl.fo.fo.Marker;
@@ -83,15 +83,15 @@
/**
* Constructor.
* @param foGenerator The FO node generating this linkage.
- * @throws WritableAreaException If the <code>foGenerator</code> has no
+ * @throws AreaTreeException If the <code>foGenerator</code> has no
* ancestor marker.
*/
public FOLinkageMarker(final FoNode foGenerator)
- throws WritableAreaException {
+ throws AreaTreeException {
super(foGenerator);
final Marker marker = foGenerator.ancestorMarker();
if (marker == null) {
- throw new WritableAreaException("(FOray) FOLinkageMarker "
+ throw new AreaTreeException("(FOray) FOLinkageMarker "
+ "construction attempted for object\n"
+ " not descended from an fo:marker:\n"
+ foGenerator.getContextMessage());
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/FootnoteRA.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/FootnoteRA.java 2007-07-05 23:02:40 UTC (rev 9932)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/FootnoteRA.java 2007-07-05 23:11:15 UTC (rev 9933)
@@ -28,7 +28,7 @@
package org.foray.area;
-import org.axsl.area.WritableAreaException;
+import org.axsl.area.AreaTreeException;
import org.axsl.common.value.RelativeAxis;
import org.axsl.fo.Fo;
import org.axsl.galley.RenderVisitor;
@@ -111,7 +111,7 @@
* {@inheritDoc}
*/
public Area getOverflowArea(final Area childRequesting)
- throws WritableAreaException {
+ throws AreaTreeException {
return ancestorArea().getOverflowArea(this);
}
@@ -179,7 +179,7 @@
/**
* {@inheritDoc}
*/
- public void setParent(final AreaNode node) throws WritableAreaException {
+ public void setParent(final AreaNode node) throws AreaTreeException {
this.parent = node;
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/InlineArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/InlineArea.java 2007-07-05 23:02:40 UTC (rev 9932)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/InlineArea.java 2007-07-05 23:11:15 UTC (rev 9933)
@@ -28,7 +28,7 @@
package org.foray.area;
-import org.axsl.area.WritableAreaException;
+import org.axsl.area.AreaTreeException;
import org.axsl.fo.FoText;
import org.axsl.fo.fo.ExternalGraphic;
import org.axsl.fo.fo.GraftingPoint;
@@ -153,7 +153,7 @@
*/
public LeaderArea makeLeaderArea(
final Leader leader, final int ipd,
- final GraftingPoint graftingPoint) throws WritableAreaException {
+ final GraftingPoint graftingPoint) throws AreaTreeException {
final LeaderArea newLeaderArea = LeaderArea.makeLeaderArea(leader, this,
graftingPoint, ipd);
this.children.add(newLeaderArea);
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java 2007-07-05 23:02:40 UTC (rev 9932)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java 2007-07-05 23:11:15 UTC (rev 9933)
@@ -28,7 +28,7 @@
package org.foray.area;
-import org.axsl.area.WritableAreaException;
+import org.axsl.area.AreaTreeException;
import org.axsl.common.value.LeaderAlignment;
import org.axsl.common.value.LeaderPattern;
import org.axsl.common.value.RuleStyle;
@@ -105,14 +105,14 @@
* area.
* @param initialProgressionDimension The initial size, in millipoints,
* of this Area.
- * @throws WritableAreaException If the minimum length is greater than the
+ * @throws AreaTreeException If the minimum length is greater than the
* optimum length, or if the optimum length is greater than the maximum
* length.
*/
private static void initLeaderArea(final LeaderArea newLeaderArea,
final Leader generatedBy, final GraftingPoint graftingPoint,
final int initialProgressionDimension)
- throws WritableAreaException {
+ throws AreaTreeException {
newLeaderArea.generatedBy = newLeaderArea.linkage(generatedBy,
graftingPoint);
newLeaderArea.registerWithLinkage(graftingPoint);
@@ -125,12 +125,12 @@
* cannot be resolved entirely there, so we validate it here. */
if (newLeaderArea.traitLeaderLengthMin()
> newLeaderArea.traitLeaderLengthOpt()) {
- throw new WritableAreaException("leader-length.minimum may not "
+ throw new AreaTreeException("leader-length.minimum may not "
+ "exceed leader-length.optimum");
}
if (newLeaderArea.traitLeaderLengthOpt()
> newLeaderArea.traitLeaderLengthMax()) {
- throw new WritableAreaException("leader-length.optimum may not "
+ throw new AreaTreeException("leader-length.optimum may not "
+ "exceed leader-length.maximum");
}
}
@@ -144,7 +144,7 @@
* @param initialProgressionDimension The initial size, in millipoints,
* of this Area.
* @return The new instance.
- * @throws WritableAreaException If the minimum length is greater than the
+ * @throws AreaTreeException If the minimum length is greater than the
* optimum length, or if the optimum length is greater than the maximum
* length.
*/
@@ -152,7 +152,7 @@
final LineArea parentArea,
final GraftingPoint graftingPoint,
final int initialProgressionDimension)
- throws WritableAreaException {
+ throws AreaTreeException {
final LeaderArea newLeaderArea = new LeaderArea(parentArea);
LeaderArea.initLeaderArea(newLeaderArea, generatedBy, graftingPoint,
initialProgressionDimension);
@@ -168,7 +168,7 @@
* @param initialProgressionDimension The initial size, in millipoints,
* of this Area.
* @return The new instance.
- * @throws WritableAreaException If the minimum length is greater than the
+ * @throws AreaTreeException If the minimum length is greater than the
* optimum length, or if the optimum length is greater than the maximum
* length.
*/
@@ -176,7 +176,7 @@
final AbstractInlineArea parentArea,
final GraftingPoint graftingPoint,
final int initialProgressionDimension)
- throws WritableAreaException {
+ throws AreaTreeException {
final LeaderArea newLeaderArea = new LeaderArea(parentArea);
LeaderArea.initLeaderArea(newLeaderArea, generatedBy, graftingPoint,
initialProgressionDimension);
@@ -439,7 +439,7 @@
*/
public LeaderArea makeLeaderArea(
final Leader leader, final int ipd,
- final GraftingPoint graftingPoint) throws WritableAreaException {
+ final GraftingPoint graftingPoint) throws AreaTreeException {
final LeaderArea newLeaderArea = LeaderArea.makeLeaderArea(leader, this,
graftingPoint, ipd);
this.children.add(newLeaderArea);
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2007-07-05 23:02:40 UTC (rev 9932)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2007-07-05 23:11:15 UTC (rev 9933)
@@ -30,7 +30,7 @@
import org.foray.common.OrderedTreeNode;
-import org.axsl.area.WritableAreaException;
+import org.axsl.area.AreaTreeException;
import org.axsl.common.value.AbsoluteAxis;
import org.axsl.common.value.Baseline;
import org.axsl.common.value.Conditionality;
@@ -704,7 +704,7 @@
* {@inheritDoc}
*/
public Area getOverflowArea(final Area childRequesting)
- throws WritableAreaException {
+ throws AreaTreeException {
return ancestorArea().getOverflowArea(this);
}
@@ -1009,7 +1009,7 @@
* {@inheritDoc}
*/
public LeaderArea makeLeaderArea(final Leader leader, final int ipd,
- final GraftingPoint graftingPoint) throws WritableAreaException {
+ final GraftingPoint graftingPoint) throws AreaTreeException {
final LeaderArea newLeaderArea = LeaderArea.makeLeaderArea(leader, this,
graftingPoint, ipd);
this.children.add(newLeaderArea);
@@ -1238,11 +1238,11 @@
/**
* {@inheritDoc}
*/
- public void setParent(final AreaNode node) throws WritableAreaException {
+ public void setParent(final AreaNode node) throws AreaTreeException {
if (node instanceof NormalBlockArea) {
this.parent = (NormalBlockArea) node;
} else {
- throw new WritableAreaException("Parent of LineArea must be a "
+ throw new AreaTreeException("Parent of LineArea must be a "
+ "NormalBlockArea");
}
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/ListBlockArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/ListBlockArea.java 2007-07-05 23:02:40 UTC (rev 9932)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/ListBlockArea.java 2007-07-05 23:11:15 UTC (rev 9933)
@@ -28,7 +28,7 @@
package org.foray.area;
-import org.axsl.area.WritableAreaException;
+import org.axsl.area.AreaTreeException;
import org.axsl.common.value.RelativeAxis;
import org.axsl.fo.fo.GraftingPoint;
import org.axsl.fo.fo.ListBlock;
@@ -150,7 +150,7 @@
/**
* {@inheritDoc}
*/
- public void setParent(final AreaNode node) throws WritableAreaException {
+ public void setParent(final AreaNode n...
[truncated message content] |
|
From: <vic...@us...> - 2007-07-05 23:26:39
|
Revision: 9934
http://svn.sourceforge.net/foray/?rev=9934&view=rev
Author: victormote
Date: 2007-07-05 16:26:41 -0700 (Thu, 05 Jul 2007)
Log Message:
-----------
Conform to axsl change moving method from AreaNode to BookmarkArea.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java
trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkArea.java
trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java 2007-07-05 23:11:15 UTC (rev 9933)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java 2007-07-05 23:26:41 UTC (rev 9934)
@@ -417,13 +417,6 @@
/**
* {@inheritDoc}
*/
- public String traitInternalDestination() {
- return traitGeneratedBy().traitInternalDestination();
- }
-
- /**
- * {@inheritDoc}
- */
public String traitId() {
return traitGeneratedBy().traitId();
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkArea.java 2007-07-05 23:11:15 UTC (rev 9933)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkArea.java 2007-07-05 23:26:41 UTC (rev 9934)
@@ -178,4 +178,11 @@
return (Bookmark) this.getLinkage().getFONode();
}
+ /**
+ * {@inheritDoc}
+ */
+ public String getDestination() {
+ return traitGeneratedBy().traitInternalDestination();
+ }
+
}
Modified: trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2007-07-05 23:11:15 UTC (rev 9933)
+++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2007-07-05 23:26:41 UTC (rev 9934)
@@ -545,7 +545,7 @@
}
PdfOutlineItem pdfOutline = null;
pdfOutline = parent.createPdfOutlineItem(title.getTitleText(),
- area.traitInternalDestination(), color, italic, bold);
+ area.getDestination(), color, italic, bold);
// Recursively handle child bookmarks
for (int i = 0; i < area.getChildCount(); i++) {
final AreaNode child = area.getChildAt(i);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-05 23:45:27
|
Revision: 9935
http://svn.sourceforge.net/foray/?rev=9935&view=rev
Author: victormote
Date: 2007-07-05 16:45:26 -0700 (Thu, 05 Jul 2007)
Log Message:
-----------
Conform to axsl changes removing unnecessary sub-interface.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/RegionRABody.java
trunk/foray/foray-render/src/java/org/foray/render/Renderer.java
trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/RegionRABody.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/RegionRABody.java 2007-07-05 23:26:41 UTC (rev 9934)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/RegionRABody.java 2007-07-05 23:45:26 UTC (rev 9935)
@@ -34,8 +34,7 @@
import org.axsl.common.value.RelativeAxis;
import org.axsl.fo.fo.RegionBody;
import org.axsl.fo.fo.SimplePageMaster;
-import org.axsl.galley.MainReferenceArea;
-import org.axsl.galley.RegionBodyArea;
+import org.axsl.galley.RegionArea;
import org.axsl.galley.RenderVisitor;
import org.axsl.graphic.Graphic;
@@ -45,7 +44,7 @@
/**
* Area containing a region-body.
*/
-public final class RegionRABody extends AreaFixed implements RegionBodyArea,
+public final class RegionRABody extends AreaFixed implements RegionArea,
org.axsl.area.RegionBodyRefArea {
/** The "generated-by" trait, as defined in Section 6.1.1. */
@@ -110,13 +109,6 @@
/**
* {@inheritDoc}
*/
- public MainReferenceArea getMainReferenceArea() {
- return mainReferenceArea;
- }
-
- /**
- * {@inheritDoc}
- */
public MainRA getMainRefArea() {
return mainReferenceArea;
}
Modified: trunk/foray/foray-render/src/java/org/foray/render/Renderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/Renderer.java 2007-07-05 23:26:41 UTC (rev 9934)
+++ trunk/foray/foray-render/src/java/org/foray/render/Renderer.java 2007-07-05 23:45:26 UTC (rev 9935)
@@ -61,7 +61,6 @@
import org.axsl.galley.PageNumberArea;
import org.axsl.galley.PageNumberCitationArea;
import org.axsl.galley.RegionArea;
-import org.axsl.galley.RegionBodyArea;
import org.axsl.galley.SvgArea;
import org.axsl.galley.TableArea;
import org.axsl.galley.TableCellArea;
@@ -406,14 +405,6 @@
/**
* {@inheritDoc}
*/
- public void render(final RegionBodyArea area) {
- markBackground(area);
- renderChildren(area);
- }
-
- /**
- * {@inheritDoc}
- */
public void render(final RegionArea area) {
markBackground(area);
renderChildren(area);
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-07-05 23:26:41 UTC (rev 9934)
+++ trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java 2007-07-05 23:45:26 UTC (rev 9935)
@@ -59,7 +59,6 @@
import org.axsl.galley.PageArea;
import org.axsl.galley.PageNumberCitationArea;
import org.axsl.galley.RegionArea;
-import org.axsl.galley.RegionBodyArea;
import org.axsl.galley.SvgArea;
import org.axsl.galley.TableArea;
import org.axsl.galley.TableCellArea;
@@ -103,7 +102,7 @@
* {@inheritDoc}
*/
public void render(final PageArea page) {
- final RegionBodyArea body = page.getRegionBody();
+ final RegionArea body = page.getRegionBody();
final RegionArea before = page.getRegionBefore();
final RegionArea after = page.getRegionAfter();
final RegionArea start = page.getRegionStart();
@@ -244,18 +243,6 @@
/**
* {@inheritDoc}
*/
- public void render(final RegionBodyArea area) {
- final StringBuilder buffer = new StringBuilder();
- outputGeneratedBy(area, buffer);
- writeStartTag(area, buffer);
- outputAllRectangles(area);
- renderChildren(area);
- writeEndTag(area);
- }
-
- /**
- * {@inheritDoc}
- */
public void render(final MainReferenceArea area) {
final StringBuilder buffer = new StringBuilder();
outputGeneratedBy(area, buffer);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-06 16:56:41
|
Revision: 9936
http://svn.sourceforge.net/foray/?rev=9936&view=rev
Author: victormote
Date: 2007-07-06 09:56:41 -0700 (Fri, 06 Jul 2007)
Log Message:
-----------
Conform to axsl change combining BookmarkTitleArea with BookmarkArea.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkTitleArea.java
trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkArea.java 2007-07-05 23:45:26 UTC (rev 9935)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkArea.java 2007-07-06 16:56:41 UTC (rev 9936)
@@ -32,8 +32,10 @@
import org.axsl.fo.Fo;
import org.axsl.fo.fo.Bookmark;
import org.axsl.fo.fo.BookmarkTitle;
+import org.axsl.font.Font;
import org.axsl.galley.RenderVisitor;
+import java.awt.Color;
import java.util.ArrayList;
import java.util.List;
@@ -185,4 +187,32 @@
return traitGeneratedBy().traitInternalDestination();
}
+ /**
+ * {@inheritDoc}
+ */
+ public String getTitleText() {
+ return this.getBookmarkTitle().getTitleText();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Color traitColor() {
+ return this.getBookmarkTitle().traitGeneratedBy().traitColor(null);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Font.Weight traitFontWeight() {
+ return this.getBookmarkTitle().traitGeneratedBy().traitFontWeight(null);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Font.Style traitFontStyle() {
+ return this.getBookmarkTitle().traitGeneratedBy().traitFontStyle(null);
+ }
+
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkTitleArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkTitleArea.java 2007-07-05 23:45:26 UTC (rev 9935)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkTitleArea.java 2007-07-06 16:56:41 UTC (rev 9936)
@@ -40,8 +40,7 @@
/**
* The AreaTree representation of an fo:bookmark-title object.
*/
-public final class BookmarkTitleArea extends NonArea
- implements org.axsl.galley.BookmarkTitleArea {
+public final class BookmarkTitleArea extends NonArea {
/** The "generated-by" trait, as defined in Section 6.1.1. */
private FOLinkage generatedBy;
@@ -145,21 +144,25 @@
}
/**
- * {@inheritDoc}
+ * Returns the color of this node.
+ * @return The color of this node.
*/
public Color traitColor() {
return traitGeneratedBy().traitColor(null);
}
/**
- * {@inheritDoc}
+ * Returns the relative boldness of the font-family typeface that should be
+ * used.
+ * @return The font weight constant for this area.
*/
public Font.Weight traitFontWeight() {
return traitGeneratedBy().traitFontWeight(null);
}
/**
- * {@inheritDoc}
+ * Returns the font style (normal, italic, etc.) for this area.
+ * @return The font style.
*/
public Font.Style traitFontStyle() {
return traitGeneratedBy().traitFontStyle(null);
Modified: trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2007-07-05 23:45:26 UTC (rev 9935)
+++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2007-07-06 16:56:41 UTC (rev 9936)
@@ -45,7 +45,6 @@
import org.axsl.galley.AreaNode;
import org.axsl.galley.Galley;
import org.axsl.galley.BookmarkArea;
-import org.axsl.galley.BookmarkTitleArea;
import org.axsl.galley.BookmarkTreeArea;
import org.axsl.galley.ForeignObjectArea;
import org.axsl.galley.GeneralInlineArea;
@@ -532,19 +531,18 @@
if (area == null || parent == null) {
return;
}
- final BookmarkTitleArea title = area.getBookmarkTitle();
- final Color color = title.traitColor();
+ final Color color = area.traitColor();
boolean italic = false;
- if (title.traitFontStyle() == Font.Style.ITALIC) {
+ if (area.traitFontStyle() == Font.Style.ITALIC) {
italic = true;
}
boolean bold = false;
- if (title.traitFontWeight().getNumericWeight()
+ if (area.traitFontWeight().getNumericWeight()
>= Font.Weight.BOLD.getNumericWeight()) {
bold = true;
}
PdfOutlineItem pdfOutline = null;
- pdfOutline = parent.createPdfOutlineItem(title.getTitleText(),
+ pdfOutline = parent.createPdfOutlineItem(area.getTitleText(),
area.getDestination(), color, italic, bold);
// Recursively handle child bookmarks
for (int i = 0; i < area.getChildCount(); i++) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-06 17:02:23
|
Revision: 9937
http://svn.sourceforge.net/foray/?rev=9937&view=rev
Author: victormote
Date: 2007-07-06 10:02:15 -0700 (Fri, 06 Jul 2007)
Log Message:
-----------
Conform to axsl changes renaming two interfaces.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkTreeArea.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/BookmarkArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkArea.java 2007-07-06 16:56:41 UTC (rev 9936)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkArea.java 2007-07-06 17:02:15 UTC (rev 9937)
@@ -43,7 +43,7 @@
* The AreaTree representation of an fo:bookmark object.
*/
public final class BookmarkArea extends BookmarkParentArea
- implements org.axsl.galley.BookmarkArea {
+ implements org.axsl.galley.Bookmark {
/** The "generated-by" trait, as defined in Section 6.1.1. */
private FOLinkage generatedBy;
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkTreeArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkTreeArea.java 2007-07-06 16:56:41 UTC (rev 9936)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkTreeArea.java 2007-07-06 17:02:15 UTC (rev 9937)
@@ -39,7 +39,7 @@
* A NonArea class for items generated by fo:bookmark-tree.
*/
public final class BookmarkTreeArea extends BookmarkParentArea
- implements org.axsl.galley.BookmarkTreeArea {
+ implements org.axsl.galley.BookmarkTree {
/** The "generated-by" trait, as defined in Section 6.1.1. */
private FOLinkage generatedBy;
Modified: trunk/foray/foray-render/src/java/org/foray/render/Renderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/Renderer.java 2007-07-06 16:56:41 UTC (rev 9936)
+++ trunk/foray/foray-render/src/java/org/foray/render/Renderer.java 2007-07-06 17:02:15 UTC (rev 9937)
@@ -45,7 +45,7 @@
import org.axsl.galley.BackgroundArea;
import org.axsl.galley.BeforeFloatArea;
import org.axsl.galley.BlockContainerArea;
-import org.axsl.galley.BookmarkTreeArea;
+import org.axsl.galley.BookmarkTree;
import org.axsl.galley.ExternalGraphicArea;
import org.axsl.galley.FootnoteArea;
import org.axsl.galley.ForeignObjectArea;
@@ -514,7 +514,7 @@
/**
* {@inheritDoc}
*/
- public abstract void render(BookmarkTreeArea area);
+ public abstract void render(BookmarkTree area);
/**
* {@inheritDoc}
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-07-06 16:56:41 UTC (rev 9936)
+++ trunk/foray/foray-render/src/java/org/foray/render/awt/AWTRenderer.java 2007-07-06 17:02:15 UTC (rev 9937)
@@ -48,7 +48,7 @@
import org.axsl.font.FontConsumer;
import org.axsl.font.FontUse;
import org.axsl.galley.Area;
-import org.axsl.galley.BookmarkTreeArea;
+import org.axsl.galley.BookmarkTree;
import org.axsl.galley.ExternalGraphicArea;
import org.axsl.galley.ForeignObjectArea;
import org.axsl.galley.GeneralInlineArea;
@@ -746,7 +746,7 @@
/**
* {@inheritDoc}
*/
- public void render(final BookmarkTreeArea area) {
+ public void render(final BookmarkTree area) {
return;
}
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-07-06 16:56:41 UTC (rev 9936)
+++ trunk/foray/foray-render/src/java/org/foray/render/pcl/PCLRenderer.java 2007-07-06 17:02:15 UTC (rev 9937)
@@ -43,7 +43,7 @@
import org.axsl.common.value.RuleStyle;
import org.axsl.font.Font;
-import org.axsl.galley.BookmarkTreeArea;
+import org.axsl.galley.BookmarkTree;
import org.axsl.galley.ExternalGraphicArea;
import org.axsl.galley.ForeignObjectArea;
import org.axsl.galley.GeneralInlineArea;
@@ -709,7 +709,7 @@
/**
* {@inheritDoc}
*/
- public void render(final BookmarkTreeArea area) {
+ public void render(final BookmarkTree area) {
return;
}
Modified: trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2007-07-06 16:56:41 UTC (rev 9936)
+++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2007-07-06 17:02:15 UTC (rev 9937)
@@ -44,8 +44,8 @@
import org.axsl.galley.Area;
import org.axsl.galley.AreaNode;
import org.axsl.galley.Galley;
-import org.axsl.galley.BookmarkArea;
-import org.axsl.galley.BookmarkTreeArea;
+import org.axsl.galley.Bookmark;
+import org.axsl.galley.BookmarkTree;
import org.axsl.galley.ForeignObjectArea;
import org.axsl.galley.GeneralInlineArea;
import org.axsl.galley.GraphicArea;
@@ -513,9 +513,9 @@
/**
* {@inheritDoc}
*/
- public void render(final BookmarkTreeArea area) {
+ public void render(final BookmarkTree area) {
for (int i = 0; i < area.getChildCount(); i++) {
- final BookmarkArea child = (BookmarkArea) area.getChildAt(i);
+ final Bookmark child = (Bookmark) area.getChildAt(i);
renderBookmark(child, pdfDoc.getOutlineRoot());
}
}
@@ -526,7 +526,7 @@
* @param parent The PDF outline object to which the rendered bookmarks
* should be added.
*/
- public void renderBookmark(final BookmarkArea area,
+ public void renderBookmark(final Bookmark area,
final PdfOutlineParent parent) {
if (area == null || parent == null) {
return;
@@ -547,8 +547,8 @@
// Recursively handle child bookmarks
for (int i = 0; i < area.getChildCount(); i++) {
final AreaNode child = area.getChildAt(i);
- if (child instanceof BookmarkArea) {
- renderBookmark((BookmarkArea) child, pdfOutline);
+ if (child instanceof Bookmark) {
+ renderBookmark((Bookmark) child, pdfOutline);
}
}
}
Modified: trunk/foray/foray-render/src/java/org/foray/render/ps/PSRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/ps/PSRenderer.java 2007-07-06 16:56:41 UTC (rev 9936)
+++ trunk/foray/foray-render/src/java/org/foray/render/ps/PSRenderer.java 2007-07-06 17:02:15 UTC (rev 9937)
@@ -47,7 +47,7 @@
import org.axsl.font.FontUse;
import org.axsl.font.output.FontPs;
import org.axsl.galley.Area;
-import org.axsl.galley.BookmarkTreeArea;
+import org.axsl.galley.BookmarkTree;
import org.axsl.galley.ForeignObjectArea;
import org.axsl.galley.GeneralInlineArea;
import org.axsl.galley.GraphicArea;
@@ -1064,7 +1064,7 @@
/**
* {@inheritDoc}
*/
- public void render(final BookmarkTreeArea area) {
+ public void render(final BookmarkTree area) {
return;
}
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-07-06 16:56:41 UTC (rev 9936)
+++ trunk/foray/foray-render/src/java/org/foray/render/svg/SVGRenderer.java 2007-07-06 17:02:15 UTC (rev 9937)
@@ -37,7 +37,7 @@
import org.axsl.common.value.RuleStyle;
import org.axsl.font.FontConsumer;
import org.axsl.galley.Area;
-import org.axsl.galley.BookmarkTreeArea;
+import org.axsl.galley.BookmarkTree;
import org.axsl.galley.ExternalGraphicArea;
import org.axsl.galley.ForeignObjectArea;
import org.axsl.galley.GeneralInlineArea;
@@ -335,7 +335,7 @@
/**
* {@inheritDoc}
*/
- public void render(final BookmarkTreeArea area) {
+ public void render(final BookmarkTree area) {
return;
}
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-07-06 16:56:41 UTC (rev 9936)
+++ trunk/foray/foray-render/src/java/org/foray/render/txt/TXTRenderer.java 2007-07-06 17:02:15 UTC (rev 9937)
@@ -34,7 +34,7 @@
import org.foray.render.Renderer;
import org.axsl.common.value.RuleStyle;
-import org.axsl.galley.BookmarkTreeArea;
+import org.axsl.galley.BookmarkTree;
import org.axsl.galley.ExternalGraphicArea;
import org.axsl.galley.ForeignObjectArea;
import org.axsl.galley.GeneralInlineArea;
@@ -539,7 +539,7 @@
/**
* {@inheritDoc}
*/
- public void render(final BookmarkTreeArea area) {
+ public void render(final BookmarkTree area) {
return;
}
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-07-06 16:56:41 UTC (rev 9936)
+++ trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java 2007-07-06 17:02:15 UTC (rev 9937)
@@ -45,7 +45,7 @@
import org.axsl.galley.BackgroundArea;
import org.axsl.galley.BeforeFloatArea;
import org.axsl.galley.BlockContainerArea;
-import org.axsl.galley.BookmarkTreeArea;
+import org.axsl.galley.BookmarkTree;
import org.axsl.galley.ExternalGraphicArea;
import org.axsl.galley.FootnoteArea;
import org.axsl.galley.ForeignObjectArea;
@@ -390,7 +390,7 @@
/**
* {@inheritDoc}
*/
- public void render(final BookmarkTreeArea area) {
+ public void render(final BookmarkTree area) {
return;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-06 17:24:24
|
Revision: 9938
http://svn.sourceforge.net/foray/?rev=9938&view=rev
Author: victormote
Date: 2007-07-06 10:24:24 -0700 (Fri, 06 Jul 2007)
Log Message:
-----------
Conform to axsl changes rolling up PageNumberArea and PageNumberCitationArea in the Galley module, replacing them with TextArea.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberCitationArea.java
trunk/foray/foray-render/src/java/org/foray/render/Renderer.java
trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2007-07-06 17:02:15 UTC (rev 9937)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2007-07-06 17:24:24 UTC (rev 9938)
@@ -168,7 +168,7 @@
final OrderedTreeNode o = iterator.next();
if (o instanceof PageNumberCitationArea) {
final PageNumberCitationArea pia = (PageNumberCitationArea) o;
- pia.resolve();
+ pia.getText();
}
}
if (traitTextAlign() == TextAlign.JUSTIFY) {
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberArea.java 2007-07-06 17:02:15 UTC (rev 9937)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberArea.java 2007-07-06 17:24:24 UTC (rev 9938)
@@ -40,7 +40,7 @@
* The normal inline-area created by an fo:page-number object.
*/
public final class PageNumberArea extends AbstractInlineArea
- implements org.axsl.galley.PageNumberArea,
+ implements org.axsl.galley.TextArea,
org.axsl.area.PageNumberArea {
/** The "generated-by" trait, as defined in Section 6.1.1. */
@@ -119,10 +119,10 @@
/**
* {@inheritDoc}
*/
- public String resolve() {
+ public char[] getText() {
final String text = getPage().getFormattedNumber();
setProgressionDimension(getWordWidth(text));
- return text;
+ return text.toCharArray();
}
/**
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberCitationArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberCitationArea.java 2007-07-06 17:02:15 UTC (rev 9937)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberCitationArea.java 2007-07-06 17:24:24 UTC (rev 9938)
@@ -40,7 +40,7 @@
* Area containing all or part of a page-number-citation.
*/
public final class PageNumberCitationArea extends AbstractInlineArea
- implements org.axsl.galley.PageNumberCitationArea,
+ implements org.axsl.galley.TextArea,
org.axsl.area.PageNumberCitationArea {
/** The "generated-by" trait, as defined in Section 6.1.1. */
@@ -126,7 +126,7 @@
/**
* {@inheritDoc}
*/
- public String resolve() {
+ public char[] getText() {
final Area area = getAreaTree().firstNormalAreaReturned(traitRefId());
String text = null;
if (area == null) {
@@ -135,17 +135,15 @@
text = area.getPage().getFormattedNumber();
}
setProgressionDimension(getWordWidth(text));
- return text;
+ return text.toCharArray();
}
/**
* {@inheritDoc}
*/
public boolean hasUnresolvedRefId() {
- if (resolve().equals("???")) {
- return true;
- }
- return false;
+ final Area area = getAreaTree().firstNormalAreaReturned(traitRefId());
+ return area == null;
}
/**
Modified: trunk/foray/foray-render/src/java/org/foray/render/Renderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/Renderer.java 2007-07-06 17:02:15 UTC (rev 9937)
+++ trunk/foray/foray-render/src/java/org/foray/render/Renderer.java 2007-07-06 17:24:24 UTC (rev 9938)
@@ -58,8 +58,6 @@
import org.axsl.galley.NormalBlockArea;
import org.axsl.galley.PageArea;
import org.axsl.galley.PageCollection;
-import org.axsl.galley.PageNumberArea;
-import org.axsl.galley.PageNumberCitationArea;
import org.axsl.galley.RegionArea;
import org.axsl.galley.SvgArea;
import org.axsl.galley.TableArea;
@@ -540,20 +538,6 @@
/**
* {@inheritDoc}
*/
- public void render(final PageNumberCitationArea area) {
- renderTextSegment(area, area.resolve().toCharArray());
- }
-
- /**
- * {@inheritDoc}
- */
- public void render(final PageNumberArea area) {
- renderTextSegment(area, area.resolve().toCharArray());
- }
-
- /**
- * {@inheritDoc}
- */
public void render(final InlineArea area) {
markBorder(area);
markBackground(area);
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-07-06 17:02:15 UTC (rev 9937)
+++ trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java 2007-07-06 17:24:24 UTC (rev 9938)
@@ -57,7 +57,6 @@
import org.axsl.galley.MainReferenceArea;
import org.axsl.galley.NormalBlockArea;
import org.axsl.galley.PageArea;
-import org.axsl.galley.PageNumberCitationArea;
import org.axsl.galley.RegionArea;
import org.axsl.galley.SvgArea;
import org.axsl.galley.TableArea;
@@ -444,19 +443,6 @@
/**
* {@inheritDoc}
*/
- public void render(final PageNumberCitationArea area) {
- final StringBuilder buffer = new StringBuilder();
- outputGeneratedBy(area, buffer);
- writeStartTag(area, buffer);
- outputAllRectangles(area);
- renderContent(area.resolve());
- writeEndTag(area);
- this.outputContentRectangle(area);
- }
-
- /**
- * {@inheritDoc}
- */
public void render(final InlineArea area) {
final StringBuilder buffer = new StringBuilder();
outputGeneratedBy(area, buffer);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-06 19:46:31
|
Revision: 9939
http://svn.sourceforge.net/foray/?rev=9939&view=rev
Author: victormote
Date: 2007-07-06 12:46:34 -0700 (Fri, 06 Jul 2007)
Log Message:
-----------
Conform to axsl changes removing BookmarkTree and its children from the AreaNode hierarchy.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java
trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkParentArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkTitleArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkTreeArea.java
trunk/foray/foray-render/src/java/org/foray/render/Renderer.java
trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java 2007-07-06 17:24:24 UTC (rev 9938)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaTree.java 2007-07-06 19:46:34 UTC (rev 9939)
@@ -62,6 +62,9 @@
/** The children of this node. */
private List<AreaNode> children = new ArrayList<AreaNode>();
+ /** The bookmark tree for this document. */
+ private BookmarkTreeArea bookmarkTreeArea;
+
/** The font consumer for this area tree. */
private FontConsumer fontConsumer;
@@ -219,13 +222,12 @@
if (bookmarkTree == null) {
return;
}
- final BookmarkTreeArea bmtArea = BookmarkTreeArea.makeBookmarkTreeArea(
+ this.bookmarkTreeArea = BookmarkTreeArea.makeBookmarkTreeArea(
bookmarkTree, this);
- this.children.add(bmtArea);
for (int i = 0; i < bookmarkTree.getChildCount(); i++) {
final Bookmark bookmark = (Bookmark)
bookmarkTree.getChildAt(i);
- bmtArea.makeBookmarkArea(bookmark);
+ this.bookmarkTreeArea.makeBookmarkArea(bookmark);
}
}
@@ -477,4 +479,11 @@
return this.renderQueue.contains(page);
}
+ /**
+ * {@inheritDoc}
+ */
+ public org.axsl.galley.BookmarkTree getBookmarkTree() {
+ return this.bookmarkTreeArea;
+ }
+
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkArea.java 2007-07-06 17:24:24 UTC (rev 9938)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkArea.java 2007-07-06 19:46:34 UTC (rev 9939)
@@ -28,12 +28,10 @@
package org.foray.area;
-import org.axsl.area.AreaTreeException;
import org.axsl.fo.Fo;
import org.axsl.fo.fo.Bookmark;
import org.axsl.fo.fo.BookmarkTitle;
import org.axsl.font.Font;
-import org.axsl.galley.RenderVisitor;
import java.awt.Color;
import java.util.ArrayList;
@@ -46,14 +44,17 @@
implements org.axsl.galley.Bookmark {
/** The "generated-by" trait, as defined in Section 6.1.1. */
- private FOLinkage generatedBy;
+ private Bookmark generatedBy;
/** The parent of this node. */
private BookmarkParentArea parent;
/** The children of this node. */
- private List<AreaNode> children = new ArrayList<AreaNode>();
+ private List<BookmarkArea> children = new ArrayList<BookmarkArea>();
+ /** The title area for this bookmark. */
+ private BookmarkTitleArea titleArea;
+
/**
* Private Constructor.
* @param parentArea The parent area.
@@ -71,9 +72,7 @@
static BookmarkArea makeBookmarkArea(final Bookmark generatedBy,
final BookmarkParentArea parentArea) {
final BookmarkArea newBookmarkArea = new BookmarkArea(parentArea);
- newBookmarkArea.generatedBy = newBookmarkArea.linkage(generatedBy,
- null);
- newBookmarkArea.registerWithLinkage(null);
+ newBookmarkArea.generatedBy = generatedBy;
return newBookmarkArea;
}
@@ -82,11 +81,7 @@
* @return The bookmark title for this bookmark.
*/
public BookmarkTitleArea getBookmarkTitle() {
- if (getChildren() == null || getChildren().size() < 1
- || ! (getChildren().get(0) instanceof BookmarkTitleArea)) {
- return null;
- }
- return (BookmarkTitleArea) getChildren().get(0);
+ return this.titleArea;
}
/**
@@ -97,42 +92,13 @@
final BookmarkTitleArea newTitleArea
= BookmarkTitleArea.makeBookmarkTitleArea(bookmarkTitle,
this);
- this.children.add(newTitleArea);
+ this.titleArea = newTitleArea;
}
/**
* {@inheritDoc}
*/
- public String getAreaName() {
- return "bookmark";
- }
-
- /**
- * {@inheritDoc}
- */
- public void render(final RenderVisitor visitor) {
- visitor.render(this);
- }
-
- /**
- * {@inheritDoc}
- */
- public AreaNode getParent() {
- return this.parent;
- }
-
- /**
- * {@inheritDoc}
- */
- public void setParent(final AreaNode node) throws AreaTreeException {
- throw new AreaTreeException("BookmarkArea should never need to be "
- + "reparented.");
- }
-
- /**
- * {@inheritDoc}
- */
- public List<AreaNode> getChildren() {
+ public List<BookmarkArea> getChildren() {
return this.children;
}
@@ -159,30 +125,16 @@
}
/**
- * {@inheritDoc}
+ * Returns the FO Tree bookmark node that created this.
+ * @return The FO Tree bookmark.
*/
- protected boolean optimize() {
- this.optimizeChildren();
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- public FOLinkage getLinkage() {
+ public Bookmark traitGeneratedBy() {
return this.generatedBy;
}
/**
* {@inheritDoc}
*/
- public Bookmark traitGeneratedBy() {
- return (Bookmark) this.getLinkage().getFONode();
- }
-
- /**
- * {@inheritDoc}
- */
public String getDestination() {
return traitGeneratedBy().traitInternalDestination();
}
@@ -215,4 +167,12 @@
return this.getBookmarkTitle().traitGeneratedBy().traitFontStyle(null);
}
+ /**
+ * Returns the parent of this bookmark.
+ * @return The parent of this bookmark.
+ */
+ public BookmarkParentArea getParent() {
+ return this.parent;
+ }
+
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkParentArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkParentArea.java 2007-07-06 17:24:24 UTC (rev 9938)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkParentArea.java 2007-07-06 19:46:34 UTC (rev 9939)
@@ -33,7 +33,7 @@
/**
* Superclass for classes that can be parents of {@link BookmarkArea}s.
*/
-public abstract class BookmarkParentArea extends NonArea {
+public abstract class BookmarkParentArea {
/**
* Recursively lays out a bookmark.
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkTitleArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkTitleArea.java 2007-07-06 17:24:24 UTC (rev 9938)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkTitleArea.java 2007-07-06 19:46:34 UTC (rev 9939)
@@ -28,22 +28,18 @@
package org.foray.area;
-import org.axsl.area.AreaTreeException;
import org.axsl.fo.fo.BookmarkTitle;
import org.axsl.font.Font;
-import org.axsl.galley.RenderVisitor;
import java.awt.Color;
-import java.util.Collections;
-import java.util.List;
/**
* The AreaTree representation of an fo:bookmark-title object.
*/
-public final class BookmarkTitleArea extends NonArea {
+public final class BookmarkTitleArea {
/** The "generated-by" trait, as defined in Section 6.1.1. */
- private FOLinkage generatedBy;
+ private BookmarkTitle generatedBy;
/** The parent of this node. */
private BookmarkArea parent;
@@ -66,8 +62,7 @@
final BookmarkTitle generatedBy, final BookmarkArea parentArea) {
final BookmarkTitleArea newTitleArea = new BookmarkTitleArea(
parentArea);
- newTitleArea.generatedBy = newTitleArea.linkage(generatedBy, null);
- newTitleArea.registerWithLinkage(null);
+ newTitleArea.generatedBy = generatedBy;
return newTitleArea;
}
@@ -82,68 +77,22 @@
}
/**
- * {@inheritDoc}
+ * Returns the parent bookmark area.
+ * @return The parent bookmark area.
*/
- public String getAreaName() {
- return "bookmark-title";
- }
-
- /**
- * {@inheritDoc}
- */
- public void render(final RenderVisitor visitor) {
- visitor.render(this);
- }
-
- /**
- * {@inheritDoc}
- */
public BookmarkArea getParent() {
return this.parent;
}
/**
- * {@inheritDoc}
+ * Returns the FO Tree bookmark-title object that generated this.
+ * @return The FO Tree bookmark-title object that generated this.
*/
- public void setParent(final AreaNode node) throws AreaTreeException {
- if (node instanceof BookmarkArea) {
- this.parent = (BookmarkArea) node;
- } else {
- throw new AreaTreeException("Parent of BookmarkTitleArea must "
- + "be BookmarkArea");
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public List<AreaNode> getChildren() {
- return Collections.emptyList();
- }
-
- /**
- * {@inheritDoc}
- */
- protected boolean optimize() {
- this.optimizeChildren();
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- public FOLinkage getLinkage() {
+ public BookmarkTitle traitGeneratedBy() {
return this.generatedBy;
}
/**
- * {@inheritDoc}
- */
- public BookmarkTitle traitGeneratedBy() {
- return (BookmarkTitle) this.getLinkage().getFONode();
- }
-
- /**
* Returns the color of this node.
* @return The color of this node.
*/
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkTreeArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkTreeArea.java 2007-07-06 17:24:24 UTC (rev 9938)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkTreeArea.java 2007-07-06 19:46:34 UTC (rev 9939)
@@ -28,9 +28,7 @@
package org.foray.area;
-import org.axsl.area.AreaTreeException;
import org.axsl.fo.fo.BookmarkTree;
-import org.axsl.galley.RenderVisitor;
import java.util.ArrayList;
import java.util.List;
@@ -42,7 +40,7 @@
implements org.axsl.galley.BookmarkTree {
/** The "generated-by" trait, as defined in Section 6.1.1. */
- private FOLinkage generatedBy;
+ private BookmarkTree generatedBy;
/** The parent of this node. */
private AreaTree parent;
@@ -68,44 +66,13 @@
final AreaTree parentArea) {
final BookmarkTreeArea newBookmarkTreeArea = new BookmarkTreeArea(
parentArea);
- newBookmarkTreeArea.generatedBy = newBookmarkTreeArea.linkage(
- generatedBy, null);
- newBookmarkTreeArea.registerWithLinkage(null);
+ newBookmarkTreeArea.generatedBy = generatedBy;
return newBookmarkTreeArea;
}
/**
* {@inheritDoc}
*/
- public String getAreaName() {
- return "bookmark-tree";
- }
-
- /**
- * {@inheritDoc}
- */
- public void render(final RenderVisitor visitor) {
- visitor.render(this);
- }
-
- /**
- * {@inheritDoc}
- */
- public AreaNode getParent() {
- return this.parent;
- }
-
- /**
- * {@inheritDoc}
- */
- public void setParent(final AreaNode node) throws AreaTreeException {
- throw new AreaTreeException("BookmarkAreaTree should never need to "
- + "be reparented.");
- }
-
- /**
- * {@inheritDoc}
- */
public List<BookmarkArea> getChildren() {
return this.children;
}
@@ -118,25 +85,19 @@
}
/**
- * {@inheritDoc}
+ * Returns the parent AreaTree.
+ * @return The parent AreaTree.
*/
- protected boolean optimize() {
- this.optimizeChildren();
- return false;
+ public AreaTree getParent() {
+ return this.parent;
}
/**
- * {@inheritDoc}
+ * Returns the FO Tree node that generated this bookmark tree.
+ * @return The FO Tree node that generated this bookmark tree.
*/
- public FOLinkage getLinkage() {
+ public BookmarkTree getGeneratedBy() {
return this.generatedBy;
}
- /**
- * {@inheritDoc}
- */
- public BookmarkTree traitGeneratedBy() {
- return (BookmarkTree) this.getLinkage().getFONode();
- }
-
}
Modified: trunk/foray/foray-render/src/java/org/foray/render/Renderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/Renderer.java 2007-07-06 17:24:24 UTC (rev 9938)
+++ trunk/foray/foray-render/src/java/org/foray/render/Renderer.java 2007-07-06 19:46:34 UTC (rev 9939)
@@ -510,9 +510,10 @@
public abstract void render(TextArea area);
/**
- * {@inheritDoc}
+ * Render the bookmark tree for this document.
+ * @param bookmarkTree The bookmark tree to be rendered.
*/
- public abstract void render(BookmarkTree area);
+ public abstract void render(BookmarkTree bookmarkTree);
/**
* {@inheritDoc}
@@ -550,6 +551,10 @@
* includes items like Destinations and Bookmarks.
*/
protected void renderDocumentNodes() {
+ final BookmarkTree bookmarkTree = this.areaTree.getBookmarkTree();
+ if (bookmarkTree != null) {
+ render(bookmarkTree);
+ }
for (int i = 0; i < this.areaTree.getChildCount(); i++) {
final AreaNode atNode = this.areaTree.getChildAt(i);
if (! (atNode instanceof PageCollection)) {
Modified: trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2007-07-06 17:24:24 UTC (rev 9938)
+++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2007-07-06 19:46:34 UTC (rev 9939)
@@ -514,8 +514,8 @@
* {@inheritDoc}
*/
public void render(final BookmarkTree area) {
- for (int i = 0; i < area.getChildCount(); i++) {
- final Bookmark child = (Bookmark) area.getChildAt(i);
+ for (int i = 0; i < area.getChildren().size(); i++) {
+ final Bookmark child = area.getChildren().get(i);
renderBookmark(child, pdfDoc.getOutlineRoot());
}
}
@@ -545,11 +545,9 @@
pdfOutline = parent.createPdfOutlineItem(area.getTitleText(),
area.getDestination(), color, italic, bold);
// Recursively handle child bookmarks
- for (int i = 0; i < area.getChildCount(); i++) {
- final AreaNode child = area.getChildAt(i);
- if (child instanceof Bookmark) {
- renderBookmark((Bookmark) child, pdfOutline);
- }
+ for (int i = 0; i < area.getChildren().size(); i++) {
+ final Bookmark child = area.getChildren().get(i);
+ renderBookmark(child, pdfOutline);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-06 20:49:01
|
Revision: 9942
http://svn.sourceforge.net/foray/?rev=9942&view=rev
Author: victormote
Date: 2007-07-06 13:49:01 -0700 (Fri, 06 Jul 2007)
Log Message:
-----------
Conform to axsl change renaming PageArea to Page.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java
trunk/foray/foray-core/src/java/org/foray/core/FOrayTarget.java
trunk/foray/foray-render/src/java/org/foray/render/Renderer.java
trunk/foray/foray-render/src/java/org/foray/render/awt/AWTPrintRenderer.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/PageRA.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java 2007-07-06 20:35:07 UTC (rev 9941)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/PageRA.java 2007-07-06 20:49:01 UTC (rev 9942)
@@ -47,7 +47,7 @@
import org.axsl.fo.fo.RegionStart;
import org.axsl.fo.fo.RetrieveMarker;
import org.axsl.fo.fo.SimplePageMaster;
-import org.axsl.galley.PageArea;
+import org.axsl.galley.Page;
import org.axsl.galley.RenderVisitor;
import java.util.ArrayList;
@@ -56,7 +56,7 @@
/**
* Area containing a page.
*/
-public final class PageRA extends AreaFixed implements PageArea,
+public final class PageRA extends AreaFixed implements Page,
org.axsl.area.PageArea {
/** The "generated-by" trait, as defined in Section 6.1.1. */
Modified: trunk/foray/foray-core/src/java/org/foray/core/FOrayTarget.java
===================================================================
--- trunk/foray/foray-core/src/java/org/foray/core/FOrayTarget.java 2007-07-06 20:35:07 UTC (rev 9941)
+++ trunk/foray/foray-core/src/java/org/foray/core/FOrayTarget.java 2007-07-06 20:49:01 UTC (rev 9942)
@@ -298,7 +298,7 @@
* {@inheritDoc}
*/
public void pageComplete(final AreaTreeEvent event) {
- final org.axsl.galley.PageArea page = event.getPage();
+ final org.axsl.galley.Page page = event.getPage();
final Renderer renderer = (Renderer) this.outputTarget;
try {
renderer.render(page);
Modified: trunk/foray/foray-render/src/java/org/foray/render/Renderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/Renderer.java 2007-07-06 20:35:07 UTC (rev 9941)
+++ trunk/foray/foray-render/src/java/org/foray/render/Renderer.java 2007-07-06 20:49:01 UTC (rev 9942)
@@ -56,7 +56,7 @@
import org.axsl.galley.LineArea;
import org.axsl.galley.MainReferenceArea;
import org.axsl.galley.NormalBlockArea;
-import org.axsl.galley.PageArea;
+import org.axsl.galley.Page;
import org.axsl.galley.PageCollection;
import org.axsl.galley.RegionArea;
import org.axsl.galley.SvgArea;
@@ -116,7 +116,7 @@
/**
* {@inheritDoc}
*/
- public abstract void render(PageArea page) throws OutputException;
+ public abstract void render(Page page) throws OutputException;
/**
* Marks the border, if any, for the given area.
@@ -375,7 +375,7 @@
* Render a page's region areas.
* @param page The page whose regions should be rendered.
*/
- protected void renderRegions(final PageArea page) {
+ protected void renderRegions(final Page page) {
render(page.getRegionBody());
if (page.getRegionBefore() != null) {
render(page.getRegionBefore());
Modified: trunk/foray/foray-render/src/java/org/foray/render/awt/AWTPrintRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/awt/AWTPrintRenderer.java 2007-07-06 20:35:07 UTC (rev 9941)
+++ trunk/foray/foray-render/src/java/org/foray/render/awt/AWTPrintRenderer.java 2007-07-06 20:49:01 UTC (rev 9942)
@@ -30,7 +30,7 @@
import org.foray.output.OutputConfig;
-import org.axsl.galley.PageArea;
+import org.axsl.galley.Page;
import org.axsl.output.OutputException;
import org.apache.commons.logging.Log;
@@ -122,7 +122,7 @@
/**
* {@inheritDoc}
*/
- public void renderPage(final PageArea page) {
+ public void renderPage(final Page page) {
setPageWidth((int) toPoints(page.getWidth()));
setPageHeight((int) toPoints(page.getHeight()));
super.renderPage(page);
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-07-06 20:35:07 UTC (rev 9941)
+++ trunk/foray/foray-render/src/java/org/foray/render/awt/AWTRenderer.java 2007-07-06 20:49:01 UTC (rev 9942)
@@ -54,7 +54,7 @@
import org.axsl.galley.GeneralInlineArea;
import org.axsl.galley.GraphicArea;
import org.axsl.galley.LeaderArea;
-import org.axsl.galley.PageArea;
+import org.axsl.galley.Page;
import org.axsl.galley.SvgArea;
import org.axsl.galley.TextArea;
import org.axsl.graphic.Graphic;
@@ -105,7 +105,7 @@
private int pageNumber = 0;
/** The list of pages processed. */
- private Vector<PageArea> pageList = new Vector<PageArea>();
+ private Vector<Page> pageList = new Vector<Page>();
/** A color cached during processing. This could conceivably become a
* local variable, but is an instance variable in the hope of reducing
@@ -400,7 +400,7 @@
/**
* {@inheritDoc}
*/
- public void render(final PageArea page) throws OutputException {
+ public void render(final Page page) throws OutputException {
pageWidth = Math.round(toPoints(page.getWidth()));
pageHeight = Math.round(toPoints(page.getHeight()));
@@ -429,7 +429,7 @@
* Renders a given page.
* @param page The page to be rendered.
*/
- protected void renderPage(final PageArea page) {
+ protected void renderPage(final Page page) {
this.currentFont = null;
this.currentFontSize = 0;
renderRegions(page);
@@ -769,7 +769,7 @@
graphics.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,
RenderingHints.VALUE_FRACTIONALMETRICS_ON);
- final PageArea aPage = pageList.get(pageIndex);
+ final Page aPage = pageList.get(pageIndex);
renderPage(aPage);
graphics = oldGraphics;
@@ -791,7 +791,7 @@
return null;
}
- final PageArea page = pageList.get(pageIndex);
+ final Page page = pageList.get(pageIndex);
final PageFormat pageFormat = new PageFormat();
final Paper paper = new Paper();
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-07-06 20:35:07 UTC (rev 9941)
+++ trunk/foray/foray-render/src/java/org/foray/render/pcl/PCLRenderer.java 2007-07-06 20:49:01 UTC (rev 9942)
@@ -48,7 +48,7 @@
import org.axsl.galley.ForeignObjectArea;
import org.axsl.galley.GeneralInlineArea;
import org.axsl.galley.GraphicArea;
-import org.axsl.galley.PageArea;
+import org.axsl.galley.Page;
import org.axsl.galley.SvgArea;
import org.axsl.graphic.Graphic;
import org.axsl.graphic.GraphicException;
@@ -739,7 +739,7 @@
/**
* {@inheritDoc}
*/
- public void render(final PageArea page) throws OutputException {
+ public void render(final Page page) throws OutputException {
getLogger().debug("PCLRenderer.renderPage() page.Height() = "
+ page.getHeight());
Modified: trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2007-07-06 20:35:07 UTC (rev 9941)
+++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2007-07-06 20:49:01 UTC (rev 9942)
@@ -49,7 +49,7 @@
import org.axsl.galley.ForeignObjectArea;
import org.axsl.galley.GeneralInlineArea;
import org.axsl.galley.GraphicArea;
-import org.axsl.galley.PageArea;
+import org.axsl.galley.Page;
import org.axsl.galley.SvgArea;
import org.axsl.graphic.Graphic;
import org.axsl.graphic.GraphicLink;
@@ -443,7 +443,7 @@
/**
* Render page to PDF. {@inheritDoc}
*/
- public void render(final PageArea page) throws OutputException {
+ public void render(final Page page) throws OutputException {
getLogger().debug("Rendering single page to PDF.");
final float w = page.getWidth();
final float h = page.getHeight();
Modified: trunk/foray/foray-render/src/java/org/foray/render/ps/PSRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/ps/PSRenderer.java 2007-07-06 20:35:07 UTC (rev 9941)
+++ trunk/foray/foray-render/src/java/org/foray/render/ps/PSRenderer.java 2007-07-06 20:49:01 UTC (rev 9942)
@@ -52,7 +52,7 @@
import org.axsl.galley.GeneralInlineArea;
import org.axsl.galley.GraphicArea;
import org.axsl.galley.LeaderArea;
-import org.axsl.galley.PageArea;
+import org.axsl.galley.Page;
import org.axsl.galley.SvgArea;
import org.axsl.graphic.EpsGraphic;
import org.axsl.graphic.Graphic;
@@ -1227,7 +1227,7 @@
/**
* {@inheritDoc}
*/
- public void render(final PageArea page) {
+ public void render(final Page page) {
writeSetup();
this.pagecount++;
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-07-06 20:35:07 UTC (rev 9941)
+++ trunk/foray/foray-render/src/java/org/foray/render/svg/SVGRenderer.java 2007-07-06 20:49:01 UTC (rev 9942)
@@ -43,7 +43,7 @@
import org.axsl.galley.GeneralInlineArea;
import org.axsl.galley.GraphicArea;
import org.axsl.galley.LeaderArea;
-import org.axsl.galley.PageArea;
+import org.axsl.galley.Page;
import org.axsl.galley.SvgArea;
import org.axsl.galley.TextArea;
import org.axsl.graphic.Graphic;
@@ -252,7 +252,7 @@
/**
* {@inheritDoc}
*/
- public void render(final PageArea page) {
+ public void render(final Page page) {
this.pageNumber++;
final int lastWidth = this.pageWidth;
final int lastHeight = this.pageHeight;
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-07-06 20:35:07 UTC (rev 9941)
+++ trunk/foray/foray-render/src/java/org/foray/render/txt/TXTRenderer.java 2007-07-06 20:49:01 UTC (rev 9942)
@@ -39,7 +39,7 @@
import org.axsl.galley.ForeignObjectArea;
import org.axsl.galley.GeneralInlineArea;
import org.axsl.galley.GraphicArea;
-import org.axsl.galley.PageArea;
+import org.axsl.galley.Page;
import org.axsl.galley.SvgArea;
import org.axsl.graphic.Graphic;
import org.axsl.graphic.GraphicException;
@@ -582,7 +582,7 @@
/**
* {@inheritDoc}
*/
- public void render(final PageArea page) {
+ public void render(final Page page) {
if (this.firstPage) {
this.firstPage = false;
} 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-07-06 20:35:07 UTC (rev 9941)
+++ trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java 2007-07-06 20:49:01 UTC (rev 9942)
@@ -56,7 +56,7 @@
import org.axsl.galley.LineArea;
import org.axsl.galley.MainReferenceArea;
import org.axsl.galley.NormalBlockArea;
-import org.axsl.galley.PageArea;
+import org.axsl.galley.Page;
import org.axsl.galley.RegionArea;
import org.axsl.galley.SvgArea;
import org.axsl.galley.TableArea;
@@ -100,7 +100,7 @@
/**
* {@inheritDoc}
*/
- public void render(final PageArea page) {
+ public void render(final Page page) {
final RegionArea body = page.getRegionBody();
final RegionArea before = page.getRegionBefore();
final RegionArea after = page.getRegionAfter();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-06 21:02:03
|
Revision: 9943
http://svn.sourceforge.net/foray/?rev=9943&view=rev
Author: victormote
Date: 2007-07-06 14:02:05 -0700 (Fri, 06 Jul 2007)
Log Message:
-----------
Conform to axsl change renaming a method.
Modified Paths:
--------------
trunk/foray/foray-core/src/java/org/foray/core/FOrayTarget.java
trunk/foray/foray-render/src/java/org/foray/render/Renderer.java
Modified: trunk/foray/foray-core/src/java/org/foray/core/FOrayTarget.java
===================================================================
--- trunk/foray/foray-core/src/java/org/foray/core/FOrayTarget.java 2007-07-06 20:49:01 UTC (rev 9942)
+++ trunk/foray/foray-core/src/java/org/foray/core/FOrayTarget.java 2007-07-06 21:02:05 UTC (rev 9943)
@@ -251,7 +251,7 @@
+ pageSequenceCount + ".");
final Renderer renderer = (Renderer) this.outputTarget;
final org.axsl.galley.Galley areaTreeR = getRenderedAreaTree();
- renderer.setAreaTree(areaTreeR);
+ renderer.setGalley(areaTreeR);
final org.axsl.area.PageCollection pageCollection;
try {
pageCollection = areaTree.makePageCollection(pageSequence);
Modified: trunk/foray/foray-render/src/java/org/foray/render/Renderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/Renderer.java 2007-07-06 20:49:01 UTC (rev 9942)
+++ trunk/foray/foray-render/src/java/org/foray/render/Renderer.java 2007-07-06 21:02:05 UTC (rev 9943)
@@ -109,7 +109,7 @@
* Sets the AreaTree to be rendered.
* @param areaTree The AreaTree to be rendered.
*/
- public void setAreaTree(final Galley areaTree) {
+ public void setGalley(final Galley areaTree) {
this.areaTree = areaTree;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-07 15:20:26
|
Revision: 9944
http://svn.sourceforge.net/foray/?rev=9944&view=rev
Author: victormote
Date: 2007-07-07 08:20:28 -0700 (Sat, 07 Jul 2007)
Log Message:
-----------
Conform to axsl changes for foreign object API.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/ForeignObjectArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/SVGArea.java
trunk/foray/foray-render/src/java/org/foray/render/awt/AWTRenderer.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
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/ForeignObjectArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/ForeignObjectArea.java 2007-07-06 21:02:05 UTC (rev 9943)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/ForeignObjectArea.java 2007-07-07 15:20:28 UTC (rev 9944)
@@ -164,8 +164,12 @@
/**
* {@inheritDoc}
*/
- public AreaNode getContainedForeignObject() {
- return getFirstChild();
+ public Area getContainedForeignObject() {
+ if (this.children == null
+ || this.children.size() < 1) {
+ return null;
+ }
+ return this.children.get(0);
}
/**
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/SVGArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/SVGArea.java 2007-07-06 21:02:05 UTC (rev 9943)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/SVGArea.java 2007-07-07 15:20:28 UTC (rev 9944)
@@ -32,7 +32,6 @@
import org.axsl.fo.fo.GraftingPoint;
import org.axsl.fo.svg.SvgElement;
import org.axsl.galley.RenderVisitor;
-import org.axsl.graphic.Graphic;
import org.axsl.graphic.SvgGraphic;
import java.util.Collections;
@@ -78,7 +77,7 @@
/**
* {@inheritDoc}
*/
- public SvgGraphic getSvgGraphic() {
+ public SvgGraphic getGraphic() {
final SvgElement generatedBy = traitGeneratedBy();
return generatedBy.getSvgGraphic();
}
@@ -108,13 +107,6 @@
/**
* {@inheritDoc}
*/
- public Graphic getGraphic() {
- return this.traitBackgroundImage();
- }
-
- /**
- * {@inheritDoc}
- */
public List<AreaNode> getChildren() {
return Collections.emptyList();
}
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-07-06 21:02:05 UTC (rev 9943)
+++ trunk/foray/foray-render/src/java/org/foray/render/awt/AWTRenderer.java 2007-07-07 15:20:28 UTC (rev 9944)
@@ -715,7 +715,7 @@
final Rectangle2D.Float contentRectangle = new Rectangle2D.Float(
toPoints(area.crOriginX()), toPoints(area.crOriginY()),
toPoints(area.crIpd()), toPoints(area.crBpd()));
- renderSVGDocument(area.getSvgGraphic(), contentRectangle, null);
+ renderSVGDocument(area.getGraphic(), contentRectangle, null);
}
/**
Modified: trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2007-07-06 21:02:05 UTC (rev 9943)
+++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2007-07-07 15:20:28 UTC (rev 9944)
@@ -298,7 +298,7 @@
final Rectangle2D.Float contentRectangle = new Rectangle2D.Float(
toPoints(area.crOriginX()), toPoints(area.crOriginY()),
toPoints(area.crIpd()), toPoints(area.crBpd()));
- final SvgGraphic svgGraphic = area.getSvgGraphic();
+ final SvgGraphic svgGraphic = area.getGraphic();
getContentStream().drawGraphic(svgGraphic,
contentRectangle, null, this.getFontConsumer(),
getStrokeSVGText());
Modified: trunk/foray/foray-render/src/java/org/foray/render/ps/PSRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/ps/PSRenderer.java 2007-07-06 21:02:05 UTC (rev 9943)
+++ trunk/foray/foray-render/src/java/org/foray/render/ps/PSRenderer.java 2007-07-07 15:20:28 UTC (rev 9944)
@@ -504,7 +504,7 @@
final Rectangle2D.Float contentRectangle = new Rectangle2D.Float(
toPoints(area.crOriginX()), toPoints(area.crOriginY()),
toPoints(area.crIpd()), toPoints(area.crBpd()));
- renderSVGDocument(area.getSvgGraphic(), contentRectangle, area);
+ renderSVGDocument(area.getGraphic(), contentRectangle, area);
}
/**
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-07-06 21:02:05 UTC (rev 9943)
+++ trunk/foray/foray-render/src/java/org/foray/render/svg/SVGRenderer.java 2007-07-07 15:20:28 UTC (rev 9944)
@@ -562,7 +562,7 @@
public void render(final SvgArea area) {
final float x = toPoints(area.crOriginX());
final float y = this.pageHeight - toPoints(area.crOriginY());
- final SvgGraphic svgGraphic = area.getSvgGraphic();
+ final SvgGraphic svgGraphic = area.getGraphic();
renderSVGDocument(svgGraphic, x, y);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-07 17:59:03
|
Revision: 9946
http://svn.sourceforge.net/foray/?rev=9946&view=rev
Author: victormote
Date: 2007-07-07 10:59:02 -0700 (Sat, 07 Jul 2007)
Log Message:
-----------
Conform to and use new methods in axsl to report the dimensions of the reference area for foreign content.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/ForeignObjectArea.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/FObjScaled.java
trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/ForeignObjectArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/ForeignObjectArea.java 2007-07-07 16:32:20 UTC (rev 9945)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/ForeignObjectArea.java 2007-07-07 17:59:02 UTC (rev 9946)
@@ -258,4 +258,18 @@
this.parent = this.validateNewParent(node);
}
+ /**
+ * {@inheritDoc}
+ */
+ public int referenceIpd() {
+ return this.traitGeneratedBy().referenceIpd(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int referenceBpd() {
+ return this.traitGeneratedBy().referenceBpd(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-07-07 16:32:20 UTC (rev 9945)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-07-07 17:59:02 UTC (rev 9946)
@@ -3613,7 +3613,8 @@
}
/**
- * Return the height of the content of this object.
+ * Return the scaling factor that should be applied to the intrinsic height
+ * to compute the actual content height.
* @param context An object that knows how to resolve FO Tree context
* issues.
* @param fobjScaled The object containing the scalable item whose content
@@ -3641,7 +3642,8 @@
}
/**
- * Return the width of the content of this object.
+ * Return the scaling factor that should be applied to the intrinsic width
+ * to compute the actual content width.
* @param context An object that knows how to resolve FO Tree context
* issues.
* @param fobjScaled The object containing the scalable item whose content
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FObjScaled.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObjScaled.java 2007-07-07 16:32:20 UTC (rev 9945)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObjScaled.java 2007-07-07 17:59:02 UTC (rev 9946)
@@ -220,4 +220,22 @@
* WKConstants.MILLIUNITS_PER_UNIT / pixelsPerInch;
}
+ /**
+ * {@inheritDoc}
+ */
+ public int referenceIpd(final FoContext context) {
+ final int intrinsicWidth = this.intrinsicContentWidth(context);
+ final float scaling = this.getContentWidth(context, this);
+ return Math.round(intrinsicWidth * scaling);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int referenceBpd(final FoContext context) {
+ final int intrinsicHeight = this.intrinsicContentHeight(context);
+ final float scaling = this.getContentHeight(context, this);
+ return Math.round(intrinsicHeight * scaling);
+ }
+
}
Modified: trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2007-07-07 16:32:20 UTC (rev 9945)
+++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2007-07-07 17:59:02 UTC (rev 9946)
@@ -295,9 +295,11 @@
* {@inheritDoc}
*/
public void render(final SvgArea area) {
+ final ForeignObjectArea foreign = area.getParent();
final Rectangle2D.Float contentRectangle = new Rectangle2D.Float(
- toPoints(area.crOriginX()), toPoints(area.crOriginY()),
- toPoints(area.crIpd()), toPoints(area.crBpd()));
+ toPoints(foreign.crOriginX()), toPoints(foreign.crOriginY()),
+ toPoints(foreign.referenceIpd()),
+ toPoints(foreign.referenceBpd()));
final SvgGraphic svgGraphic = area.getGraphic();
getContentStream().drawGraphic(svgGraphic,
contentRectangle, null, this.getFontConsumer(),
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-07 18:33:08
|
Revision: 9947
http://svn.sourceforge.net/foray/?rev=9947&view=rev
Author: victormote
Date: 2007-07-07 11:33:03 -0700 (Sat, 07 Jul 2007)
Log Message:
-----------
Conform to axsl change to the nature of SvgArea, and the creation of the ForeignContent interface.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/ForeignObjectArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/SVGArea.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/ForeignObjectArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/ForeignObjectArea.java 2007-07-07 17:59:02 UTC (rev 9946)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/ForeignObjectArea.java 2007-07-07 18:33:03 UTC (rev 9947)
@@ -33,9 +33,10 @@
import org.axsl.fo.fo.GraftingPoint;
import org.axsl.fo.fo.InstreamForeignObject;
import org.axsl.fo.svg.SvgElement;
+import org.axsl.galley.ForeignContent;
import org.axsl.galley.RenderVisitor;
-import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
/**
@@ -52,9 +53,8 @@
/** The "generated-by" trait, as defined in Section 6.1.1. */
private FOLinkage generatedBy;
- /** The children of this node. */
- private List<AbstractInlineArea> children
- = new ArrayList<AbstractInlineArea>(1);
+ /** The foreign content encapsulated inside this area. */
+ private ForeignContent foreignContent;
/**
* Private Constructor.
@@ -136,7 +136,7 @@
final SvgElement svgElement = (SvgElement) foreign;
final SVGArea svgArea = SVGArea.makeSvgArea(svgElement, newFoArea,
graftingPoint);
- newFoArea.children.add(svgArea);
+ newFoArea.foreignContent = svgArea;
}
newFoArea.ancestorLineArea().lineContentChanged();
}
@@ -169,12 +169,8 @@
/**
* {@inheritDoc}
*/
- public Area getContainedForeignObject() {
- if (this.children == null
- || this.children.size() < 1) {
- return null;
- }
- return this.children.get(0);
+ public ForeignContent getContainedForeignObject() {
+ return this.foreignContent;
}
/**
@@ -195,7 +191,7 @@
* {@inheritDoc}
*/
public List<AbstractInlineArea> getChildren() {
- return this.children;
+ return Collections.emptyList();
}
/**
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/SVGArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/SVGArea.java 2007-07-07 17:59:02 UTC (rev 9946)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/SVGArea.java 2007-07-07 18:33:03 UTC (rev 9947)
@@ -28,27 +28,21 @@
package org.foray.area;
-import org.axsl.area.AreaTreeException;
import org.axsl.fo.fo.GraftingPoint;
import org.axsl.fo.svg.SvgElement;
-import org.axsl.galley.RenderVisitor;
import org.axsl.graphic.SvgGraphic;
-import java.util.Collections;
-import java.util.List;
-
/**
* An SVGArea represents the <em>reference </em> area that contains the
* content that is in a {@link ForeignObjectArea} <em>viewport </em> area.
*/
-public final class SVGArea extends AbstractInlineArea
- implements org.axsl.galley.SvgArea {
+public final class SVGArea implements org.axsl.galley.SvgArea {
/** The parent of this node. */
private ForeignObjectArea parent;
/** The "generated-by" trait, as defined in Section 6.1.1. */
- private FOLinkage generatedBy;
+ private SvgElement generatedBy;
/**
* Construct an SVGArea.
@@ -70,9 +64,7 @@
final ForeignObjectArea parentArea,
final GraftingPoint graftingPoint) {
final SVGArea newSvgArea = new SVGArea(parentArea);
- newSvgArea.generatedBy = newSvgArea.linkage(generatedBy,
- graftingPoint);
- newSvgArea.registerWithLinkage(graftingPoint);
+ newSvgArea.generatedBy = generatedBy;
return newSvgArea;
}
@@ -80,103 +72,14 @@
* {@inheritDoc}
*/
public SvgGraphic getGraphic() {
- final SvgElement generatedBy = traitGeneratedBy();
- return generatedBy.getSvgGraphic();
+ return this.generatedBy.getSvgGraphic();
}
/**
* {@inheritDoc}
*/
- public Area getOverflowArea(final Area childRequesting)
- throws AreaTreeException {
- return ancestorArea().getOverflowArea(this);
- }
-
- /**
- * {@inheritDoc}
- */
- public String getAreaName() {
- return "svg";
- }
-
- /**
- * {@inheritDoc}
- */
- public void render(final RenderVisitor visitor) {
- visitor.render(this);
- }
-
- /**
- * {@inheritDoc}
- */
- public List<AreaNode> getChildren() {
- return Collections.emptyList();
- }
-
- /**
- * {@inheritDoc}
- */
- protected boolean optimize() {
- this.optimizeChildren();
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- public FOLinkage getLinkage() {
- return this.generatedBy;
- }
-
- /**
- * {@inheritDoc}
- */
- public SvgElement traitGeneratedBy() {
- /* Cast verified at construction. */
- return (SvgElement) this.getLinkage().getFONode();
- }
-
- /**
- * {@inheritDoc}
- */
- public int letterSpacing() {
- /* Letter-spacing is not applicable for this inline element. */
- return 0;
- }
-
- /**
- * {@inheritDoc}
- */
- public int wordSpacing() {
- /* Word-spacing is not applicable for this inline element. */
- return 0;
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean kern() {
- /* Kerning is not applicable for this inline element. */
- return true;
- }
-
- /**
- * {@inheritDoc}
- */
public ForeignObjectArea getParent() {
return this.parent;
}
- /**
- * {@inheritDoc}
- */
- public void setParent(final AreaNode node) throws AreaTreeException {
- if (node instanceof ForeignObjectArea) {
- this.parent = (ForeignObjectArea) node;
- } else {
- throw new AreaTreeException("Parent of " + this.getAreaName()
- + " must be a ForeignObjectArea");
- }
- }
-
}
Modified: trunk/foray/foray-render/src/java/org/foray/render/Renderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/Renderer.java 2007-07-07 17:59:02 UTC (rev 9946)
+++ trunk/foray/foray-render/src/java/org/foray/render/Renderer.java 2007-07-07 18:33:03 UTC (rev 9947)
@@ -41,6 +41,7 @@
import org.axsl.common.value.RuleStyle;
import org.axsl.galley.Area;
import org.axsl.galley.AreaNode;
+import org.axsl.galley.ForeignContent;
import org.axsl.galley.Galley;
import org.axsl.galley.BackgroundArea;
import org.axsl.galley.BeforeFloatArea;
@@ -436,7 +437,17 @@
/**
* {@inheritDoc}
*/
- public abstract void render(ForeignObjectArea area);
+ public void render(final ForeignObjectArea area) {
+ final ForeignContent foreignContent = area.getContainedForeignObject();
+ if (foreignContent == null) {
+ this.getLogger().warn("Foreign Object Area has no parsed content");
+ return;
+ }
+ if (foreignContent instanceof SvgArea) {
+ final SvgArea svgArea = (SvgArea) foreignContent;
+ render(svgArea);
+ }
+ }
/**
* {@inheritDoc}
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-07-07 17:59:02 UTC (rev 9946)
+++ trunk/foray/foray-render/src/java/org/foray/render/awt/AWTRenderer.java 2007-07-07 18:33:03 UTC (rev 9947)
@@ -712,9 +712,11 @@
* {@inheritDoc}
*/
public void render(final SvgArea area) {
+ final ForeignObjectArea foreign = area.getParent();
final Rectangle2D.Float contentRectangle = new Rectangle2D.Float(
- toPoints(area.crOriginX()), toPoints(area.crOriginY()),
- toPoints(area.crIpd()), toPoints(area.crBpd()));
+ toPoints(foreign.crOriginX()), toPoints(foreign.crOriginY()),
+ toPoints(foreign.referenceIpd()),
+ toPoints(foreign.referenceBpd()));
renderSVGDocument(area.getGraphic(), contentRectangle, null);
}
@@ -823,13 +825,6 @@
/**
* {@inheritDoc}
*/
- public void render(final ForeignObjectArea area) {
- render(area.getContainedForeignObject());
- }
-
- /**
- * {@inheritDoc}
- */
public void startOutput() throws OutputException { }
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-07-07 17:59:02 UTC (rev 9946)
+++ trunk/foray/foray-render/src/java/org/foray/render/pcl/PCLRenderer.java 2007-07-07 18:33:03 UTC (rev 9947)
@@ -45,7 +45,6 @@
import org.axsl.font.Font;
import org.axsl.galley.BookmarkTree;
import org.axsl.galley.ExternalGraphicArea;
-import org.axsl.galley.ForeignObjectArea;
import org.axsl.galley.GeneralInlineArea;
import org.axsl.galley.GraphicArea;
import org.axsl.galley.Page;
@@ -549,13 +548,6 @@
/**
* {@inheritDoc}
*/
- public void render(final ForeignObjectArea area) {
- render(area.getContainedForeignObject());
- }
-
- /**
- * {@inheritDoc}
- */
public void render(final SvgArea area) {
getLogger().debug("PCLRenderer.renderSVGArea(" + area + ")");
// int x = area.rrOriginX();
Modified: trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2007-07-07 17:59:02 UTC (rev 9946)
+++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2007-07-07 18:33:03 UTC (rev 9947)
@@ -43,10 +43,10 @@
import org.axsl.font.FontUse;
import org.axsl.galley.Area;
import org.axsl.galley.AreaNode;
-import org.axsl.galley.Galley;
import org.axsl.galley.Bookmark;
import org.axsl.galley.BookmarkTree;
import org.axsl.galley.ForeignObjectArea;
+import org.axsl.galley.Galley;
import org.axsl.galley.GeneralInlineArea;
import org.axsl.galley.GraphicArea;
import org.axsl.galley.Page;
@@ -279,21 +279,6 @@
/**
* {@inheritDoc}
*/
- public void render(final ForeignObjectArea area) {
- final AreaNode foArea = area.getContainedForeignObject();
- if (foArea == null) {
- this.getLogger().warn("Foreign Object Area has no parsed content");
- return;
- }
- if (foArea instanceof SvgArea) {
- final SvgArea svgArea = (SvgArea) foArea;
- render(svgArea);
- }
- }
-
- /**
- * {@inheritDoc}
- */
public void render(final SvgArea area) {
final ForeignObjectArea foreign = area.getParent();
final Rectangle2D.Float contentRectangle = new Rectangle2D.Float(
Modified: trunk/foray/foray-render/src/java/org/foray/render/ps/PSRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/ps/PSRenderer.java 2007-07-07 17:59:02 UTC (rev 9946)
+++ trunk/foray/foray-render/src/java/org/foray/render/ps/PSRenderer.java 2007-07-07 18:33:03 UTC (rev 9947)
@@ -493,18 +493,13 @@
/**
* {@inheritDoc}
*/
- public void render(final ForeignObjectArea area) {
- render(area.getContainedForeignObject());
- }
-
- /**
- * {@inheritDoc}
- */
public void render(final SvgArea area) {
+ final ForeignObjectArea foreign = area.getParent();
final Rectangle2D.Float contentRectangle = new Rectangle2D.Float(
- toPoints(area.crOriginX()), toPoints(area.crOriginY()),
- toPoints(area.crIpd()), toPoints(area.crBpd()));
- renderSVGDocument(area.getGraphic(), contentRectangle, area);
+ toPoints(foreign.crOriginX()), toPoints(foreign.crOriginY()),
+ toPoints(foreign.referenceIpd()),
+ toPoints(foreign.referenceBpd()));
+ renderSVGDocument(area.getGraphic(), contentRectangle, foreign);
}
/**
@@ -515,7 +510,7 @@
* @param area The area containing the graphic to be rendered.
*/
protected void renderSVGDocument(final SvgGraphic svgGraphic,
- final Rectangle2D contentRectangle, final GraphicArea area) {
+ final Rectangle2D contentRectangle, final Area area) {
float w = 0;
float h = 0;
try {
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-07-07 17:59:02 UTC (rev 9946)
+++ trunk/foray/foray-render/src/java/org/foray/render/svg/SVGRenderer.java 2007-07-07 18:33:03 UTC (rev 9947)
@@ -560,8 +560,9 @@
* {@inheritDoc}
*/
public void render(final SvgArea area) {
- final float x = toPoints(area.crOriginX());
- final float y = this.pageHeight - toPoints(area.crOriginY());
+ final ForeignObjectArea foreign = area.getParent();
+ final float x = toPoints(foreign.crOriginX());
+ final float y = this.pageHeight - toPoints(foreign.crOriginY());
final SvgGraphic svgGraphic = area.getGraphic();
renderSVGDocument(svgGraphic, x, y);
}
@@ -607,13 +608,6 @@
/**
* {@inheritDoc}
*/
- public void render(final ForeignObjectArea area) {
- render(area.getContainedForeignObject());
- }
-
- /**
- * {@inheritDoc}
- */
public void startOutput() throws OutputException {
try {
this.svgDocument = this.graphicServer.makeSvgDocument();
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-07-07 17:59:02 UTC (rev 9946)
+++ trunk/foray/foray-render/src/java/org/foray/render/txt/TXTRenderer.java 2007-07-07 18:33:03 UTC (rev 9947)
@@ -36,7 +36,6 @@
import org.axsl.common.value.RuleStyle;
import org.axsl.galley.BookmarkTree;
import org.axsl.galley.ExternalGraphicArea;
-import org.axsl.galley.ForeignObjectArea;
import org.axsl.galley.GeneralInlineArea;
import org.axsl.galley.GraphicArea;
import org.axsl.galley.Page;
@@ -504,13 +503,6 @@
/**
* {@inheritDoc}
*/
- public void render(final ForeignObjectArea area) {
- render(area.getContainedForeignObject());
- }
-
- /**
- * {@inheritDoc}
- */
public void render(final SvgArea area) {
getLogger().debug("TXTRenderer.renderSVGArea(" + area + ")");
/* TODO: Implement this?? */
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-07-07 17:59:02 UTC (rev 9946)
+++ trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java 2007-07-07 18:33:03 UTC (rev 9947)
@@ -337,12 +337,6 @@
* {@inheritDoc}
*/
public void render(final SvgArea area) {
- final StringBuilder buffer = new StringBuilder();
- outputGeneratedBy(area, buffer);
- writeStartTag(area, buffer);
- outputAllRectangles(area);
- writeEndTag(area);
- this.outputContentRectangle(area);
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-07 18:44:36
|
Revision: 9948
http://svn.sourceforge.net/foray/?rev=9948&view=rev
Author: victormote
Date: 2007-07-07 11:44:38 -0700 (Sat, 07 Jul 2007)
Log Message:
-----------
Conform to axsl changes renaming interface.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/SVGArea.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/SVGArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/SVGArea.java 2007-07-07 18:33:03 UTC (rev 9947)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/SVGArea.java 2007-07-07 18:44:38 UTC (rev 9948)
@@ -36,7 +36,7 @@
* An SVGArea represents the <em>reference </em> area that contains the
* content that is in a {@link ForeignObjectArea} <em>viewport </em> area.
*/
-public final class SVGArea implements org.axsl.galley.SvgArea {
+public final class SVGArea implements org.axsl.galley.ForeignContentSvg {
/** The parent of this node. */
private ForeignObjectArea parent;
Modified: trunk/foray/foray-render/src/java/org/foray/render/Renderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/Renderer.java 2007-07-07 18:33:03 UTC (rev 9947)
+++ trunk/foray/foray-render/src/java/org/foray/render/Renderer.java 2007-07-07 18:44:38 UTC (rev 9948)
@@ -60,7 +60,7 @@
import org.axsl.galley.Page;
import org.axsl.galley.PageCollection;
import org.axsl.galley.RegionArea;
-import org.axsl.galley.SvgArea;
+import org.axsl.galley.ForeignContentSvg;
import org.axsl.galley.TableArea;
import org.axsl.galley.TableCellArea;
import org.axsl.galley.TextArea;
@@ -430,9 +430,10 @@
}
/**
- * {@inheritDoc}
+ * Render the SVG content of a {@link ForeignObjectArea}.
+ * @param svgContent The SVG content to be rendered.
*/
- public abstract void render(SvgArea area);
+ public abstract void render(ForeignContentSvg svgContent);
/**
* {@inheritDoc}
@@ -443,8 +444,9 @@
this.getLogger().warn("Foreign Object Area has no parsed content");
return;
}
- if (foreignContent instanceof SvgArea) {
- final SvgArea svgArea = (SvgArea) foreignContent;
+ if (foreignContent instanceof ForeignContentSvg) {
+ final ForeignContentSvg svgArea =
+ (ForeignContentSvg) foreignContent;
render(svgArea);
}
}
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-07-07 18:33:03 UTC (rev 9947)
+++ trunk/foray/foray-render/src/java/org/foray/render/awt/AWTRenderer.java 2007-07-07 18:44:38 UTC (rev 9948)
@@ -55,7 +55,7 @@
import org.axsl.galley.GraphicArea;
import org.axsl.galley.LeaderArea;
import org.axsl.galley.Page;
-import org.axsl.galley.SvgArea;
+import org.axsl.galley.ForeignContentSvg;
import org.axsl.galley.TextArea;
import org.axsl.graphic.Graphic;
import org.axsl.graphic.SvgGraphic;
@@ -711,7 +711,7 @@
/**
* {@inheritDoc}
*/
- public void render(final SvgArea area) {
+ public void render(final ForeignContentSvg area) {
final ForeignObjectArea foreign = area.getParent();
final Rectangle2D.Float contentRectangle = new Rectangle2D.Float(
toPoints(foreign.crOriginX()), toPoints(foreign.crOriginY()),
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-07-07 18:33:03 UTC (rev 9947)
+++ trunk/foray/foray-render/src/java/org/foray/render/pcl/PCLRenderer.java 2007-07-07 18:44:38 UTC (rev 9948)
@@ -48,7 +48,7 @@
import org.axsl.galley.GeneralInlineArea;
import org.axsl.galley.GraphicArea;
import org.axsl.galley.Page;
-import org.axsl.galley.SvgArea;
+import org.axsl.galley.ForeignContentSvg;
import org.axsl.graphic.Graphic;
import org.axsl.graphic.GraphicException;
import org.axsl.graphic.SvgGraphic;
@@ -548,7 +548,7 @@
/**
* {@inheritDoc}
*/
- public void render(final SvgArea area) {
+ public void render(final ForeignContentSvg area) {
getLogger().debug("PCLRenderer.renderSVGArea(" + area + ")");
// int x = area.rrOriginX();
// int y = area.rrOriginY();
Modified: trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2007-07-07 18:33:03 UTC (rev 9947)
+++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2007-07-07 18:44:38 UTC (rev 9948)
@@ -50,7 +50,7 @@
import org.axsl.galley.GeneralInlineArea;
import org.axsl.galley.GraphicArea;
import org.axsl.galley.Page;
-import org.axsl.galley.SvgArea;
+import org.axsl.galley.ForeignContentSvg;
import org.axsl.graphic.Graphic;
import org.axsl.graphic.GraphicLink;
import org.axsl.graphic.SvgGraphic;
@@ -279,7 +279,7 @@
/**
* {@inheritDoc}
*/
- public void render(final SvgArea area) {
+ public void render(final ForeignContentSvg area) {
final ForeignObjectArea foreign = area.getParent();
final Rectangle2D.Float contentRectangle = new Rectangle2D.Float(
toPoints(foreign.crOriginX()), toPoints(foreign.crOriginY()),
Modified: trunk/foray/foray-render/src/java/org/foray/render/ps/PSRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/ps/PSRenderer.java 2007-07-07 18:33:03 UTC (rev 9947)
+++ trunk/foray/foray-render/src/java/org/foray/render/ps/PSRenderer.java 2007-07-07 18:44:38 UTC (rev 9948)
@@ -53,7 +53,7 @@
import org.axsl.galley.GraphicArea;
import org.axsl.galley.LeaderArea;
import org.axsl.galley.Page;
-import org.axsl.galley.SvgArea;
+import org.axsl.galley.ForeignContentSvg;
import org.axsl.graphic.EpsGraphic;
import org.axsl.graphic.Graphic;
import org.axsl.graphic.GraphicException;
@@ -493,7 +493,7 @@
/**
* {@inheritDoc}
*/
- public void render(final SvgArea area) {
+ public void render(final ForeignContentSvg area) {
final ForeignObjectArea foreign = area.getParent();
final Rectangle2D.Float contentRectangle = new Rectangle2D.Float(
toPoints(foreign.crOriginX()), toPoints(foreign.crOriginY()),
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-07-07 18:33:03 UTC (rev 9947)
+++ trunk/foray/foray-render/src/java/org/foray/render/svg/SVGRenderer.java 2007-07-07 18:44:38 UTC (rev 9948)
@@ -44,7 +44,7 @@
import org.axsl.galley.GraphicArea;
import org.axsl.galley.LeaderArea;
import org.axsl.galley.Page;
-import org.axsl.galley.SvgArea;
+import org.axsl.galley.ForeignContentSvg;
import org.axsl.galley.TextArea;
import org.axsl.graphic.Graphic;
import org.axsl.graphic.GraphicException;
@@ -559,7 +559,7 @@
/**
* {@inheritDoc}
*/
- public void render(final SvgArea area) {
+ public void render(final ForeignContentSvg area) {
final ForeignObjectArea foreign = area.getParent();
final float x = toPoints(foreign.crOriginX());
final float y = this.pageHeight - toPoints(foreign.crOriginY());
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-07-07 18:33:03 UTC (rev 9947)
+++ trunk/foray/foray-render/src/java/org/foray/render/txt/TXTRenderer.java 2007-07-07 18:44:38 UTC (rev 9948)
@@ -39,7 +39,7 @@
import org.axsl.galley.GeneralInlineArea;
import org.axsl.galley.GraphicArea;
import org.axsl.galley.Page;
-import org.axsl.galley.SvgArea;
+import org.axsl.galley.ForeignContentSvg;
import org.axsl.graphic.Graphic;
import org.axsl.graphic.GraphicException;
import org.axsl.graphic.SvgGraphic;
@@ -503,7 +503,7 @@
/**
* {@inheritDoc}
*/
- public void render(final SvgArea area) {
+ public void render(final ForeignContentSvg area) {
getLogger().debug("TXTRenderer.renderSVGArea(" + area + ")");
/* TODO: Implement this?? */
}
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-07-07 18:33:03 UTC (rev 9947)
+++ trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java 2007-07-07 18:44:38 UTC (rev 9948)
@@ -58,7 +58,7 @@
import org.axsl.galley.NormalBlockArea;
import org.axsl.galley.Page;
import org.axsl.galley.RegionArea;
-import org.axsl.galley.SvgArea;
+import org.axsl.galley.ForeignContentSvg;
import org.axsl.galley.TableArea;
import org.axsl.galley.TableCellArea;
import org.axsl.galley.TextArea;
@@ -336,7 +336,7 @@
/**
* {@inheritDoc}
*/
- public void render(final SvgArea area) {
+ public void render(final ForeignContentSvg area) {
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-07 20:19:25
|
Revision: 9951
http://svn.sourceforge.net/foray/?rev=9951&view=rev
Author: victormote
Date: 2007-07-07 13:19:22 -0700 (Sat, 07 Jul 2007)
Log Message:
-----------
1. Conform to axsl changes effectively adding reference area information to ExternalGraphicArea.
2. Use new reference area information to scale and clip external graphics properly.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/ExternalGraphicArea.java
trunk/foray/foray-render/src/java/org/foray/render/Renderer.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/ExternalGraphicArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/ExternalGraphicArea.java 2007-07-07 19:58:17 UTC (rev 9950)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/ExternalGraphicArea.java 2007-07-07 20:19:22 UTC (rev 9951)
@@ -242,4 +242,18 @@
this.parent = this.validateNewParent(node);
}
+ /**
+ * {@inheritDoc}
+ */
+ public int referenceIpd() {
+ return this.traitGeneratedBy().referenceIpd(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int referenceBpd() {
+ return this.traitGeneratedBy().referenceBpd(this);
+ }
+
}
Modified: trunk/foray/foray-render/src/java/org/foray/render/Renderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/Renderer.java 2007-07-07 19:58:17 UTC (rev 9950)
+++ trunk/foray/foray-render/src/java/org/foray/render/Renderer.java 2007-07-07 20:19:22 UTC (rev 9951)
@@ -416,12 +416,13 @@
public void render(final ExternalGraphicArea area) {
final Graphic graphic = area.getGraphic();
if (graphic == null) {
- getLogger().error("(Render) ImageArea contains no graphic.");
- return;
+ throw new NullPointerException("Null graphic.");
}
final Rectangle contentRect = new Rectangle(area.crOriginX(),
+ area.crOriginY(), area.referenceIpd(), area.referenceBpd());
+ final Rectangle clipRect = new Rectangle(area.crOriginX(),
area.crOriginY(), area.crIpd(), area.crBpd());
- drawGraphic(area, graphic, contentRect, null);
+ drawGraphic(area, graphic, contentRect, clipRect);
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-07 23:57:21
|
Revision: 9952
http://svn.sourceforge.net/foray/?rev=9952&view=rev
Author: victormote
Date: 2007-07-07 16:57:16 -0700 (Sat, 07 Jul 2007)
Log Message:
-----------
Stub in an implementation of axslSpeech.
Modified Paths:
--------------
trunk/foray/foray-app/.classpath
trunk/foray/foray-app/src/java/org/foray/app/FOraySpecific.java
trunk/foray/foray-core/.classpath
trunk/foray/foray-core/src/java/org/foray/core/FOrayDocument.java
trunk/foray/foray-core/src/java/org/foray/core/FOraySession.java
trunk/foray/foray-fotree/.classpath
trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
Added Paths:
-----------
trunk/foray/foray-speech/
trunk/foray/foray-speech/.checkstyle
trunk/foray/foray-speech/.classpath
trunk/foray/foray-speech/.project
trunk/foray/foray-speech/.settings/
trunk/foray/foray-speech/.settings/org.eclipse.jdt.core.prefs
trunk/foray/foray-speech/src/
trunk/foray/foray-speech/src/java/
trunk/foray/foray-speech/src/java/org/
trunk/foray/foray-speech/src/java/org/foray/
trunk/foray/foray-speech/src/java/org/foray/speech/
trunk/foray/foray-speech/src/java/org/foray/speech/SpeechServer4a.java
trunk/foray/foray-speech/src/java/org/foray/speech/Voice4a.java
trunk/foray/foray-speech/src/java/org/foray/speech/package.html
Modified: trunk/foray/foray-app/.classpath
===================================================================
--- trunk/foray/foray-app/.classpath 2007-07-07 20:19:22 UTC (rev 9951)
+++ trunk/foray/foray-app/.classpath 2007-07-07 23:57:16 UTC (rev 9952)
@@ -40,5 +40,7 @@
<classpathentry kind="lib" path="/FOray Lib/xercesImpl-2.7.1.jar"/>
<classpathentry kind="lib" path="/FOray Lib/xml-apis-1.3.02.jar"/>
<classpathentry kind="lib" path="/FOray Lib/commons-logging-1.1.jar" sourcepath="/FOray Lib-Build/commons-logging/commons-logging-1.1-src.zip"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/axslSpeech"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/FOraySpeech"/>
<classpathentry kind="output" path="build/eclipse"/>
</classpath>
Modified: trunk/foray/foray-app/src/java/org/foray/app/FOraySpecific.java
===================================================================
--- trunk/foray/foray-app/src/java/org/foray/app/FOraySpecific.java 2007-07-07 20:19:22 UTC (rev 9951)
+++ trunk/foray/foray-app/src/java/org/foray/app/FOraySpecific.java 2007-07-07 23:57:16 UTC (rev 9952)
@@ -38,6 +38,7 @@
import org.foray.fotree.FOrayFOTreeServer;
import org.foray.graphic.FOrayGraphicServer;
import org.foray.pioneer.PioneerFactory;
+import org.foray.speech.SpeechServer4a;
import org.axsl.area.AreaTreeFactory;
import org.axsl.fo.FoTreeFactory;
@@ -46,6 +47,7 @@
import org.axsl.graphic.GraphicServer;
import org.axsl.hyphen.HyphenationServer;
import org.axsl.layout.LayoutFactory;
+import org.axsl.speech.SpeechServer;
import org.axsl.text.TextServer;
import org.apache.commons.logging.Log;
@@ -102,9 +104,10 @@
FOraySpecific.makeAreaTreeFactory(logger, textServer);
final LayoutFactory layoutFactory = FOraySpecific.makeLayoutFactory(
logger);
+ final SpeechServer speechServer = FOraySpecific.makeSpeechServer();
final FOraySession session = new FOraySession(logger, sessionConfig,
fontServer, hyphenServer, textServer, graphicServer,
- foTreeServer, areaTreeFactory, layoutFactory);
+ speechServer, foTreeServer, areaTreeFactory, layoutFactory);
return session;
}
@@ -247,6 +250,15 @@
}
/**
+ * Make a standard SpeechServer instance for use in FOray.
+ * @return The newly-created SpeechServer instance.
+ * @throws FOrayException For errors creating the server.
+ */
+ public static SpeechServer makeSpeechServer() throws FOrayException {
+ return new SpeechServer4a();
+ }
+
+ /**
* Create a standard entity resolver for use with FOray.
* @param configuration The session configuration.
* @return The newly-created entity resolver, or null if no XML catalog
Modified: trunk/foray/foray-core/.classpath
===================================================================
--- trunk/foray/foray-core/.classpath 2007-07-07 20:19:22 UTC (rev 9951)
+++ trunk/foray/foray-core/.classpath 2007-07-07 23:57:16 UTC (rev 9952)
@@ -16,5 +16,6 @@
<classpathentry kind="lib" path="/FOray Lib/xercesImpl-2.7.1.jar"/>
<classpathentry kind="lib" path="/FOray Lib/xml-apis-1.3.02.jar"/>
<classpathentry kind="lib" path="/FOray Lib/commons-logging-1.1.jar" sourcepath="/FOray Lib-Build/commons-logging/commons-logging-1.1-src.zip"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/axslSpeech"/>
<classpathentry kind="output" path="build/eclipse"/>
</classpath>
Modified: trunk/foray/foray-core/src/java/org/foray/core/FOrayDocument.java
===================================================================
--- trunk/foray/foray-core/src/java/org/foray/core/FOrayDocument.java 2007-07-07 20:19:22 UTC (rev 9951)
+++ trunk/foray/foray-core/src/java/org/foray/core/FOrayDocument.java 2007-07-07 23:57:16 UTC (rev 9952)
@@ -37,6 +37,7 @@
import org.axsl.font.FontServer;
import org.axsl.graphic.GraphicServer;
import org.axsl.layout.LayoutFactory;
+import org.axsl.speech.SpeechServer;
import org.axsl.text.TextServer;
import org.apache.commons.logging.Log;
@@ -277,6 +278,7 @@
throws FOrayException {
this.setTarget(target);
this.treeBuilder.setFontConsumer(this.getFontConsumer());
+ this.treeBuilder.setSpeechServer(this.getSpeechServer());
try {
if (this.jaxpTransformer == null) {
// Regular SAX Input
@@ -396,6 +398,14 @@
}
/**
+ * Returns the SpeechServer for this document.
+ * @return The SpeechServer for this document.
+ */
+ public SpeechServer getSpeechServer() {
+ return session.getSpeechServer();
+ }
+
+ /**
* Returns the TextServer for this document.
* @return The TextServer for this document.
*/
Modified: trunk/foray/foray-core/src/java/org/foray/core/FOraySession.java
===================================================================
--- trunk/foray/foray-core/src/java/org/foray/core/FOraySession.java 2007-07-07 20:19:22 UTC (rev 9951)
+++ trunk/foray/foray-core/src/java/org/foray/core/FOraySession.java 2007-07-07 23:57:16 UTC (rev 9952)
@@ -35,6 +35,7 @@
import org.axsl.graphic.GraphicServer;
import org.axsl.hyphen.HyphenationServer;
import org.axsl.layout.LayoutFactory;
+import org.axsl.speech.SpeechServer;
import org.axsl.text.TextServer;
import org.apache.commons.logging.Log;
@@ -79,6 +80,9 @@
/** A TextServer instance to be used for this session. */
private TextServer textServer;
+ /** A SpeechServer instance to be used for this session. */
+ private SpeechServer speechServer;
+
/** A GraphicServer instance to be used for this session. */
private GraphicServer graphicServer;
@@ -118,6 +122,8 @@
* be used for this session. If null is passed, then a GraphicServer
* instance will be created by this FOray Session. If an instance is passed,
* it needs to be fully configured and ready to be used.
+ * @param speechServer The SpeechServer instance that should
+ * be used for this session.
* @param foTreeFactory The FOTreeFactory that should be used for this
* session.
* @param areaTreeFactory The AreaTreeFactory that should be used for this
@@ -129,6 +135,7 @@
public FOraySession(final Log logger, final SessionConfig configuration,
final FontServer fontServer, final HyphenationServer hyphenServer,
final TextServer textServer, final GraphicServer graphicServer,
+ final SpeechServer speechServer,
final FoTreeFactory foTreeFactory,
final AreaTreeFactory areaTreeFactory,
final LayoutFactory layoutFactory) throws FOrayException {
@@ -193,6 +200,13 @@
+ "FOraySession.");
}
this.layoutFactory = layoutFactory;
+
+ /* Validate the SpeechServer. */
+ if (speechServer == null) {
+ throw new FOrayException("SpeechServer required for "
+ + "FOraySession.");
+ }
+ this.speechServer = speechServer;
}
/**
@@ -254,6 +268,14 @@
}
/**
+ * Returns the speech server.
+ * @return The speech server.
+ */
+ public SpeechServer getSpeechServer() {
+ return this.speechServer;
+ }
+
+ /**
* Returns the TextServer.
* @return The TextServer.
*/
Modified: trunk/foray/foray-fotree/.classpath
===================================================================
--- trunk/foray/foray-fotree/.classpath 2007-07-07 20:19:22 UTC (rev 9951)
+++ trunk/foray/foray-fotree/.classpath 2007-07-07 23:57:16 UTC (rev 9952)
@@ -12,5 +12,6 @@
<classpathentry kind="lib" path="/FOray Lib-Build/junit/junit.jar"/>
<classpathentry kind="lib" path="/FOray Lib/commons-logging-1.1.jar" sourcepath="/FOray Lib-Build/commons-logging/commons-logging-1.1-src.zip"/>
<classpathentry kind="lib" path="/FOray Lib/svg-1.1.jar" sourcepath="/FOray Lib-Build/svg/svg-1.1-src.zip"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/axslSpeech"/>
<classpathentry kind="output" path="build/eclipse"/>
</classpath>
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java 2007-07-07 20:19:22 UTC (rev 9951)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FOTreeBuilder.java 2007-07-07 23:57:16 UTC (rev 9952)
@@ -42,6 +42,7 @@
import org.axsl.fo.FoTreeListener;
import org.axsl.font.FontConsumer;
import org.axsl.graphic.GraphicServer;
+import org.axsl.speech.SpeechServer;
import org.axsl.text.TextServer;
import org.apache.commons.logging.Log;
@@ -97,6 +98,9 @@
/** The font consumer. */
private FontConsumer fontConsumer;
+ /** The speech server. */
+ private SpeechServer speechServer;
+
/** The paths to search when looking for graphics. */
private URL[] graphicSearchPath;
@@ -522,6 +526,13 @@
}
/**
+ * {@inheritDoc}
+ */
+ public void setSpeechServer(final SpeechServer server) {
+ this.speechServer = server;
+ }
+
+ /**
* Returns the font consumer.
* @return The font consumer.
*/
@@ -530,6 +541,14 @@
}
/**
+ * Returns the speech server.
+ * @return The speech server.
+ */
+ public SpeechServer getSpeechServer() {
+ return this.speechServer;
+ }
+
+ /**
* {@inheritDoc}
*/
public void setGraphicSearchPath(final URL[] graphicSearchPath) {
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-07-07 20:19:22 UTC (rev 9951)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-07-07 23:57:16 UTC (rev 9952)
@@ -106,6 +106,8 @@
import org.axsl.font.FontUse;
import org.axsl.graphic.Graphic;
import org.axsl.graphic.GraphicServer;
+import org.axsl.speech.SpeechServer;
+import org.axsl.speech.Voice;
import org.axsl.text.TextServer;
import org.axsl.text.line.LineText;
@@ -533,6 +535,14 @@
}
/**
+ * Returns the speech server.
+ * @return The speech server.
+ */
+ public SpeechServer getSpeechServer() {
+ return getFOTreeBuilder().getSpeechServer();
+ }
+
+ /**
* Returns the graphic server being used by this tree.
* @return The graphic server being used by this tree.
*/
@@ -3474,6 +3484,13 @@
/**
* {@inheritDoc}
*/
+ public Voice getVoice(final FoContext context) {
+ return propertyList.getVoice(this, context);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
public FontUse getPrimaryFont(final FoContext context) {
return propertyList.getPrimaryFont(this, context);
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-07-07 20:19:22 UTC (rev 9951)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-07-07 23:57:16 UTC (rev 9952)
@@ -236,6 +236,9 @@
import org.axsl.font.FontConsumer;
import org.axsl.font.FontException;
import org.axsl.graphic.Graphic;
+import org.axsl.speech.SpeechException;
+import org.axsl.speech.SpeechServer;
+import org.axsl.speech.Voice;
import org.xml.sax.Attributes;
@@ -310,6 +313,29 @@
}
/**
+ * Returns the voice.
+ * @param fobj The FObj to which the property belongs.
+ * @param context An object that knows how to resolve FO Tree context
+ * issues.
+ * @return The resolved voice for the object.
+ */
+ public Voice getVoice(final FObj fobj, final FoContext context) {
+ /* Don't spend the memory to cache this value. First, it is not
+ * generally used right now. Second, it is (for now anyway) relatively
+ * inexpensive to compute. */
+ final SpeechServer speechServer = fobj.getSpeechServer();
+ final String[] familyList = this.getVoiceFamily(fobj, context);
+ Voice selectedVoice = null;
+ try {
+ selectedVoice = speechServer.selectVoiceXsl(familyList);
+ } catch (final SpeechException e) {
+ fobj.getLogger().error("Error creating Voice.\n"
+ + fobj.getContextMessage());
+ }
+ return selectedVoice;
+ }
+
+ /**
* Returns the primary font.
* @param fobj The FObj to which the property belongs.
* @param context An object that knows how to resolve FO Tree context
Property changes on: trunk/foray/foray-speech
___________________________________________________________________
Name: svn:ignore
+ build
Added: trunk/foray/foray-speech/.checkstyle
===================================================================
--- trunk/foray/foray-speech/.checkstyle (rev 0)
+++ trunk/foray/foray-speech/.checkstyle 2007-07-07 23:57:16 UTC (rev 9952)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<fileset-config file-format-version="1.2.0" simple-config="true">
+ <fileset name="all" enabled="true" check-config-name="FOray Checkstyle" local="false">
+ <file-match-pattern match-pattern="." include-pattern="true"/>
+ </fileset>
+</fileset-config>
Added: trunk/foray/foray-speech/.classpath
===================================================================
--- trunk/foray/foray-speech/.classpath (rev 0)
+++ trunk/foray/foray-speech/.classpath 2007-07-07 23:57:16 UTC (rev 9952)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src/java"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/axslSpeech"/>
+ <classpathentry kind="output" path="build/eclipse"/>
+</classpath>
Added: trunk/foray/foray-speech/.project
===================================================================
--- trunk/foray/foray-speech/.project (rev 0)
+++ trunk/foray/foray-speech/.project 2007-07-07 23:57:16 UTC (rev 9952)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>FOraySpeech</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.atlassw.tools.eclipse.checkstyle.CheckstyleBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>com.atlassw.tools.eclipse.checkstyle.CheckstyleNature</nature>
+ </natures>
+</projectDescription>
Added: trunk/foray/foray-speech/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/foray/foray-speech/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/foray/foray-speech/.settings/org.eclipse.jdt.core.prefs 2007-07-07 23:57:16 UTC (rev 9952)
@@ -0,0 +1,62 @@
+#Tue Mar 20 11:12:52 MDT 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nullReference=ignore
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.5
Added: trunk/foray/foray-speech/src/java/org/foray/speech/SpeechServer4a.java
===================================================================
--- trunk/foray/foray-speech/src/java/org/foray/speech/SpeechServer4a.java (rev 0)
+++ trunk/foray/foray-speech/src/java/org/foray/speech/SpeechServer4a.java 2007-07-07 23:57:16 UTC (rev 9952)
@@ -0,0 +1,95 @@
+/*
+ * Copyright 2007 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+
+package org.foray.speech;
+
+import org.axsl.speech.SpeechException;
+import org.axsl.speech.SpeechServer;
+import org.axsl.speech.Voice;
+
+/**
+ * The FOray implementation of {@link SpeechServer}.
+ */
+public class SpeechServer4a implements SpeechServer {
+
+ /** The default male voice. The medium frequency used to create this voice
+ * (120 Hz) is derived from the CSS specification for the "pitch"
+ * property. */
+ public static final Voice4a DEFAULT_VOICE_MALE = new Voice4a(120);
+
+ /** The default female voice. The medium frequency used to create this voice
+ * (210 Hz) is derived from the CSS specification for the "pitch"
+ * property.*/
+ public static final Voice4a DEFAULT_VOICE_FEMALE = new Voice4a(210);
+
+ /** The default child voice. The medium frequency used to create this voice
+ * (270 Hz) is estimated relative to that for the female voice (210 Hz). */
+ public static final Voice4a DEFAULT_VOICE_CHILD = new Voice4a(270);
+
+ /** The voice to be used when no other can be found. */
+ public static final Voice4a DEFAULT_VOICE = DEFAULT_VOICE_MALE;
+
+ /**
+ * Constructor.
+ */
+ public SpeechServer4a() {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Voice selectVoiceXsl(final String[] familyList)
+ throws SpeechException {
+ return selectVoiceCss(familyList);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Voice selectVoiceCss(final String[] familyList)
+ throws SpeechException {
+ if (familyList == null) {
+ return SpeechServer4a.DEFAULT_VOICE;
+ } else {
+ for (int i = 0; i < familyList.length; i++) {
+ final String familyToUse = familyList[i];
+ if ("male".equalsIgnoreCase(familyToUse)) {
+ return SpeechServer4a.DEFAULT_VOICE_MALE;
+ }
+ if ("female".equalsIgnoreCase(familyToUse)) {
+ return SpeechServer4a.DEFAULT_VOICE_FEMALE;
+ }
+ if ("child".equalsIgnoreCase(familyToUse)) {
+ return SpeechServer4a.DEFAULT_VOICE_CHILD;
+ }
+ }
+ }
+ return SpeechServer4a.DEFAULT_VOICE;
+ }
+
+}
Property changes on: trunk/foray/foray-speech/src/java/org/foray/speech/SpeechServer4a.java
___________________________________________________________________
Name: svn:keywords
+ "Author Id Rev Date URL"
Name: svn:eol-style
+ native
Added: trunk/foray/foray-speech/src/java/org/foray/speech/Voice4a.java
===================================================================
--- trunk/foray/foray-speech/src/java/org/foray/speech/Voice4a.java (rev 0)
+++ trunk/foray/foray-speech/src/java/org/foray/speech/Voice4a.java 2007-07-07 23:57:16 UTC (rev 9952)
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2007 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+
+package org.foray.speech;
+
+import org.axsl.speech.Voice;
+
+/**
+ * The FOray implementation of {@link Voice}.
+ */
+public class Voice4a implements Voice {
+
+ /** The default factor by which the "medium" pitch should be adjusted to
+ * compute the extra-low frequencey. */
+ private static final float FACTOR_EXTRA_LOW = .8f;
+ /* TODO: This is a pure guess. Find some better way of estimating. */
+
+ /** The default factor by which the "medium" pitch should be adjusted to
+ * compute the low frequencey. */
+ private static final float FACTOR_LOW = .9f;
+ /* TODO: This is a pure guess. Find some better way of estimating. */
+
+ /** The default factor by which the "medium" pitch should be adjusted to
+ * compute the high frequencey. */
+ private static final float FACTOR_HIGH = 1.1f;
+ /* TODO: This is a pure guess. Find some better way of estimating. */
+
+ /** The default factor by which the "medium" pitch should be adjusted to
+ * compute the extra-high frequencey. */
+ private static final float FACTOR_EXTRA_HIGH = 1.2f;
+ /* TODO: This is a pure guess. Find some better way of estimating. */
+
+ /** The normal pitch for the "medium" frequency for this voice. */
+ private float pitchMedium;
+
+ /**
+ * Constructor.
+ * @param pitchMedium The normal pitch for the "medium" frequency for this
+ * voice.
+ */
+ public Voice4a(final float pitchMedium) {
+ this.pitchMedium = pitchMedium;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public float pitchExtraLow() {
+ return this.pitchMedium * FACTOR_EXTRA_LOW;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public float pitchLow() {
+ return this.pitchMedium * FACTOR_LOW;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public float pitchMedium() {
+ return this.pitchMedium;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public float pitchHigh() {
+ return this.pitchMedium * FACTOR_HIGH;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public float pitchExtraHigh() {
+ return this.pitchMedium * FACTOR_EXTRA_HIGH;
+ }
+
+}
Property changes on: trunk/foray/foray-speech/src/java/org/foray/speech/Voice4a.java
___________________________________________________________________
Name: svn:keywords
+ "Author Id Rev Date URL"
Name: svn:eol-style
+ native
Added: trunk/foray/foray-speech/src/java/org/foray/speech/package.html
===================================================================
--- trunk/foray/foray-speech/src/java/org/foray/speech/package.html (rev 0)
+++ trunk/foray/foray-speech/src/java/org/foray/speech/package.html 2007-07-07 23:57:16 UTC (rev 9952)
@@ -0,0 +1,6 @@
+<HTML>
+<TITLE>org.foray.speech Package</TITLE>
+<BODY>
+<P>Classes used for integrating document systems with speech systems.</P>
+</BODY>
+</HTML>
\ No newline at end of file
Property changes on: trunk/foray/foray-speech/src/java/org/foray/speech/package.html
___________________________________________________________________
Name: svn:keywords
+ "Author Id Rev Date URL"
Name: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-09 15:22:01
|
Revision: 9954
http://svn.sourceforge.net/foray/?rev=9954&view=rev
Author: victormote
Date: 2007-07-09 08:22:01 -0700 (Mon, 09 Jul 2007)
Log Message:
-----------
Add new speech module to the build.
Modified Paths:
--------------
trunk/foray/foray-app/scripts/build.xml
trunk/foray/scripts/build.xml
Added Paths:
-----------
trunk/foray/foray-speech/scripts/
trunk/foray/foray-speech/scripts/build.xml
Modified: trunk/foray/foray-app/scripts/build.xml
===================================================================
--- trunk/foray/foray-app/scripts/build.xml 2007-07-08 00:13:12 UTC (rev 9953)
+++ trunk/foray/foray-app/scripts/build.xml 2007-07-09 15:22:01 UTC (rev 9954)
@@ -41,6 +41,9 @@
<fileset dir="${foray.sandbox}/foray-font/build/ant">
<include name="*.jar"/>
</fileset>
+ <fileset dir="${foray.sandbox}/foray-speech/build/ant">
+ <include name="*.jar"/>
+ </fileset>
<fileset dir="${foray.sandbox}/foray-ps/build/ant">
<include name="*.jar"/>
</fileset>
Added: trunk/foray/foray-speech/scripts/build.xml
===================================================================
--- trunk/foray/foray-speech/scripts/build.xml (rev 0)
+++ trunk/foray/foray-speech/scripts/build.xml 2007-07-09 15:22:01 UTC (rev 9954)
@@ -0,0 +1,151 @@
+<?xml version="1.0"?>
+<!-- $Id$ -->
+
+<project default="package" basedir=".">
+
+ <import file="../../scripts/build-common.xml"/>
+
+ <!-- =================================================================== -->
+ <!-- Initialization target -->
+ <!-- =================================================================== -->
+ <target name="init" depends="env, common-init">
+ <property name="module" value="speech"/>
+ <property name="module.dir" value="${foray.sandbox}/foray-${module}"/>
+ <property name="src.dir" value="${module.dir}/src/java"/>
+ <property name="build.dir" value="${module.dir}/build/ant"/>
+ <property name="classes.dir" value="${build.dir}/classes"/>
+ <property name="jar.file"
+ location="${build.dir}/${name.lowercase}-${module}-${version}.jar"/>
+
+ <path id="libs-build-classpath">
+ <fileset dir="${axsl.build}">
+ <include name="**/axsl*.jar"/>
+ </fileset>
+ <fileset dir="${lib.dir}">
+ <include name="axsl*.jar"/>
+ </fileset>
+ <fileset dir="${foray.sandbox}/foray-common/build/ant">
+ <include name="*.jar"/>
+ </fileset>
+ </path>
+
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- Prepares the build directory -->
+ <!-- =================================================================== -->
+ <target name="prepare" depends="init">
+ <!-- create directories -->
+ <echo message="Preparing the build directories"/>
+ <mkdir dir="${build.dir}"/>
+ <mkdir dir="${classes.dir}"/>
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- Prepares the source code -->
+ <!-- =================================================================== -->
+ <target name="prepare-src"
+ depends="prepare">
+ <!-- copy src files -->
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- Compiles the source directory -->
+ <!-- =================================================================== -->
+ <target name="compile" depends="prepare-src">
+ <echo message="Compiling the sources "/>
+ <!-- create directories -->
+ <mkdir dir="${build.dir}"/>
+ <javac destdir="${classes.dir}"
+ debug="${debug}"
+ deprecation="${deprecation}"
+ optimize="${optimize}"
+ source="${source}"
+ >
+ <src path="${src.dir}"/>
+ <classpath refid="libs-build-classpath"/>
+ </javac>
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- Creates the class package -->
+ <!-- =================================================================== -->
+ <target name="package" depends="compile"
+ description="Generates the jar files (default target)">
+ <echo message="Creating the jar file ${jar.file}"/>
+
+ <tstamp>
+ <format property="ts" pattern="yyyyMMdd-HHmmss-z"/>
+ </tstamp>
+ <jar jarfile="${jar.file}"
+ basedir="${classes.dir}"
+ >
+ <manifest>
+ <attribute name="Implementation-Title" value="${name}-${module}"/>
+ <attribute name="Implementation-Version" value="${version}"/>
+ <attribute name="Implementation-Vendor"
+ value="${contact.info}"/>
+ </manifest>
+ </jar>
+
+ </target>
+
+ <target name="javadoc-api" depends="init" description="Creates API
+ documentation">
+ <echo message="Producing the javadoc files "/>
+ <mkdir dir="${build.dir}/javadoc-api"/>
+ <javadoc
+ packagenames="org.foray.speech"
+ sourcepath="${src.dir}/java"
+ destdir="${build.dir}/javadoc-api"
+ classpathref="libs-build-classpath"
+ author="true"
+ version="true"
+ windowtitle="FOray Speech Integration API"
+ doctitle="FOray Speech Integration API"
+ bottom="Copyright © 2007 The FOray Project. All Rights Reserved."
+ overview="${src.dir}/java/org/foray/speech/overview.html"
+ use="true"
+ access="public"
+ failonerror="true">
+ <classpath refid="libs-build-classpath"/>
+ <classpath>
+ <fileset dir="${lib.dir}">
+ <include name="ant*.jar"/>
+ </fileset>
+ </classpath>
+ </javadoc>
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- Clean targets -->
+ <!-- =================================================================== -->
+ <target name="clean" depends="init" description="Cleans the build directory">
+ <delete dir="${build.dir}"/>
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- Checkstyle -->
+ <!-- =================================================================== -->
+ <target name="style" depends="package" description="Runs checkstyle"
+ if="checkstyle.home">
+ <taskdef name="checkstyle"
+ classname="com.puppycrawl.tools.checkstyle.CheckStyleTask">
+ <classpath>
+ <fileset dir="${checkstyle.home}">
+ <include name="checkstyle-all-*.jar"/>
+ </fileset>
+ </classpath>
+ </taskdef>
+ <checkstyle config="../../scripts/checkstyle-config.xml">
+ <fileset dir="${src.dir}" includes="**/*.java"/>
+ <classpath>
+ <path refid="libs-build-classpath"/>
+ <path location="${jar.file}"/>
+ </classpath>
+ </checkstyle>
+ </target>
+
+</project>
+
+<!-- Last Line of Script. -->
Property changes on: trunk/foray/foray-speech/scripts/build.xml
___________________________________________________________________
Name: svn:keywords
+ "Author Id Rev Date URL"
Name: svn:eol-style
+ native
Modified: trunk/foray/scripts/build.xml
===================================================================
--- trunk/foray/scripts/build.xml 2007-07-08 00:13:12 UTC (rev 9953)
+++ trunk/foray/scripts/build.xml 2007-07-09 15:22:01 UTC (rev 9954)
@@ -31,6 +31,7 @@
<mkdir dir="${foray.sandbox}/foray-ps/build/ant/classes"/>
<mkdir dir="${foray.sandbox}/foray-pdf/build/ant/classes"/>
<mkdir dir="${foray.sandbox}/foray-font/build/ant/classes"/>
+ <mkdir dir="${foray.sandbox}/foray-speech/build/ant/classes"/>
<mkdir dir="${foray.sandbox}/foray-hyphen-r/build/ant/classes"/>
<mkdir dir="${foray.sandbox}/foray-hyphen-r/build/ant"/>
<mkdir dir="${foray.sandbox}/foray-text/build/ant/classes"/>
@@ -100,6 +101,10 @@
dir="${foray.sandbox}/foray-font/build/ant/classes">
<include name="**"/>
</fileset>
+ <fileset id="foray-speech-classes"
+ dir="${foray.sandbox}/foray-speech/build/ant/classes">
+ <include name="**"/>
+ </fileset>
<fileset id="foray-hyphen-classes"
dir="${foray.sandbox}/foray-hyphen-r/build/ant/classes">
<include name="**"/>
@@ -150,6 +155,7 @@
<fileset refid="foray-ps-classes"/>
<fileset refid="foray-pdf-classes"/>
<fileset refid="foray-font-classes"/>
+ <fileset refid="foray-speech-classes"/>
<fileset refid="foray-hyphen-classes"/>
<fileset refid="foray-text-classes"/>
<fileset refid="foray-fotree-classes"/>
@@ -271,6 +277,7 @@
<fileset dir="${foray.sandbox}/foray-pretty/build/ant" includes="foray*.jar"/>
<fileset dir="${foray.sandbox}/foray-ps/build/ant" includes="foray*.jar"/>
<fileset dir="${foray.sandbox}/foray-render/build/ant" includes="foray*.jar"/>
+ <fileset dir="${foray.sandbox}/foray-speech/build/ant" includes="foray*.jar"/>
<fileset dir="${foray.sandbox}/foray-text/build/ant" includes="foray*.jar"/>
<fileset dir="${lib.dir}" includes="**"/>
@@ -379,6 +386,7 @@
<pathelement path="${foray.sandbox}/foray-ps/src/java"/>
<pathelement path="${foray.sandbox}/foray-graphic/src/java"/>
<pathelement path="${foray.sandbox}/foray-font/src/java"/>
+ <pathelement path="${foray.sandbox}/foray-speech/src/java"/>
<pathelement path="${foray.sandbox}/foray-hyphen-r/src/java"/>
<pathelement path="${foray.sandbox}/foray-fotree/src/java"/>
<pathelement path="${foray.sandbox}/foray-areatree/src/java"/>
@@ -416,6 +424,10 @@
<package name="org.foray.font"/>
<package name="org.foray.font.*"/>
</group>
+ <group title="The FOray Speech Module">
+ <package name="org.foray.speech"/>
+ <package name="org.foray.speech.*"/>
+ </group>
<group title="The FOray Hyphenation Module">
<package name="org.foray.hyphenR"/>
<package name="org.foray.hyphenR.*"/>
@@ -510,6 +522,10 @@
inheritall="false"
target="clean"/>
+ <ant antfile="${foray.sandbox}/foray-speech/scripts/build.xml"
+ inheritall="false"
+ target="clean"/>
+
<ant antfile="${foray.sandbox}/foray-hyphen-r/scripts/build.xml"
inheritall="false"
target="clean"/>
@@ -577,6 +593,9 @@
<ant antfile="${foray.sandbox}/foray-font/scripts/build.xml"
inheritall="false"
target="style"/>
+ <ant antfile="${foray.sandbox}/foray-speech/scripts/build.xml"
+ inheritall="false"
+ target="style"/>
<ant antfile="${foray.sandbox}/foray-hyphen-r/scripts/build.xml"
inheritall="false"
target="style"/>
@@ -690,6 +709,19 @@
</target>
<!-- =================================================================== -->
+ <!-- Build the Speech module -->
+ <!-- =================================================================== -->
+ <target name="speech" depends="common"
+ description="Compile the speech module">
+ <property name="module.speech" value=", speech"/>
+ <ant antfile="${foray.sandbox}/foray-speech/scripts/build.xml"
+ inheritall="false"
+ target="style">
+ <property name="foray.config" value="${foray.config}"/>
+ </ant>
+ </target>
+
+ <!-- =================================================================== -->
<!-- Build the Hyphen module -->
<!-- =================================================================== -->
<target name="hyphen" depends="common"
@@ -821,7 +853,7 @@
Build the App module (unadvertised)
=================================================================== -->
<target name="app" depends="prepare, pretty, ps, graphic, mif, font, hyphen,
- text, pdf, fotree, areatree, pioneer, render, core">
+ speech, text, pdf, fotree, areatree, pioneer, render, core">
<property name="module.app" value=", app"/>
<property name="file.subset" value="-all"/>
<ant antfile="${foray.sandbox}/foray-app/scripts/build.xml"
@@ -845,6 +877,7 @@
<property name="module.graphic" value=""/>
<property name="module.mif" value=""/>
<property name="module.font" value=""/>
+ <property name="module.speech" value=""/>
<property name="module.hyphen" value=""/>
<property name="module.text" value=""/>
<property name="module.pdf" value=""/>
@@ -863,11 +896,11 @@
<property name="module.list2"
value="${module.mif}${module.font}${module.hyphen}${module.text}"/>
<property name="module.list3"
- value="${module.pdf}${module.fotree}${module.areatree}${module.output}"/>
+ value="${module.pdf}${module.speech}"/>
<property name="module.list4"
- value="${module.layout}${module.pioneer}${module.render}${module.core}"/>
+ value="$${module.fotree}${module.areatree}${module.output}{module.layout}"/>
<property name="module.list5"
- value="${module.app}"/>
+ value="${module.pioneer}${module.render}${module.core}${module.app}"/>
<!-- Now group them all together. -->
<property name="module.list" value=
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-09 17:16:39
|
Revision: 9957
http://svn.sourceforge.net/foray/?rev=9957&view=rev
Author: victormote
Date: 2007-07-09 10:16:38 -0700 (Mon, 09 Jul 2007)
Log Message:
-----------
Rename module (for Eclipse) for clarity.
Modified Paths:
--------------
trunk/foray/foray-app/.classpath
trunk/foray/foray-hyphen-r/.project
Modified: trunk/foray/foray-app/.classpath
===================================================================
--- trunk/foray/foray-app/.classpath 2007-07-09 17:16:08 UTC (rev 9956)
+++ trunk/foray/foray-app/.classpath 2007-07-09 17:16:38 UTC (rev 9957)
@@ -29,7 +29,7 @@
<classpathentry combineaccessrules="false" kind="src" path="/FOrayCore"/>
<classpathentry combineaccessrules="false" kind="src" path="/axslOutput"/>
<classpathentry combineaccessrules="false" kind="src" path="/axslHyphen"/>
- <classpathentry combineaccessrules="false" kind="src" path="/FOrayHyphen-R"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/FOrayHyphen"/>
<classpathentry combineaccessrules="false" kind="src" path="/FOrayPS"/>
<classpathentry kind="lib" path="/FOray Lib-Build/junit/junit.jar"/>
<classpathentry kind="lib" path="/FOray Lib/commons-io-1.2.jar" sourcepath="/FOray Lib-Build/commons-io/commons-io-1.2-src.zip"/>
Modified: trunk/foray/foray-hyphen-r/.project
===================================================================
--- trunk/foray/foray-hyphen-r/.project 2007-07-09 17:16:08 UTC (rev 9956)
+++ trunk/foray/foray-hyphen-r/.project 2007-07-09 17:16:38 UTC (rev 9957)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>FOrayHyphen-R</name>
+ <name>FOrayHyphen</name>
<comment></comment>
<projects>
</projects>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-09 17:20:57
|
Revision: 9958
http://svn.sourceforge.net/foray/?rev=9958&view=rev
Author: victormote
Date: 2007-07-09 10:21:00 -0700 (Mon, 09 Jul 2007)
Log Message:
-----------
Rename directory for clarity and consistency.
Added Paths:
-----------
trunk/foray/foray-hyphen/
Removed Paths:
-------------
trunk/foray/foray-hyphen-r/
Copied: trunk/foray/foray-hyphen (from rev 9957, trunk/foray/foray-hyphen-r)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2007-07-09 20:26:13
|
Revision: 9960
http://svn.sourceforge.net/foray/?rev=9960&view=rev
Author: victormote
Date: 2007-07-09 13:26:12 -0700 (Mon, 09 Jul 2007)
Log Message:
-----------
Move source package name for clarity and consistency.
Modified Paths:
--------------
trunk/foray/foray-app/src/java/org/foray/app/FOraySpecific.java
trunk/foray/foray-app/src/javatest/org/foray/app/TestFOrayAll.java
trunk/foray/foray-hyphen/src/java/org/foray/hyphen/util/NatLangParser.java
trunk/foray/foray-hyphen/src/java/org/foray/hyphen/util/NaturalLanguage.java
trunk/foray/foray-hyphen/src/java/org/foray/hyphen/util/ValidateChars.java
trunk/foray/foray-hyphen/src/java/org/foray/hyphen/util/WordList.java
trunk/foray/foray-hyphen/src/javatest/org/foray/hyphen/util/TestNaturalLanguage.java
trunk/foray/foray-hyphen/src/javatest/org/foray/hyphen/util/TestWordList.java
Added Paths:
-----------
trunk/foray/foray-hyphen/src/java/org/foray/hyphen/
trunk/foray/foray-hyphen/src/java/org/foray/hyphen/ByteVector.java
trunk/foray/foray-hyphen/src/java/org/foray/hyphen/CharVector.java
trunk/foray/foray-hyphen/src/java/org/foray/hyphen/FOrayHyphenBreak.java
trunk/foray/foray-hyphen/src/java/org/foray/hyphen/FOrayHyphenation.java
trunk/foray/foray-hyphen/src/java/org/foray/hyphen/FOrayHyphenationServer.java
trunk/foray/foray-hyphen/src/java/org/foray/hyphen/HyphenationTree.java
trunk/foray/foray-hyphen/src/java/org/foray/hyphen/MorphHyphenation.java
trunk/foray/foray-hyphen/src/java/org/foray/hyphen/PatternConsumer.java
trunk/foray/foray-hyphen/src/java/org/foray/hyphen/PatternGenerator.java
trunk/foray/foray-hyphen/src/java/org/foray/hyphen/PatternParser.java
trunk/foray/foray-hyphen/src/java/org/foray/hyphen/SerializeHyphPattern.java
trunk/foray/foray-hyphen/src/java/org/foray/hyphen/TernaryTree.java
trunk/foray/foray-hyphen/src/java/org/foray/hyphen/package.html
trunk/foray/foray-hyphen/src/java/org/foray/hyphen/util/
trunk/foray/foray-hyphen/src/javatest/org/foray/hyphen/
trunk/foray/foray-hyphen/src/javatest/org/foray/hyphen/TestFOrayHyphenR.java
trunk/foray/foray-hyphen/src/javatest/org/foray/hyphen/TestFOrayHyphenationServer.java
trunk/foray/foray-hyphen/src/javatest/org/foray/hyphen/TestTernaryTree.java
trunk/foray/foray-hyphen/src/javatest/org/foray/hyphen/util/
Removed Paths:
-------------
trunk/foray/foray-hyphen/src/java/org/foray/hyphenR/
trunk/foray/foray-hyphen/src/javatest/org/foray/hyphenR/
Modified: trunk/foray/foray-app/src/java/org/foray/app/FOraySpecific.java
===================================================================
--- trunk/foray/foray-app/src/java/org/foray/app/FOraySpecific.java 2007-07-09 20:15:02 UTC (rev 9959)
+++ trunk/foray/foray-app/src/java/org/foray/app/FOraySpecific.java 2007-07-09 20:26:12 UTC (rev 9960)
@@ -171,7 +171,7 @@
final SessionConfig configuration) {
final URL hyphenationDir =
configuration.optionHyphenationBaseDirectory();
- return new org.foray.hyphenR.FOrayHyphenationServer(logger,
+ return new org.foray.hyphen.FOrayHyphenationServer(logger,
hyphenationDir);
}
Modified: trunk/foray/foray-app/src/javatest/org/foray/app/TestFOrayAll.java
===================================================================
--- trunk/foray/foray-app/src/javatest/org/foray/app/TestFOrayAll.java 2007-07-09 20:15:02 UTC (rev 9959)
+++ trunk/foray/foray-app/src/javatest/org/foray/app/TestFOrayAll.java 2007-07-09 20:26:12 UTC (rev 9960)
@@ -33,7 +33,7 @@
import org.foray.font.TestFOrayFont;
import org.foray.fotree.TestFOrayFOTree;
import org.foray.graphic.TestFOrayGraphic;
-import org.foray.hyphenR.TestFOrayHyphenR;
+import org.foray.hyphen.TestFOrayHyphenR;
import org.foray.ps.TestFOrayPS;
import org.foray.render.TestFOrayRender;
Copied: trunk/foray/foray-hyphen/src/java/org/foray/hyphen/ByteVector.java (from rev 9958, trunk/foray/foray-hyphen/src/java/org/foray/hyphenR/ByteVector.java)
===================================================================
--- trunk/foray/foray-hyphen/src/java/org/foray/hyphen/ByteVector.java (rev 0)
+++ trunk/foray/foray-hyphen/src/java/org/foray/hyphen/ByteVector.java 2007-07-09 20:26:12 UTC (rev 9960)
@@ -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$
+ */
+
+/*
+ * Known Contributors:
+ * Carlos Villegas <ca...@un...> (Original author)
+ */
+
+package org.foray.hyphen;
+
+import java.io.Serializable;
+
+/**
+ * A vector of bytes.
+ */
+public class ByteVector implements Serializable {
+
+ /** Constant needed for serialization. */
+ static final long serialVersionUID = 977379027446677063L;
+
+ /** Default Capacity increment size. */
+ private static final int DEFAULT_BLOCK_SIZE = 2048;
+
+ /** Capacity increment size. */
+ private int blockSize = DEFAULT_BLOCK_SIZE;
+
+ /** The encapsulated array. */
+ private byte[] backingArray;
+
+ /** Index to to the next free item in {@link #backingArray}. */
+ private int nextIndex;
+
+ /**
+ * No-argument constructor.
+ */
+ public ByteVector() {
+ this(DEFAULT_BLOCK_SIZE);
+ }
+
+ /**
+ * Constructor.
+ * @param capacity The initial capacity, in bytes, of the new vector.
+ */
+ public ByteVector(final int capacity) {
+ if (capacity > 0) {
+ blockSize = capacity;
+ } else {
+ blockSize = DEFAULT_BLOCK_SIZE;
+ }
+ backingArray = new byte[blockSize];
+ nextIndex = 0;
+ }
+
+ /**
+ * Returns the number of items in the vector.
+ * @return The number of items in the vector.
+ */
+ public int length() {
+ return nextIndex;
+ }
+
+ /**
+ * Returns the current capacity of the vector.
+ * @return The currect capacity of the vector.
+ */
+ public int capacity() {
+ return backingArray.length;
+ }
+
+ /**
+ * Place an item in the vector at a specific index.
+ * @param index The 0-based index into the vector.
+ * @param val The byte value to be placed in the vector.
+ */
+ public void put(final int index, final byte val) {
+ backingArray[index] = val;
+ }
+
+ /**
+ * Retrieve a value from a specific index in the vector.
+ * @param index The 0-based index whose value should be returned.
+ * @return The value at <code>index</code>.
+ */
+ public byte get(final int index) {
+ return backingArray[index];
+ }
+
+ /**
+ * Allocates or uses a specified number of elements (bytes).
+ * If needed, this method automatically increases the vector's capacity.
+ * @param size The number of elements (bytes) to be allocated.
+ * @return The index to the beginning of the allocated elements (bytes).
+ */
+ public int alloc(final int size) {
+ final int index = nextIndex;
+ if (nextIndex + size >= backingArray.length) {
+ final byte[] newArray = new byte[backingArray.length + blockSize];
+ System.arraycopy(backingArray, 0, newArray, 0, backingArray.length);
+ backingArray = newArray;
+ }
+ nextIndex += size;
+ return index;
+ }
+
+ /**
+ * Sets the capacity of this vector equal to its size, to that there is no
+ * unused capacity.
+ */
+ public void trimToSize() {
+ if (nextIndex < backingArray.length) {
+ final byte[] aux = new byte[nextIndex];
+ System.arraycopy(backingArray, 0, aux, 0, nextIndex);
+ backingArray = aux;
+ }
+ }
+
+}
Copied: trunk/foray/foray-hyphen/src/java/org/foray/hyphen/CharVector.java (from rev 9958, trunk/foray/foray-hyphen/src/java/org/foray/hyphenR/CharVector.java)
===================================================================
--- trunk/foray/foray-hyphen/src/java/org/foray/hyphen/CharVector.java (rev 0)
+++ trunk/foray/foray-hyphen/src/java/org/foray/hyphen/CharVector.java 2007-07-09 20:26:12 UTC (rev 9960)
@@ -0,0 +1,161 @@
+/*
+ * 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$
+ */
+
+/*
+ * Known Contributors:
+ * Carlos Villegas <ca...@un...> (Original author)
+ */
+package org.foray.hyphen;
+
+import java.io.Serializable;
+
+/**
+ * A vector of chars with access to the underlying array.
+ */
+public class CharVector implements Cloneable, Serializable {
+
+ /** Constant used for serialization. */
+ private static final long serialVersionUID = 234670840738701586L;
+
+ /** Default Capacity increment size. */
+ private static final int DEFAULT_BLOCK_SIZE = 2048;
+
+ /** Capacity increment size. */
+ private int blockSize;
+
+ /** The encapsulated array. */
+ private char[] backingArray;
+
+ /** Points to the next free item. */
+ private int nextIndex;
+
+ /**
+ * No-argument constructor.
+ */
+ public CharVector() {
+ this(DEFAULT_BLOCK_SIZE);
+ }
+
+ /**
+ * Constructor.
+ * @param capacity The initial capacity, in chars, of the new vector.
+ */
+ public CharVector(final int capacity) {
+ if (capacity > 0) {
+ blockSize = capacity;
+ } else {
+ blockSize = DEFAULT_BLOCK_SIZE;
+ }
+ backingArray = new char[blockSize];
+ nextIndex = 0;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Object clone() {
+ final CharVector clone = new CharVector();
+ clone.backingArray = new char[this.nextIndex];
+ System.arraycopy(this.backingArray, 0, clone.backingArray, 0,
+ this.nextIndex);
+ clone.nextIndex = this.nextIndex;
+ return clone;
+ }
+
+ /**
+ * Returns the array backing this vector.
+ * @return the array backing this vector.
+ */
+ public char[] getArray() {
+ return backingArray;
+ }
+
+ /**
+ * Returns the number of items in the vector.
+ * @return The number of items in the vector.
+ */
+ public int length() {
+ return nextIndex;
+ }
+
+ /**
+ * Returns the current capacity of the vector.
+ * @return The currect capacity of the vector.
+ */
+ public int capacity() {
+ return backingArray.length;
+ }
+
+ /**
+ * Place an item in the vector at a specific index.
+ * @param index The 0-based index into the vector.
+ * @param val The char value to be placed in the vector.
+ */
+ public void put(final int index, final char val) {
+ backingArray[index] = val;
+ }
+
+ /**
+ * Retrieve a value from a specific index in the vector.
+ * @param index The 0-based index whose value should be returned.
+ * @return The value at <code>index</code>.
+ */
+ public char get(final int index) {
+ return backingArray[index];
+ }
+
+ /**
+ * Allocates or uses a specified number of elements (chars).
+ * If needed, this method automatically increases the vector's capacity.
+ * @param size The number of elements (chars) to be allocated.
+ * @return The index to the beginning of the allocated elements (chars).
+ */
+ public int alloc(final int size) {
+ final int index = nextIndex;
+ if (nextIndex + size >= backingArray.length) {
+ final char[] newArray = new char[backingArray.length + blockSize];
+ System.arraycopy(backingArray, 0, newArray, 0, backingArray.length);
+ backingArray = newArray;
+ }
+ nextIndex += size;
+ return index;
+ }
+
+ /**
+ * Sets the capacity of this vector equal to its size, to that there is no
+ * unused capacity.
+ */
+ public void trimToSize() {
+ if (nextIndex < backingArray.length) {
+ final char[] aux = new char[nextIndex];
+ System.arraycopy(backingArray, 0, aux, 0, nextIndex);
+ backingArray = aux;
+ }
+ }
+
+}
Copied: trunk/foray/foray-hyphen/src/java/org/foray/hyphen/FOrayHyphenBreak.java (from rev 9958, trunk/foray/foray-hyphen/src/java/org/foray/hyphenR/FOrayHyphenBreak.java)
===================================================================
--- trunk/foray/foray-hyphen/src/java/org/foray/hyphen/FOrayHyphenBreak.java (rev 0)
+++ trunk/foray/foray-hyphen/src/java/org/foray/hyphen/FOrayHyphenBreak.java 2007-07-09 20:26:12 UTC (rev 9960)
@@ -0,0 +1,143 @@
+/*
+ * 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$
+ */
+
+/*
+ * Known contributors:
+ * Carlos Villegas <ca...@un...> (Original author), who credited
+ * TeX for the basic scheme.
+ */
+
+package org.foray.hyphen;
+
+import org.foray.common.WKConstants;
+
+import org.axsl.hyphen.HyphenBreak;
+
+import java.io.Serializable;
+
+/**
+ * <p>Specialized information about a specific hyphenation break opportunity in
+ * a word.
+ * This handles "hard" hyphenation cases, such as those where the word changes
+ * spelling when it is hyphenated.
+ * See {@link org.axsl.hyphen.HyphenBreak} for more information about the
+ * general use of this class.</p>
+ *
+ * <p>A 'full' hyphen is made of 3 parts:
+ * the pre-break text, post-break text and no-break. If no line-break
+ * is generated at this position, the no-break text is used, otherwise,
+ * pre-break and post-break are used. Typically, pre-break is equal to
+ * the hyphen character and the others are empty.</p>
+ */
+public class FOrayHyphenBreak implements Serializable, HyphenBreak {
+
+ /** Constant needed for serialization. */
+ private static final long serialVersionUID = 990405609314441965L;
+
+ /** The pre-break text. */
+ private String preBreak;
+
+ /** The no-break text. */
+ private String noBreak;
+
+ /** The post-break text. */
+ private String postBreak;
+
+ /**
+ * Constructor.
+ * @param pre The pre-break text.
+ * @param no The no-break text (can be null).
+ * @param post The post-break text (can be null).
+ */
+ FOrayHyphenBreak(final String pre, final String no, final String post) {
+ preBreak = pre;
+ noBreak = no;
+ postBreak = post;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String toString() {
+ if (noBreak == null
+ && postBreak == null
+ && preBreak != null
+ && preBreak.equals("-")) {
+ return "-";
+ }
+ final StringBuilder res = new StringBuilder("{");
+ res.append(preBreak);
+ res.append("}{");
+ res.append(postBreak);
+ res.append("}{");
+ res.append(noBreak);
+ res.append('}');
+ return res.toString();
+ }
+
+ /**
+ * Returns the "no break" String.
+ * @return Returns the noBreak.
+ */
+ public String getNoBreak() {
+ return this.noBreak;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String preDelete() {
+ /* TODO: Implement this. */
+ return WKConstants.EMPTY_STRING;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String preInsert() {
+ /* TODO: Implement this. */
+ return WKConstants.EMPTY_STRING;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String postDelete() {
+ /* TODO: Implement this. */
+ return WKConstants.EMPTY_STRING;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String postInsert() {
+ /* TODO: Implement this. */
+ return WKConstants.EMPTY_STRING;
+ }
+
+}
Copied: trunk/foray/foray-hyphen/src/java/org/foray/hyphen/FOrayHyphenation.java (from rev 9958, trunk/foray/foray-hyphen/src/java/org/foray/hyphenR/FOrayHyphenation.java)
===================================================================
--- trunk/foray/foray-hyphen/src/java/org/foray/hyphen/FOrayHyphenation.java (rev 0)
+++ trunk/foray/foray-hyphen/src/java/org/foray/hyphen/FOrayHyphenation.java 2007-07-09 20:26:12 UTC (rev 9960)
@@ -0,0 +1,205 @@
+/*
+ * 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$
+ */
+
+/*
+ * Known contributors:
+ * Carlos Villegas <ca...@un...> (original author)
+ */
+
+package org.foray.hyphen;
+
+import org.axsl.hyphen.HyphenBreak;
+import org.axsl.hyphen.HyphenationException;
+
+import java.io.Serializable;
+
+/**
+ * This class represents a hyphenated word.
+ */
+public class FOrayHyphenation implements org.axsl.hyphen.Hyphenation,
+ Serializable {
+
+ /** Constant needed for serialization. */
+ static final long serialVersionUID = -576778461126231672L;
+
+ /** The word being hyphenated. */
+ private String word;
+
+ /** The hyphenation points for the word. See {@link #hyphenValues} for the
+ * weights. */
+ private byte[] hyphenPoints;
+
+ /** The Liang weights that correspond to {@link #hyphenPoints}. */
+ private byte[] hyphenValues;
+
+ /**
+ * Constructor for already-computed hyphenation points.
+ * @param word The word being hyphenated.
+ * @param points The hyphenation points for the word.
+ * @param values The Liang weights that correspond to
+ * <code>hyphenPoints</code>.
+ */
+ FOrayHyphenation(final String word, final byte[] points,
+ final byte[] values) {
+ this.word = word;
+ this.hyphenPoints = points;
+ this.hyphenValues = values;
+ }
+
+ /**
+ * Factory class to create the correct variant of this class.
+ * @param word The word being hyphenated.
+ * @param points The hyphenation points for the word.
+ * @param values The Liang weights that correspond to
+ * <code>hyphenPoints</code>.
+ * @param qtySpecialBreaks The number of morphing breaks that will be
+ * added to this hyphenation.
+ * @return The newly created {@link FOrayHyphenation} variant.
+ */
+ static FOrayHyphenation makeHyphenation(final String word,
+ final byte[] points, final byte[] values,
+ final int qtySpecialBreaks) {
+ if (qtySpecialBreaks > 0) {
+ try {
+ return new MorphHyphenation(word, points, values,
+ qtySpecialBreaks);
+ } catch (final HyphenationException e) {
+ /* Ignore this. It can't happen. */
+ }
+ }
+ return new FOrayHyphenation(word, points, values);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public byte[] getPoints() {
+ return this.hyphenPoints;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public byte[] getLiangWeights() {
+ return this.hyphenValues;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public byte[] getWeights() {
+ if (this.hyphenValues == null) {
+ return null;
+ }
+ final byte[] returnArray = new byte[this.hyphenValues.length];
+ for (int i = 0; i < this.hyphenValues.length; i++) {
+ final byte value = this.hyphenValues[i];
+ try {
+ returnArray[i] = convertLiangToWeight(value);
+ } catch (final HyphenationException e) {
+ /* TODO: This exception should be passed upstream further. */
+ returnArray[i] = Byte.MIN_VALUE;
+ }
+ }
+ return returnArray;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String toString() {
+ final StringBuilder str = new StringBuilder();
+ int start = 0;
+ for (int i = 0; i < hyphenPoints.length; i++) {
+ str.append(word.substring(start, hyphenPoints[i]) + "-");
+ start = hyphenPoints[i];
+ }
+ str.append(word.substring(start));
+ return str.toString();
+ }
+
+ /**
+ * Converts the raw value from the Liang data to a weighted value.
+ * In the Liang system, 1) even values are negative, 2) odd values are
+ * positive, and the magnitude of the number conveys the magnitude of
+ * the direction.
+ * @param liangValue Any positive byte value that contains a Liang-style
+ * algorithm weight. (Liang input is only in the range 0 to 5, but we will
+ * handle any positive input).
+ * @return A value that reflects the numeric weight of the raw Liang value.
+ * @throws HyphenationException For an invalid <code>liangValue</code>.
+ */
+ public static byte convertLiangToWeight(final byte liangValue)
+ throws HyphenationException {
+ if (liangValue < 0) {
+ throw new HyphenationException("Invalid Liang input: "
+ + liangValue);
+ }
+ byte modifiedLiangValue = liangValue;
+ /* Save the low-order bit. */
+ final boolean good = (modifiedLiangValue & 1) == 1;
+ modifiedLiangValue ++;
+ modifiedLiangValue /= 2;
+ if (! good) {
+ modifiedLiangValue *= -1;
+ }
+ return modifiedLiangValue;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public HyphenBreak getHyphenBreak(final int index) {
+ /* Not supported by this class. See {@link MorphHyphenation} where this
+ * is implemented. */
+ return null;
+ }
+
+ /**
+ * Takes exception input like "oblig-a-tory" and converts it to the
+ * unhyphenated equivalent, that is "obligatory", so that it can be used
+ * for searches on input words.
+ * @param exceptionWord The hyphenated exception.
+ * @param hyphenationChar The character used in the exception to signify
+ * a hyphenation opportunity. This may be different from the character used
+ * to show the hyphenation point in the output.
+ * @return The unhyphenated equivalent of <code>exceptionWord</code>.
+ */
+ public static String normalizeException(final String exceptionWord,
+ final char hyphenationChar) {
+ final StringBuilder builder = new StringBuilder();
+ for (int j = 0; j < exceptionWord.length(); j++) {
+ final char c = exceptionWord.charAt(j);
+ if (c != hyphenationChar) {
+ builder.append(c);
+ }
+ }
+ return builder.toString();
+ }
+
+}
Copied: trunk/foray/foray-hyphen/src/java/org/foray/hyphen/FOrayHyphenationServer.java (from rev 9958, trunk/foray/foray-hyphen/src/java/org/foray/hyphenR/FOrayHyphenationServer.java)
===================================================================
--- trunk/foray/foray-hyphen/src/java/org/foray/hyphen/FOrayHyphenationServer.java (rev 0)
+++ trunk/foray/foray-hyphen/src/java/org/foray/hyphen/FOrayHyphenationServer.java 2007-07-09 20:26:12 UTC (rev 9960)
@@ -0,0 +1,646 @@
+/*
+ * 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$
+ */
+
+/*
+ * Known contributors:
+ * @author Carlos Villegas <ca...@un...> (original author)
+ */
+
+package org.foray.hyphen;
+
+import org.foray.common.FOrayConstants;
+import org.foray.common.Logging;
+import org.foray.common.url.URLFactory;
+import org.foray.hyphen.util.NatLangParser;
+import org.foray.hyphen.util.NaturalLanguage;
+
+import org.axsl.common.value.Iso3166;
+import org.axsl.common.value.Iso639;
+import org.axsl.hyphen.HyphenationException;
+
+import org.apache.commons.logging.Log;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.lang.reflect.Method;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * This class is the main entry point to the hyphenation package.
+ */
+public class FOrayHyphenationServer
+ implements org.axsl.hyphen.HyphenationServer {
+
+ /** The path to the hyphenation patterns. */
+ public static final String PATTERN_RESOURCE_PATH =
+ "org/foray/hyphenR/resource/patterns";
+
+ /** Standard text for some user messages. */
+ private static final String PATTERN_MISSING_TEXT =
+ "Hyphenation pattern not found: ";
+
+ /** The logger. */
+ private Log logger;
+
+ /**
+ * Collection of HyphenationTree instances that have been successfully
+ * deserialized or parsed. The key is the language or language and country
+ * connected by an underscore (e.g. en_US).
+ */
+ private Map<String, HyphenationTree> hyphenTrees
+ = new HashMap<String, HyphenationTree>();
+
+ /**
+ * Collection of language and language_country combinations for which we
+ * already know we can't instantiate a HyphenationTree. This is used to
+ * log only one error message per language.
+ */
+ private List<String> hyphenTreesNotFound = new ArrayList<String>();
+
+ /** The hyphenation directory. */
+ private URL hyphenationDir;
+
+ /** Map of all Natural Language instances. */
+ private Map<Iso639, NaturalLanguage> languages =
+ new HashMap<Iso639, NaturalLanguage>();
+
+ /**
+ * Constructor.
+ * @param logger The Log instance for user messages. Null can safely be
+ * passed here as a default logger will be created by the server.
+ * @param hyphenationDir The base URL for hyphenation patterns.
+ */
+ public FOrayHyphenationServer(final Log logger, final URL hyphenationDir) {
+ if (logger == null) {
+ this.logger = Logging.makeDefaultLogger();
+ } else {
+ this.logger = logger;
+ }
+ this.hyphenationDir = hyphenationDir;
+ }
+
+ /**
+ * The main search algorithm.
+ * @param rawLanguageCode The language code for which a hyphenation tree is
+ * needed.
+ * @param rawCountryCode The country code for which a hyphenation tree is
+ * needed. This is a differentiator between hyphenation schemes within the
+ * same language, and may be null.
+ * @return The hyphenation tree if it exists, or null otherwise.
+ * @throws HyphenationException For errors retrieving the hyphenation tree.
+ */
+ private HyphenationTree getHyphenationTree(final Iso639 rawLanguageCode,
+ final Iso3166 rawCountryCode) throws Hyphenation...
[truncated message content] |