[FOray-commit] SF.net SVN: foray: [10062] trunk/foray
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2007-07-20 16:13:16
|
Revision: 10062
http://svn.sourceforge.net/foray/?rev=10062&view=rev
Author: victormote
Date: 2007-07-20 09:13:18 -0700 (Fri, 20 Jul 2007)
Log Message:
-----------
Conform to axsl changes moving methods from Fo to new property-specific interfaces.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/AbstractInlineArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java
trunk/foray/foray-areatree/src/java/org/foray/area/ExternalGraphicArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/ForeignObjectArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/InlineArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/InlineContainerArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberCitationArea.java
trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.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-20 15:26:08 UTC (rev 10061)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/AbstractInlineArea.java 2007-07-20 16:13:18 UTC (rev 10062)
@@ -34,8 +34,6 @@
import org.axsl.fo.fo.prop.BaselineShiftPa;
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}
@@ -184,13 +182,6 @@
}
/**
- * {@inheritDoc}
- */
- public Color traitColor() {
- return traitGeneratedBy().traitColor(this);
- }
-
- /**
* Standard validation routine for child classes that are setting a new
* parent.
* @param node The new parent node.
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-20 15:26:08 UTC (rev 10061)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/AreaNode.java 2007-07-20 16:13:18 UTC (rev 10062)
@@ -35,11 +35,13 @@
import org.axsl.fo.Fo;
import org.axsl.fo.fo.GraftingPoint;
import org.axsl.fo.fo.Table;
+import org.axsl.fo.fo.prop.ColorPa;
import org.axsl.font.FontConsumer;
import org.axsl.text.TextServer;
import org.apache.commons.logging.Log;
+import java.awt.Color;
import java.util.Iterator;
import java.util.List;
import java.util.NoSuchElementException;
@@ -798,4 +800,21 @@
return this.ancestorArea().crIpd();
}
+ /**
+ * Returns the color of this Area.
+ * For areas generated by FOs which have color, this is simply the color of
+ * the "generated-by" trait.
+ * For other areas, it is the color of the Fo that generated the nearest
+ * ancestor Area which was generated by an Fo with color.
+ * @return The color of this Area.
+ */
+ public Color getColor() {
+ final Fo generatedBy = this.traitGeneratedBy();
+ if (generatedBy instanceof ColorPa) {
+ final ColorPa coloredFo = (ColorPa) generatedBy;
+ return coloredFo.traitColor(this);
+ }
+ return this.getParent().getColor();
+ }
+
}
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-20 15:26:08 UTC (rev 10061)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/ExternalGraphicArea.java 2007-07-20 16:13:18 UTC (rev 10062)
@@ -359,4 +359,12 @@
return traitGeneratedBy().traitIpDimensionOpt(this);
}
+ /**
+ * {@inheritDoc}
+ */
+ public Color traitColor() {
+ /* Color is irrelevant. */
+ return Color.BLACK;
+ }
+
}
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-20 15:26:08 UTC (rev 10061)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/ForeignObjectArea.java 2007-07-20 16:13:18 UTC (rev 10062)
@@ -371,4 +371,12 @@
return traitGeneratedBy().traitIpDimensionOpt(this);
}
+ /**
+ * {@inheritDoc}
+ */
+ public Color traitColor() {
+ /* Color is irrelevant. */
+ return Color.BLACK;
+ }
+
}
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-20 15:26:08 UTC (rev 10061)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/InlineArea.java 2007-07-20 16:13:18 UTC (rev 10062)
@@ -501,4 +501,11 @@
return traitGeneratedBy().traitIpDimensionOpt(this);
}
+ /**
+ * {@inheritDoc}
+ */
+ public Color traitColor() {
+ return traitGeneratedBy().traitColor(this);
+ }
+
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/InlineContainerArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/InlineContainerArea.java 2007-07-20 15:26:08 UTC (rev 10061)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/InlineContainerArea.java 2007-07-20 16:13:18 UTC (rev 10062)
@@ -348,4 +348,11 @@
return traitGeneratedBy().traitIpDimensionOpt(this);
}
+ /**
+ * {@inheritDoc}
+ */
+ public Color traitColor() {
+ return traitGeneratedBy().traitColor(this);
+ }
+
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java 2007-07-20 15:26:08 UTC (rev 10061)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/LeaderArea.java 2007-07-20 16:13:18 UTC (rev 10062)
@@ -732,4 +732,11 @@
return -1;
}
+ /**
+ * {@inheritDoc}
+ */
+ public Color traitColor() {
+ return traitGeneratedBy().traitColor(this);
+ }
+
}
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-20 15:26:08 UTC (rev 10061)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberArea.java 2007-07-20 16:13:18 UTC (rev 10062)
@@ -353,4 +353,11 @@
return -1;
}
+ /**
+ * {@inheritDoc}
+ */
+ public Color traitColor() {
+ return this.getColor();
+ }
+
}
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-20 15:26:08 UTC (rev 10061)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/PageNumberCitationArea.java 2007-07-20 16:13:18 UTC (rev 10062)
@@ -382,4 +382,11 @@
return -1;
}
+ /**
+ * {@inheritDoc}
+ */
+ public Color traitColor() {
+ return this.getColor();
+ }
+
}
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java 2007-07-20 15:26:08 UTC (rev 10061)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/TextArea.java 2007-07-20 16:13:18 UTC (rev 10062)
@@ -987,4 +987,11 @@
return -1;
}
+ /**
+ * {@inheritDoc}
+ */
+ public Color traitColor() {
+ return traitGeneratedBy().traitColor(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-20 15:26:08 UTC (rev 10061)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-07-20 16:13:18 UTC (rev 10062)
@@ -121,6 +121,7 @@
import org.axsl.fo.fo.prop.CharacterPa;
import org.axsl.fo.fo.prop.ClearPa;
import org.axsl.fo.fo.prop.ClipPa;
+import org.axsl.fo.fo.prop.ColorPa;
import org.axsl.fo.fo.prop.ColorProfileNamePa;
import org.axsl.fo.fo.prop.ColumnCountPa;
import org.axsl.fo.fo.prop.ColumnGapPa;
@@ -206,7 +207,7 @@
CommonRelativePositionPa, ActiveStatePa, AlignmentAdjustPa,
AlignmentBaselinePa, AutoRestorePa, BaselineShiftPa, BasicLinkPa,
BlockPa, BlockProgressionDimensionPa, BreakPa, CaptionSidePa,
- CaseNamePa, CaseTitlePa, CharacterPa, ClearPa, ClipPa,
+ CaseNamePa, CaseTitlePa, CharacterPa, ClearPa, ClipPa, ColorPa,
ColorProfileNamePa, ColumnCountPa, ColumnGapPa, ContentTypePa,
DirectionPa, DisplayAlignPa, DominantBaselinePa, EmptyCellsPa, ExtentPa,
ExternalDestinationPa, FloatPa, FlowNamePa, GlyphOrientationPa,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|