[FOray-commit] SF.net SVN: foray: [8600] trunk/foray
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2007-02-05 17:01:44
|
Revision: 8600
http://svn.sourceforge.net/foray/?rev=8600&view=rev
Author: victormote
Date: 2007-02-05 08:26:30 -0800 (Mon, 05 Feb 2007)
Log Message:
-----------
Conform to axsl changes for converting an integral enumeration to a typesafe enum.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/Area.java
trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/MainRA.java
trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java
trunk/foray/foray-areatree/src/java/org/foray/area/TableCellRA.java
trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/FOText.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/Property.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ConditionalPageMasterReference.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageNumberGenerator.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbsoluteDimension.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbsoluteOffset.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AlignmentAdjust.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AlignmentBaseline.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AudioDial.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Azimuth.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Background.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BackgroundColor.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BackgroundImage.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BackgroundPosition.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BaselineShift.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Boolean.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Border.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderColor.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderPrecedence.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderSeparation.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderStyle.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderWidth.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/CaseTitle.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Character.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Clip.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Color.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ColumnCount.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ColumnGap.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ColumnNumber.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ColumnWidth.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ContentDimension.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ContentType.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Country.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Cue.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/DestinationPlacementOffset.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/DisplayAlign.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/DominantBaseline.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Elevation.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Enumerated.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Extent.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ExternalDestination.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Font.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontFamily.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontSize.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontSizeAdjust.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontStretch.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontStyle.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontVariant.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/FontWeight.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ForcePageCount.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Format.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/GlyphOrientation.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/GroupingSize.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/HyphLadderCount.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/HyphPushCharCount.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/HyphRemainCharCount.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Id.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Indent.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/InitialPageNumber.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/InternalDestination.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Keep.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Language.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/LastLineEndIndent.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/LeaderLength.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/LeaderPatternWidth.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/LetterSpacing.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/LineHeight.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Margin.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/MaximumRepeats.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Name.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/NumberColumnsRepeated.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/NumberColumnsSpanned.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/NumberRowsSpanned.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Orphans.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Padding.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/PageDimension.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Pause.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Pitch.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/PlayDuring.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ProvDistanceBetween.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ProvLabelSeparation.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/RefId.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/RegionName.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/RelativeDimension.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/RelativeSpace.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Role.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/RuleThickness.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Script.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Size.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/SourceDocument.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/SpeechRate.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Src.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/SwitchTo.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/TableLayout.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/TargetPresentationContext.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/TargetProcessingContext.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/TargetStylesheet.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/TextAlign.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/TextAlignLast.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/TextAltitude.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/TextDecoration.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/TextDepth.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/TextIndent.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/TextShadow.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/TreatAsWordSpace.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/VerticalAlign.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/VoiceFamily.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Volume.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Widows.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/WordSpacing.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/WritingMode.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ZIndex.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtLengthConditional.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtRectangle.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtSpace.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/value/PropertyKeyword.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/xml/prop/Lang.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/Status.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/TableRowPL.java
trunk/foray/foray-render/src/java/org/foray/render/PrintRenderer.java
trunk/foray/foray-render/src/java/org/foray/render/Renderer.java
trunk/foray/foray-render/src/java/org/foray/render/awt/AWTRenderer.java
trunk/foray/foray-render/src/java/org/foray/render/pcl/PCLRenderer.java
trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java
trunk/foray/foray-render/src/java/org/foray/render/ps/PSRenderer.java
trunk/foray/foray-render/src/java/org/foray/render/svg/SVGRenderer.java
trunk/foray/foray-render/src/java/org/foray/render/txt/TXTRenderer.java
trunk/foray/foray-render/src/java/org/foray/render/xml/XMLRenderer.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/Area.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2007-02-03 18:08:39 UTC (rev 8599)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2007-02-05 16:26:30 UTC (rev 8600)
@@ -74,7 +74,7 @@
super(generatedBy, parentArea, retrieveMarker);
}
- public int traitBackgroundRepeat() {
+ public FoValue traitBackgroundRepeat() {
return this.traitGeneratedBy().traitBackgroundRepeat(this);
}
@@ -193,11 +193,11 @@
return traitGeneratedBy().traitBackgroundColor(this);
}
- public short traitRelativePosition() {
+ public FoValue traitRelativePosition() {
return traitGeneratedBy().traitRelativePosition(this);
}
- public short traitAbsolutePosition() {
+ public FoValue traitAbsolutePosition() {
return traitGeneratedBy().traitAbsolutePosition(this);
}
@@ -980,29 +980,33 @@
return traitGeneratedBy().isRAGenerator();
}
- public short traitReferenceOrientation() {
+ public FoValue traitReferenceOrientation() {
return traitGeneratedBy().traitReferenceOrientation(this);
}
public short referenceOrientationCumulative() {
- final Area containingRA = this.getContainingReferenceArea();
- short cumulative = containingRA.traitReferenceOrientation();
+ /* TODO: This needs to be rewritten. There is a mismatch between the
+ * FoValue items returned and the "degrees" concept that needs to be
+ * resolved. */
+ return 0;
+// final Area containingRA = this.getContainingReferenceArea();
+// short cumulative = containingRA.traitReferenceOrientation();
/*
* The FObj method from which the following line is derived returns
* a 0 for FOs that do not generate reference-areas.
*/
- cumulative += this.traitReferenceOrientation();
- if (cumulative < 0) {
- cumulative += WKConstants.DEGREES_PER_CIRCLE;
- }
- return (short) (cumulative % WKConstants.DEGREES_PER_CIRCLE);
+// cumulative += this.traitReferenceOrientation();
+// if (cumulative < 0) {
+// cumulative += WKConstants.DEGREES_PER_CIRCLE;
+// }
+// return (short) (cumulative % WKConstants.DEGREES_PER_CIRCLE);
}
public int traitExtent() {
return traitGeneratedBy().traitExtent();
}
- public short traitWhiteSpaceTreatment() {
+ public FoValue traitWhiteSpaceTreatment() {
return traitGeneratedBy().traitWhiteSpaceTreatment(this);
}
@@ -1014,7 +1018,7 @@
return this.isLastChildOfGeneratedBy();
}
- public short traitWrapOption() {
+ public FoValue traitWrapOption() {
return traitGeneratedBy().traitWrapOption(this);
}
@@ -1022,19 +1026,19 @@
return traitGeneratedBy().traitLanguage(this);
}
- public short traitScaling() {
+ public FoValue traitScaling() {
return traitGeneratedBy().traitScaling(this);
}
- public short traitTextAlign() {
+ public FoValue traitTextAlign() {
return traitGeneratedBy().traitTextAlign(this);
}
- public short traitAlignmentBaseline() {
+ public FoValue traitAlignmentBaseline() {
return traitGeneratedBy().traitAlignmentBaseline(this);
}
- public short traitOverflow() {
+ public FoValue traitOverflow() {
return traitGeneratedBy().traitOverflow(this);
}
@@ -1133,8 +1137,8 @@
public boolean backgroundRepeatX() {
switch (traitBackgroundRepeat()) {
- case FoValue.REPEAT_Y:
- case FoValue.NO_REPEAT: {
+ case REPEAT_Y:
+ case NO_REPEAT: {
return false;
}
}
@@ -1143,8 +1147,8 @@
public boolean backgroundRepeatY() {
switch (traitBackgroundRepeat()) {
- case FoValue.REPEAT_X:
- case FoValue.NO_REPEAT: {
+ case REPEAT_X:
+ case NO_REPEAT: {
return false;
}
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java 2007-02-03 18:08:39 UTC (rev 8599)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java 2007-02-05 16:26:30 UTC (rev 8600)
@@ -102,7 +102,7 @@
* unintended side-effects of this override logic.
* @see FObj#traitLeaderPattern
*/
- public short traitLeaderPattern() {
+ public FoValue traitLeaderPattern() {
if (traitGeneratedBy().traitLeaderPattern(this) == FoValue.RULE
&& traitGeneratedBy().traitRuleThickness(this) <= 0) {
return FoValue.SPACE;
@@ -123,7 +123,7 @@
* Pass-thru of the FOTree trait value.
* @see FObj#traitLeaderAlignment
*/
- public short traitLeaderAlignment() {
+ public FoValue traitLeaderAlignment() {
return traitGeneratedBy().traitLeaderAlignment(this);
}
@@ -131,7 +131,7 @@
* Pass-thru of the FOTree trait value.
* @see FObj#traitRuleStyle
*/
- public short traitRuleStyle() {
+ public FoValue traitRuleStyle() {
return traitGeneratedBy().traitRuleStyle(this);
}
@@ -191,10 +191,10 @@
*/
public int dotLeaderTextOffset() {
switch (traitLeaderAlignment()) {
- case FoValue.REFERENCE_AREA: {
+ case REFERENCE_AREA: {
break;
}
- case FoValue.PAGE: {
+ case PAGE: {
break;
}
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2007-02-03 18:08:39 UTC (rev 8599)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/LineArea.java 2007-02-05 16:26:30 UTC (rev 8600)
@@ -80,15 +80,15 @@
*/
protected int alignmentAdjustment() {
switch (traitTextAlign()) {
- case FoValue.START:
+ case START:
return 0;
- case FoValue.END:
+ case END:
return this.progressionDimensionAvailable();
- case FoValue.CENTER:
+ case CENTER:
return this.progressionDimensionAvailable() / 2;
- case FoValue.JUSTIFY:
+ case JUSTIFY:
return 0;
- case FoValue.NOT_A_KEYWORD: {
+ case NOT_A_KEYWORD: {
/*
* This is a valid setting, and means that we should find the
* string to align the text on by using
@@ -519,13 +519,13 @@
* that results from aligning the line.
*/
public int startAlignmentAdjustment() {
- final short textAlign = traitGeneratedBy().traitTextAlign(this);
+ final FoValue textAlign = traitGeneratedBy().traitTextAlign(this);
switch (textAlign) {
- case FoValue.END:
- case FoValue.RIGHT: {
+ case END:
+ case RIGHT: {
return totalAlignmentAdjustment();
}
- case FoValue.CENTER: {
+ case CENTER: {
return totalAlignmentAdjustment() / 2;
}
default: {
@@ -697,10 +697,10 @@
* @return One of the following TraitEnumeration constants: START, END,
* CENTER, JUSTIFY.
*/
- public short traitTextAlign() {
- short textAlign = traitGeneratedBy().traitTextAlign(this);
+ public FoValue traitTextAlign() {
+ FoValue textAlign = traitGeneratedBy().traitTextAlign(this);
if (this.textAlignLastApplies()) {
- final short textAlignLast = traitGeneratedBy().traitTextAlignLast(
+ final FoValue textAlignLast = traitGeneratedBy().traitTextAlignLast(
this);
if (textAlignLast == FoValue.RELATIVE) {
if (textAlign == FoValue.JUSTIFY) {
@@ -711,20 +711,20 @@
}
}
switch (textAlign) {
- case FoValue.LEFT: {
+ case LEFT: {
return FoValue.START;
}
- case FoValue.RIGHT: {
+ case RIGHT: {
return FoValue.END;
}
- case FoValue.INSIDE: {
+ case INSIDE: {
if (this.getPage().getBindingEdge()
== Compass.END) {
return FoValue.END;
}
return FoValue.START;
}
- case FoValue.OUTSIDE: {
+ case OUTSIDE: {
if (this.getPage().getBindingEdge()
== Compass.END) {
return FoValue.START;
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/MainRA.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/MainRA.java 2007-02-03 18:08:39 UTC (rev 8599)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/MainRA.java 2007-02-05 16:26:30 UTC (rev 8600)
@@ -71,7 +71,7 @@
public NormalFlowRA getNextArea(final FObj fo) throws AreaWException {
isNewSpanArea = false;
- int span = FoValue.NONE;
+ FoValue span = FoValue.NONE;
if (fo instanceof Block) {
span = ((Block) fo).traitSpan(this);
} else if (fo instanceof BlockContainer) {
@@ -145,7 +145,7 @@
return false;
}
- int span = FoValue.NONE;
+ FoValue span = FoValue.NONE;
if (fo instanceof Block) {
span = ((Block) fo).traitSpan(this);
} else if (fo instanceof BlockContainer) {
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java 2007-02-03 18:08:39 UTC (rev 8599)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java 2007-02-05 16:26:30 UTC (rev 8600)
@@ -277,7 +277,7 @@
public void padPagesAtEnd() throws AreaWException {
final PageSequence pageSeq = getPageSequence();
switch (pageSeq.traitForcePageCount(this)) {
- case FoValue.AUTO: {
+ case AUTO: {
/*
* The standard would seem to imply that force-page-count="auto"
* needs to consider the initial-page-number value for the
@@ -287,25 +287,25 @@
*/
return;
}
- case FoValue.EVEN: {
+ case EVEN: {
if (getPageCount() % 2 != 0) {
makeBlankPage();
}
return;
}
- case FoValue.ODD: {
+ case ODD: {
if (getPageCount() % 2 == 0) {
makeBlankPage();
}
return;
}
- case FoValue.END_ON_EVEN: {
+ case END_ON_EVEN: {
if (getCurrentPageNumber() % 2 != 0) {
makeBlankPage();
}
return;
}
- case FoValue.END_ON_ODD: {
+ case END_ON_ODD: {
if (getCurrentPageNumber() % 2 == 0) {
makeBlankPage();
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TableCellRA.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/TableCellRA.java 2007-02-03 18:08:39 UTC (rev 8599)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/TableCellRA.java 2007-02-05 16:26:30 UTC (rev 8600)
@@ -216,7 +216,7 @@
if (delta <= 0) {
return;
}
- short displayAlign = this.traitGeneratedBy().traitDisplayAlign(
+ FoValue displayAlign = this.traitGeneratedBy().traitDisplayAlign(
this);
if (displayAlign == FoValue.AUTO) {
/* TODO: This is not right. */
@@ -224,16 +224,16 @@
this);
}
switch (displayAlign) {
- case FoValue.CENTER:
+ case CENTER:
/* Increase cell padding before and after. */
this.setCenteringPaddingTop(delta / 2);
this.setCenteringPaddingBottom(delta - delta / 2);
break;
- case FoValue.AFTER:
+ case AFTER:
/* Increase cell padding before. */
this.setCenteringPaddingTop(delta);
break;
- case FoValue.BEFORE:
+ case BEFORE:
/* Increase cell padding after. */
this.setCenteringPaddingBottom(delta);
break;
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java 2007-02-03 18:08:39 UTC (rev 8599)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java 2007-02-05 16:26:30 UTC (rev 8600)
@@ -298,7 +298,7 @@
public static int ignoreAtStart(final char[] chars, final int start,
final int size, final boolean firstItemOnLine,
- final short whiteSpaceTreatment) {
+ final FoValue whiteSpaceTreatment) {
// Only eat leading whitespaces if this is the first item on the line.
if (! firstItemOnLine) {
return 0;
@@ -330,7 +330,7 @@
public static int ignoreAtEnd(final char[] chars, final int start,
final int size, final boolean lastItemOnLine,
- final short whiteSpaceTreatment) {
+ final FoValue whiteSpaceTreatment) {
// Only eat trailing whitespaces if this is the last item on the line.
if (! lastItemOnLine) {
return 0;
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FOText.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/FOText.java 2007-02-03 18:08:39 UTC (rev 8599)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FOText.java 2007-02-05 16:26:30 UTC (rev 8600)
@@ -162,7 +162,8 @@
final char[] charArray = getPreTextTransformText(context);
// Now handle text-transform.
- final short textTransform = effectiveParent.traitTextTransform(context);
+ final FoValue textTransform = effectiveParent.traitTextTransform(
+ context);
if (textTransform != FoValue.NONE) {
for (int i = 0; i < charArray.length; i++) {
charArray[i] = applyTextTransform(context, charArray, i,
@@ -229,15 +230,15 @@
*/
private char applyTextTransform(final FOContext context,
final char[] charArray, final int index,
- final short textTransform) {
+ final FoValue textTransform) {
final char c = charArray[index];
switch (textTransform) {
/* This method not be entered if value is NONE. */
- case FoValue.UPPERCASE:
+ case UPPERCASE:
return Character.toUpperCase(c);
- case FoValue.LOWERCASE:
+ case LOWERCASE:
return Character.toLowerCase(c);
- case FoValue.CAPITALIZE:
+ case CAPITALIZE:
if (isStartOfWord(context, charArray, index)) {
/*
Use toTitleCase here. Apparently, some languages use
@@ -702,7 +703,7 @@
* should therefore never be in the input.
*/
public static char applyWhiteSpaceTreatment(final char[] charArray,
- final int index, final short whiteSpaceTreatment) {
+ final int index, final FoValue whiteSpaceTreatment) {
final char c = charArray[index];
if (! XMLCharacter.isXMLWhitespace(c)) {
/* If it is not whitespace, it cannot be changed. */
@@ -713,13 +714,13 @@
return c;
}
switch (whiteSpaceTreatment) {
- case FoValue.IGNORE: {
+ case IGNORE: {
return DISCARD_CHAR;
}
- case FoValue.PRESERVE: {
+ case PRESERVE: {
return ' ';
}
- case FoValue.IGNORE_IF_BEFORE_LINEFEED: {
+ case IGNORE_IF_BEFORE_LINEFEED: {
// If last element, no change needed.
if (index == charArray.length - 1) {
return c;
@@ -729,7 +730,7 @@
}
return DISCARD_CHAR;
}
- case FoValue.IGNORE_IF_AFTER_LINEFEED: {
+ case IGNORE_IF_AFTER_LINEFEED: {
// If first element, no change needed.
if (index == 0) {
return c;
@@ -784,14 +785,14 @@
* Otherwise, a new char array with the result is returned.
*/
public static char[] applyWhiteSpaceTreatment(final char[] charArray,
- final short inputWhiteSpaceTreatment) {
- short whiteSpaceTreatment = inputWhiteSpaceTreatment;
+ final FoValue inputWhiteSpaceTreatment) {
+ FoValue whiteSpaceTreatment = inputWhiteSpaceTreatment;
switch (whiteSpaceTreatment) {
- case FoValue.IGNORE:
- case FoValue.PRESERVE:
- case FoValue.IGNORE_IF_BEFORE_LINEFEED:
- case FoValue.IGNORE_IF_AFTER_LINEFEED:
- case FoValue.IGNORE_IF_SURROUNDING_LINEFEED: {
+ case IGNORE:
+ case PRESERVE:
+ case IGNORE_IF_BEFORE_LINEFEED:
+ case IGNORE_IF_AFTER_LINEFEED:
+ case IGNORE_IF_SURROUNDING_LINEFEED: {
// These are all valid and need further processing.
break;
}
@@ -838,16 +839,16 @@
}
public static char applyLinefeedTreatment(final char c,
- final short linefeedTreatment) {
+ final FoValue linefeedTreatment) {
assert c == WKConstants.LINEFEED : "Invalid linefeed-treatment input.";
switch (linefeedTreatment) {
- case FoValue.IGNORE: {
+ case IGNORE: {
return DISCARD_CHAR;
}
- case FoValue.TREAT_AS_SPACE: {
+ case TREAT_AS_SPACE: {
return ' ';
}
- case FoValue.TREAT_AS_ZERO_WIDTH_SPACE: {
+ case TREAT_AS_ZERO_WIDTH_SPACE: {
return '\u200b';
}
// default handles the "initial" value of "preserve"
@@ -872,15 +873,15 @@
* result is returned.
*/
public static char[] applyLinefeedTreatment(final char[] charArray,
- final short inputLinefeedTreatment) {
- short linefeedTreatment = inputLinefeedTreatment;
+ final FoValue inputLinefeedTreatment) {
+ FoValue linefeedTreatment = inputLinefeedTreatment;
switch (linefeedTreatment) {
- case FoValue.PRESERVE: {
+ case PRESERVE: {
return charArray;
}
- case FoValue.IGNORE:
- case FoValue.TREAT_AS_SPACE:
- case FoValue.TREAT_AS_ZERO_WIDTH_SPACE: {
+ case IGNORE:
+ case TREAT_AS_SPACE:
+ case TREAT_AS_ZERO_WIDTH_SPACE: {
// These need further processing.
break;
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-02-03 18:08:39 UTC (rev 8599)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-02-05 16:26:30 UTC (rev 8600)
@@ -441,7 +441,7 @@
/**
* {@inheritDoc}
*/
- public short traitWrapOption(final FOContext context) {
+ public FoValue traitWrapOption(final FOContext context) {
return propertyList.getWrapOption(context);
}
@@ -538,7 +538,7 @@
/**
* {@inheritDoc}
*/
- public short traitSpan(final FOContext context) {
+ public FoValue traitSpan(final FOContext context) {
/*
* Only block-level FOs are affected by column-count, so, for all other
* FOs, treat them as if the span trait were "all".
@@ -564,11 +564,11 @@
return propertyList.getRetrieveClassName();
}
- public short traitRetrievePosition() {
+ public FoValue traitRetrievePosition() {
return propertyList.getRetrievePosition();
}
- public short traitRetrieveBoundary() {
+ public FoValue traitRetrieveBoundary() {
return propertyList.getRetrieveBoundary();
}
@@ -587,21 +587,21 @@
/**
* {@inheritDoc}
*/
- public short traitBorderCollapse(final FOContext context) {
+ public FoValue traitBorderCollapse(final FOContext context) {
return propertyList.getBorderCollapse(context);
}
/**
* {@inheritDoc}
*/
- public short traitDisplayAlign(final FOContext context) {
+ public FoValue traitDisplayAlign(final FOContext context) {
return propertyList.getDisplayAlign(context);
}
/**
* {@inheritDoc}
*/
- public short traitRelativeAlign(final FOContext context) {
+ public FoValue traitRelativeAlign(final FOContext context) {
return propertyList.getRelativeAlign(context);
}
@@ -636,7 +636,7 @@
/**
* {@inheritDoc}
*/
- public short traitBreakAfter(final FOContext context) {
+ public FoValue traitBreakAfter(final FOContext context) {
return propertyList.getBreakAfter(context);
}
@@ -707,15 +707,15 @@
return propertyList.getMasterReference();
}
- public short traitPagePosition() {
+ public FoValue traitPagePosition() {
return propertyList.getPagePosition();
}
- public short traitOddOrEven() {
+ public FoValue traitOddOrEven() {
return propertyList.getOddOrEven();
}
- public short traitBlankOrNotBlank() {
+ public FoValue traitBlankOrNotBlank() {
return propertyList.getBlankOrNotBlank();
}
@@ -727,7 +727,7 @@
* {@inheritDoc}
*/
public boolean initialPageNumberSetExplicitly() {
- final short rawInitialPageNumber =
+ final FoValue rawInitialPageNumber =
propertyList.getRawInitialPageNumber();
return rawInitialPageNumber == FoValue.NOT_A_KEYWORD;
}
@@ -744,14 +744,14 @@
return propertyList.getGroupingSize();
}
- public short traitLetterValue() {
+ public FoValue traitLetterValue() {
return propertyList.getLetterValue();
}
/**
* {@inheritDoc}
*/
- public short traitForcePageCount(final FOContext context) {
+ public FoValue traitForcePageCount(final FOContext context) {
return propertyList.getForcePageCount(context);
}
@@ -787,7 +787,7 @@
/**
* {@inheritDoc}
*/
- public short traitOverflow(final FOContext context) {
+ public FoValue traitOverflow(final FOContext context) {
return propertyList.getOverflow(context);
}
@@ -819,7 +819,7 @@
/**
* {@inheritDoc}
*/
- public short traitTextAlign(final FOContext context) {
+ public FoValue traitTextAlign(final FOContext context) {
return propertyList.getTextAlign(context);
}
@@ -833,7 +833,7 @@
/**
* {@inheritDoc}
*/
- public short traitTextAlignLast(final FOContext context) {
+ public FoValue traitTextAlignLast(final FOContext context) {
return propertyList.getTextAlignLast(context);
}
@@ -870,7 +870,7 @@
/**
* {@inheritDoc}
*/
- public short traitSpaceBeforeConditionality(final FOContext context) {
+ public FoValue traitSpaceBeforeConditionality(final FOContext context) {
return propertyList.traitSpaceBeforeConditionality(context);
}
@@ -905,7 +905,7 @@
/**
* {@inheritDoc}
*/
- public short traitSpaceAfterConditionality(final FOContext context) {
+ public FoValue traitSpaceAfterConditionality(final FOContext context) {
return propertyList.traitSpaceAfterConditionality(context);
}
@@ -946,7 +946,7 @@
/**
* {@inheritDoc}
*/
- public short traitSpaceStartConditionality() {
+ public FoValue traitSpaceStartConditionality() {
return propertyList.traitSpaceStartConditionality();
}
@@ -987,7 +987,7 @@
/**
* {@inheritDoc}
*/
- public short traitSpaceEndConditionality() {
+ public FoValue traitSpaceEndConditionality() {
return propertyList.traitSpaceEndConditionality();
}
@@ -1052,21 +1052,21 @@
/**
* {@inheritDoc}
*/
- public short traitBreakBefore(final FOContext context) {
+ public FoValue traitBreakBefore(final FOContext context) {
return propertyList.getBreakBefore(context);
}
/**
* {@inheritDoc}
*/
- public short traitScaling(final FOContext context) {
+ public FoValue traitScaling(final FOContext context) {
return propertyList.getScaling(context);
}
/**
* {@inheritDoc}
*/
- public short traitLeaderPattern(final FOContext context) {
+ public FoValue traitLeaderPattern(final FOContext context) {
return propertyList.getLeaderPattern(context);
}
@@ -1110,7 +1110,7 @@
/**
* {@inheritDoc}
*/
- public short traitRuleStyle(final FOContext context) {
+ public FoValue traitRuleStyle(final FOContext context) {
return propertyList.getRuleStyle(context);
}
@@ -1125,7 +1125,7 @@
/**
* {@inheritDoc}
*/
- public short traitLeaderAlignment(final FOContext context) {
+ public FoValue traitLeaderAlignment(final FOContext context) {
return propertyList.getLeaderAlignment(context);
}
@@ -1139,7 +1139,7 @@
/**
* {@inheritDoc}
*/
- public short traitTableLayout() {
+ public FoValue traitTableLayout() {
return propertyList.getTableLayout();
}
@@ -1324,56 +1324,56 @@
/**
* {@inheritDoc}
*/
- public short traitBorderBeforeStyle(final FOContext context) {
+ public FoValue traitBorderBeforeStyle(final FOContext context) {
return propertyList.getBorderStyle(context, Compass.BEFORE);
}
/**
* {@inheritDoc}
*/
- public short traitBorderAfterStyle(final FOContext context) {
+ public FoValue traitBorderAfterStyle(final FOContext context) {
return propertyList.getBorderStyle(context, Compass.AFTER);
}
/**
* {@inheritDoc}
*/
- public short traitBorderStartStyle(final FOContext context) {
+ public FoValue traitBorderStartStyle(final FOContext context) {
return propertyList.getBorderStyle(context, Compass.START);
}
/**
* {@inheritDoc}
*/
- public short traitBorderEndStyle(final FOContext context) {
+ public FoValue traitBorderEndStyle(final FOContext context) {
return propertyList.getBorderStyle(context, Compass.END);
}
/**
* {@inheritDoc}
*/
- public short traitBorderLeftStyle(final FOContext context) {
+ public FoValue traitBorderLeftStyle(final FOContext context) {
return propertyList.getBorderStyle(context, Compass.LEFT);
}
/**
* {@inheritDoc}
*/
- public short traitBorderRightStyle(final FOContext context) {
+ public FoValue traitBorderRightStyle(final FOContext context) {
return propertyList.getBorderStyle(context, Compass.RIGHT);
}
/**
* {@inheritDoc}
*/
- public short traitBorderTopStyle(final FOContext context) {
+ public FoValue traitBorderTopStyle(final FOContext context) {
return propertyList.getBorderStyle(context, Compass.TOP);
}
/**
* {@inheritDoc}
*/
- public short traitBorderBottomStyle(final FOContext context) {
+ public FoValue traitBorderBottomStyle(final FOContext context) {
return propertyList.getBorderStyle(context, Compass.BOTTOM);
}
@@ -1571,7 +1571,7 @@
/**
* {@inheritDoc}
*/
- public short traitBackgroundRepeat(final FOContext context) {
+ public FoValue traitBackgroundRepeat(final FOContext context) {
return propertyList.getBackgroundRepeat(context);
}
@@ -1627,7 +1627,7 @@
/**
* {@inheritDoc}
*/
- public short traitHalfLeadingConditionality(final FOContext context) {
+ public FoValue traitHalfLeadingConditionality(final FOContext context) {
return propertyList.traitHalfLeadingConditionality(context);
}
@@ -1676,14 +1676,14 @@
/**
* {@inheritDoc}
*/
- public short traitAlignmentBaseline(final FOContext context) {
+ public FoValue traitAlignmentBaseline(final FOContext context) {
return propertyList.traitAlignmentBaseline(context);
}
/**
* {@inheritDoc}
*/
- public short traitAlignmentAdjust(final FOContext context) {
+ public FoValue traitAlignmentAdjust(final FOContext context) {
return propertyList.traitAlignmentAdjust(context);
}
@@ -1706,9 +1706,9 @@
* {@inheritDoc}
*/
public Baseline traitDominantBaseline(final FOContext context) {
- final short rawValue = propertyList.traitDominantBaseline(context);
+ final FoValue rawValue = propertyList.traitDominantBaseline(context);
switch (rawValue) {
- case FoValue.AUTO: {
+ case AUTO: {
if (this.isBlockLevelFO()) {
final String script = this.traitScript(context);
final WritingMode writingMode = this.getWritingMode(context);
@@ -1730,37 +1730,37 @@
context);
}
}
- case FoValue.USE_SCRIPT: {
+ case USE_SCRIPT: {
return this.getBaselineFromScript(context);
}
- case FoValue.NO_CHANGE: {
+ case NO_CHANGE: {
return this.effectiveParent(context).traitDominantBaseline(context);
}
- case FoValue.RESET_SIZE: {
+ case RESET_SIZE: {
return this.effectiveParent(context).traitDominantBaseline(context);
}
- case FoValue.IDEOGRAPHIC: {
+ case IDEOGRAPHIC: {
return Baseline.IDEOGRAPHIC;
}
- case FoValue.ALPHABETIC: {
+ case ALPHABETIC: {
return Baseline.ALPHABETIC;
}
- case FoValue.HANGING: {
+ case HANGING: {
return Baseline.HANGING;
}
- case FoValue.MATHEMATICAL: {
+ case MATHEMATICAL: {
return Baseline.MATHEMATICAL;
}
- case FoValue.CENTRAL: {
+ case CENTRAL: {
return Baseline.CENTRAL;
}
- case FoValue.MIDDLE: {
+ case MIDDLE: {
return Baseline.MIDDLE;
}
- case FoValue.TEXT_AFTER_EDGE: {
+ case TEXT_AFTER_EDGE: {
return Baseline.TEXT_AFTER_EDGE;
}
- case FoValue.TEXT_BEFORE_EDGE: {
+ case TEXT_BEFORE_EDGE: {
return Baseline.TEXT_BEFORE_EDGE;
}
default: {
@@ -1810,7 +1810,7 @@
/**
* {@inheritDoc}
*/
- public short traitLetterSpacingConditionality() {
+ public FoValue traitLetterSpacingConditionality() {
return propertyList.traitLetterSpacingConditionality();
}
@@ -1902,98 +1902,98 @@
/**
* {@inheritDoc}
*/
- public short traitAbsolutePosition(final FOContext context) {
+ public FoValue traitAbsolutePosition(final FOContext context) {
return propertyList.traitAbsolutePosition(context);
}
/**
* {@inheritDoc}
*/
- public short traitBackgroundAttachment(final FOContext context) {
+ public FoValue traitBackgroundAttachment(final FOContext context) {
return propertyList.traitBackgroundAttachment(context);
}
/**
* {@inheritDoc}
*/
- public short traitCaptionSide(final FOContext context) {
+ public FoValue traitCaptionSide(final FOContext context) {
return propertyList.traitCaptionSide(context);
}
/**
* {@inheritDoc}
*/
- public short traitDirection(final FOContext context) {
+ public FoValue traitDirection(final FOContext context) {
return propertyList.traitDirection(context);
}
/**
* {@inheritDoc}
*/
- public short traitFontSelectionStrategy(final FOContext context) {
+ public FoValue traitFontSelectionStrategy(final FOContext context) {
return propertyList.traitFontSelectionStrategy(context);
}
/**
* {@inheritDoc}
*/
- public short traitHyphenationKeep(final FOContext context) {
+ public FoValue traitHyphenationKeep(final FOContext context) {
return propertyList.traitHyphenationKeep(context);
}
/**
* {@inheritDoc}
*/
- public short traitLinefeedTreatment(final FOContext context) {
+ public FoValue traitLinefeedTreatment(final FOContext context) {
return propertyList.traitLinefeedTreatment(context);
}
/**
* {@inheritDoc}
*/
- public short traitLineHeightShiftAdjustment(final FOContext context) {
+ public FoValue traitLineHeightShiftAdjustment(final FOContext context) {
return propertyList.traitLineHeightShiftAdjustment(context);
}
/**
* {@inheritDoc}
*/
- public short traitLineStackingStrategy(final FOContext context) {
+ public FoValue traitLineStackingStrategy(final FOContext context) {
return propertyList.traitLineStackingStrategy(context);
}
/**
* {@inheritDoc}
*/
- public short traitRelativePosition(final FOContext context) {
+ public FoValue traitRelativePosition(final FOContext context) {
return propertyList.traitRelativePosition(context);
}
/**
* {@inheritDoc}
*/
- public short traitScalingMethod(final FOContext context) {
+ public FoValue traitScalingMethod(final FOContext context) {
return propertyList.traitScalingMethod(context);
}
/**
* {@inheritDoc}
*/
- public short traitSuppressAtLineBreak(final FOContext context) {
+ public FoValue traitSuppressAtLineBreak(final FOContext context) {
return propertyList.traitSuppressAtLineBreak(context);
}
/**
* {@inheritDoc}
*/
- public short traitUnicodeBidi(final FOContext context) {
+ public FoValue traitUnicodeBidi(final FOContext context) {
return propertyList.traitUnicodeBidi(context);
}
/**
* {@inheritDoc}
*/
- public short traitWhiteSpaceTreatment(final FOContext context) {
+ public FoValue traitWhiteSpaceTreatment(final FOContext context) {
return propertyList.traitWhiteSpaceTreatment(context);
}
@@ -2007,42 +2007,42 @@
/**
* {@inheritDoc}
*/
- public short traitActiveState(final FOContext context) {
+ public FoValue traitActiveState(final FOContext context) {
return propertyList.traitActiveState(context);
}
/**
* {@inheritDoc}
*/
- public short traitClear(final FOContext context) {
+ public FoValue traitClear(final FOContext context) {
return propertyList.traitClear(context);
}
/**
* {@inheritDoc}
*/
- public short traitEmptyCells(final FOContext context) {
+ public FoValue traitEmptyCells(final FOContext context) {
return propertyList.traitEmptyCells(context);
}
/**
* {@inheritDoc}
*/
- public short traitFloat(final FOContext context) {
+ public FoValue traitFloat(final FOContext context) {
return propertyList.traitFloat(context);
}
/**
* {@inheritDoc}
*/
- public short traitMediaUsage(final FOContext context) {
+ public FoValue traitMediaUsage(final FOContext context) {
return propertyList.traitMediaUsage(context);
}
/**
* {@inheritDoc}
*/
- public short traitReferenceOrientation(final FOContext context) {
+ public FoValue traitReferenceOrientation(final FOContext context) {
/*
* Per XSL-FO Standard 1.0, Section 7.20.3, reference-orientation is
* only applied to FOs that establish a reference-area.
@@ -2050,69 +2050,69 @@
if (isRAGenerator()) {
return propertyList.traitReferenceOrientation(context);
}
- return 0;
+ return null;
}
/**
* {@inheritDoc}
*/
- public short traitRenderingIntent(final FOContext context) {
+ public FoValue traitRenderingIntent(final FOContext context) {
return propertyList.traitRenderingIntent(context);
}
/**
* {@inheritDoc}
*/
- public short traitShowDestination(final FOContext context) {
+ public FoValue traitShowDestination(final FOContext context) {
return propertyList.traitShowDestination(context);
}
/**
* {@inheritDoc}
*/
- public short traitSpeakHeader(final FOContext context) {
+ public FoValue traitSpeakHeader(final FOContext context) {
return propertyList.traitSpeakHeader(context);
}
/**
* {@inheritDoc}
*/
- public short traitSpeak(final FOContext context) {
+ public FoValue traitSpeak(final FOContext context) {
return propertyList.traitSpeak(context);
}
/**
* {@inheritDoc}
*/
- public short traitSpeakNumeral(final FOContext context) {
+ public FoValue traitSpeakNumeral(final FOContext context) {
return propertyList.traitSpeakNumeral(context);
}
/**
* {@inheritDoc}
*/
- public short traitSpeakPunctuation(final FOContext context) {
+ public FoValue traitSpeakPunctuation(final FOContext context) {
return propertyList.traitSpeakPunctuation(context);
}
/**
* {@inheritDoc}
*/
- public short traitStartingState(final FOContext context) {
+ public FoValue traitStartingState(final FOContext context) {
return propertyList.traitStartingState(context);
}
/**
* {@inheritDoc}
*/
- public short traitTextTransform(final FOContext context) {
+ public FoValue traitTextTransform(final FOContext context) {
return propertyList.traitTextTransform(context);
}
/**
* {@inheritDoc}
*/
- public short traitVisibility(final FOContext context) {
+ public FoValue traitVisibility(final FOContext context) {
return propertyList.traitVisibility(context);
}
@@ -2323,7 +2323,7 @@
/**
* {@inheritDoc}
*/
- public short traitSwitchTo() {
+ public FoValue traitSwitchTo() {
return propertyList.traitSwitchTo();
}
@@ -2419,7 +2419,7 @@
/**
* {@inheritDoc}
*/
- public short traitWordSpacingConditionality() {
+ public FoValue traitWordSpacingConditionality() {
return propertyList.traitWordSpacingConditionality();
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/Property.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/Property.java 2007-02-03 18:08:39 UTC (rev 8599)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/Property.java 2007-02-05 16:26:30 UTC (rev 8600)
@@ -177,48 +177,56 @@
return pv;
}
- protected abstract short[] getValidKeywords();
+ protected abstract FoValue[] getValidKeywords();
- protected PropertyKeyword checkKeywords(final short[] validKeywords,
+ protected PropertyKeyword checkKeywords(final FoValue[] validKeywords,
final String possibleKeyword) {
- final short kwIndex = getKeywordIndex(possibleKeyword, validKeywords);
- if (kwIndex < 1) {
- return null;
- }
- return PropertyKeyword.getPropertyKeyword(kwIndex);
+ final FoValue value = FoValue.xslValueOf(possibleKeyword);
+ return PropertyKeyword.getPropertyKeyword(value);
}
- public static short getKeywordIndex(final String possibleKeyword,
- final short[] validKeywords) {
+ public static int getKeywordIndex(final FoValue possibleKeyword,
+ final FoValue[] validKeywords) {
if (validKeywords == null) {
return -1;
}
for (int i = 0; i < validKeywords.length; i++) {
- final short kwIndex = validKeywords[i];
- final String keyword = FoValue.toXslFo(kwIndex);
+ final FoValue keyword = validKeywords[i];
if (possibleKeyword.equals(keyword)) {
- return kwIndex;
+ return i;
}
}
return -1;
}
/**
+ * Determines whether a given keyword is included in a given keyword
+ * set.
+ * @param keyword The keyword whose inclusion is being tested.
+ * @param keywordSet The array of keywords that is being tested against.
+ * @return The keyword if it is found, or null if it is not.
+ */
+ public static FoValue getKeywordInSet(final FoValue keyword,
+ final FoValue[] keywordSet) {
+ for (int i = 0; i < keywordSet.length; i++) {
+ if (keyword == keywordSet[i]) {
+ return keyword;
+ }
+ }
+ return null;
+ }
+
+ /**
* Determines whether a given keyword index is included in a given keyword
* set.
- * @param keywordIndex The keyword index whose inclusion is being tested.
+ * @param keyword The keyword index whose inclusion is being tested.
* @param keywordSet The short array that keywordIndex is being tested
* against.
* @return True if keywordIndex is found in keywordSet, false otherwise.
*/
- public static boolean keywordInSet(final short keywordIndex,
- final short[] keywordSet) {
- for (int i = 0; i < keywordSet.length; i++) {
- if (keywordIndex == keywordSet[i]) {
- return true;
- }
- }
- return false;
+ public static boolean keywordInSet(final FoValue keyword,
+ final FoValue[] keywordSet) {
+ return Property.getKeywordInSet(keyword, keywordSet) != null;
}
/**
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-02-03 18:08:39 UTC (rev 8599)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-02-05 16:26:30 UTC (rev 8600)
@@ -423,7 +423,7 @@
return Color.getValueNoInstance(context, fobj);
}
- public short getWrapOption(final FOContext context) {
+ public FoValue getWrapOption(final FOContext context) {
Enumerated property = (Enumerated) getProperty(
FoProperty.WRAP_OPTION);
if (property != null) {
@@ -433,13 +433,13 @@
property = (Enumerated) getProperty(FoProperty.WHITE_SPACE);
if (property != null) {
switch (property.getValue(context, fobj)) {
- case FoValue.NORMAL: {
+ case NORMAL: {
return FoValue.WRAP;
}
- case FoValue.PRE: {
+ case PRE: {
return FoValue.NO_WRAP;
}
- case FoValue.NOWRAP: {
+ case NOWRAP: {
return FoValue.NO_WRAP;
}
}
@@ -459,13 +459,13 @@
FoProperty.WHITE_SPACE);
if (enumProperty != null) {
switch (enumProperty.getValue(context, fobj)) {
- case FoValue.NORMAL: {
+ case NORMAL: {
return true;
}
- case FoValue.PRE: {
+ case PRE: {
return false;
}
- case FoValue.NOWRAP: {
+ case NOWRAP: {
return true;
}
}
@@ -528,7 +528,7 @@
return indent.getValue(context, fobj, direction, ipdContainingRA);
}
- public short getSpan(final FOContext context) {
+ public FoValue getSpan(final FOContext context) {
final Enumerated property = (Enumerated) getProperty(
FoProperty.SPAN);
if (property != null) {
@@ -564,7 +564,7 @@
return Name.getValueNoInstance();
}
- public short getRetrievePosition() {
+ public FoValue getRetrievePosition() {
final Enumerated property = (Enumerated) getProperty(
FoProperty.RETRIEVE_POSITION);
if (property != null) {
@@ -574,7 +574,7 @@
FoProperty.RETRIEVE_POSITION);
}
- public short getRetrieveBoundary() {
+ public FoValue getRetrieveBoundary() {
final Enumerated property = (Enumerated) getProperty(
FoProperty.RETRIEVE_BOUNDARY);
if (property != null) {
@@ -611,7 +611,7 @@
return property.getValue();
}
- public short getBorderCollapse(final FOContext context) {
+ public FoValue getBorderCollapse(final FOContext context) {
final Enumerated property = (Enumerated) getProperty(
FoProperty.BORDER_COLLAPSE);
if (property != null) {
@@ -621,7 +621,7 @@
FoProperty.BORDER_COLLAPSE, fobj);
}
- public short getDisplayAlign(final FOContext context) {
+ public FoValue getDisplayAlign(final FOContext context) {
final DisplayAlign property = (DisplayAlign) getProperty(
FoProperty.DISPLAY_ALIGN);
if (property == null) {
@@ -630,7 +630,7 @@
return property.traitValue(context, fobj);
}
- public short getRelativeAlign(final FOContext context) {
+ public FoValue getRelativeAlign(final FOContext context) {
final Enumerated property = (Enumerated) getProperty(
FoProperty.RELATIVE_ALIGN);
if (property != null) {
@@ -700,7 +700,7 @@
return property.getValueProportional();
}
- public short getBreakAfter(final FOContext context) {
+ public FoValue getBreakAfter(final FOContext context) {
Enumerated property = (Enumerated) getProperty(
FoProperty.BREAK_AFTER);
if (property != null) {
@@ -709,19 +709,19 @@
property = (Enumerated) getProperty(FoProperty.PAGE_BREAK_AFTER);
if (property != null) {
switch(property.getValue(context, fobj)) {
- case FoValue.AUTO: {
+ case AUTO: {
return FoValue.AUTO;
}
- case FoValue.ALWAYS: {
+ case ALWAYS: {
return FoValue.PAGE;
}
- case FoValue.AVOID: {
+ case AVOID: {
return FoValue.AUTO;
}
- case FoValue.LEFT: {
+ case LEFT: {
return FoValue.EVEN_PAGE;
}
- case FoValue.RIGHT: {
+ case RIGHT: {
return FoValue.ODD_PAGE;
}
}
@@ -743,10 +743,10 @@
FoProperty.PAGE_BREAK_INSIDE);
if (enumProperty != null) {
switch(enumProperty.getValue(context, fobj)) {
- case FoValue.AUTO: {
+ case AUTO: {
return org.axsl.foR.Keep.AUTO;
}
- case FoValue.AVOID: {
+ case AVOID: {
return org.axsl.foR.Keep.ALWAYS;
}
}
@@ -779,19 +779,19 @@
FoProperty.PAGE_BREAK_AFTER);
if (enumProperty != null) {
switch(enumProperty.getValue(context, fobj)) {
- case FoValue.AUTO: {
+ case AUTO: {
return org.axsl.foR.Keep.AUTO;
}
- case FoValue.ALWAYS: {
+ case ALWAYS: {
return org.axsl.foR.Keep.AUTO;
}
- case FoValue.AVOID: {
+ case AVOID: {
return org.axsl.foR.Keep.ALWAYS;
}
- case FoValue.LEFT: {
+ case LEFT: {
return org.axsl.foR.Keep.AUTO;
}
- case FoValue.RIGHT: {
+ case RIGHT: {
return org.axsl.foR.Keep.AUTO;
}
}
@@ -824,19 +824,19 @@
FoProperty.PAGE_BREAK_BEFORE);
if (enumProperty != null) {
switch(enumProperty.getValue(context, fobj)) {
- case FoValue.AUTO: {
+ case AUTO: {
return org.axsl.foR.Keep.AUTO;
}
- case FoValue.ALWAYS: {
+ case ALWAYS: {
return org.axsl.foR.Keep.AUTO;
}
- case FoValue.AVOID: {
+ case AVOID: {
return org.axsl.foR.Keep.ALWAYS;
}
- case FoValue.LEFT: {
+ case LEFT: {
return org.axsl.foR.Keep.AUTO;
}
- case FoValue.RIGHT: {
+ case RIGHT: {
return org.axsl.foR.Keep.AUTO;
}
}
@@ -865,7 +865,7 @@
return Name.getValueNoInstance();
}
- public short getPagePosition() {
+ public FoValue getPagePosition() {
final Enumerated property = (Enumerated) getProperty(
FoProperty.PAGE_POSITION);
if (property != null) {
@@ -874,7 +874,7 @@
return Enumerated.getValueNoInstance(FoProperty.PAGE_POSITION)...
[truncated message content] |