diff options
Diffstat (limited to 'src/java/org/apache/fop/traits')
4 files changed, 26 insertions, 10 deletions
diff --git a/src/java/org/apache/fop/traits/WritingMode.java b/src/java/org/apache/fop/traits/WritingMode.java index 8718118ef..f8c784941 100644 --- a/src/java/org/apache/fop/traits/WritingMode.java +++ b/src/java/org/apache/fop/traits/WritingMode.java @@ -54,8 +54,9 @@ public final class WritingMode extends TraitEnum { * Assign writing mode traits from this trait to the specified * writing mode traits setter. * @param wms a writing mode traits setter + * @param explicit true if writing mode property explicitly specified */ - public void assignWritingModeTraits(WritingModeTraitsSetter wms) { + public void assignWritingModeTraits(WritingModeTraitsSetter wms, boolean explicit) { Direction inlineProgressionDirection; Direction blockProgressionDirection; Direction columnProgressionDirection; @@ -97,7 +98,7 @@ public final class WritingMode extends TraitEnum { wms.setColumnProgressionDirection(columnProgressionDirection); wms.setRowProgressionDirection(rowProgressionDirection); wms.setShiftDirection(shiftDirection); - wms.setWritingMode(this); + wms.setWritingMode(this, explicit); } /** diff --git a/src/java/org/apache/fop/traits/WritingModeTraits.java b/src/java/org/apache/fop/traits/WritingModeTraits.java index 279326afa..fbd150ca9 100644 --- a/src/java/org/apache/fop/traits/WritingModeTraits.java +++ b/src/java/org/apache/fop/traits/WritingModeTraits.java @@ -31,20 +31,21 @@ public class WritingModeTraits implements WritingModeTraitsSetter { private Direction rowProgressionDirection; private Direction shiftDirection; private WritingMode writingMode; + private boolean explicit; /** * Default writing mode traits constructor. */ public WritingModeTraits() { - this (WritingMode.LR_TB); + this (WritingMode.LR_TB, false); } /** * Construct writing mode traits using the specified writing mode. * @param writingMode a writing mode traits object */ - public WritingModeTraits(WritingMode writingMode) { - assignWritingModeTraits(writingMode); + public WritingModeTraits(WritingMode writingMode, boolean explicit) { + assignWritingModeTraits(writingMode, explicit); } /** @@ -125,17 +126,25 @@ public class WritingModeTraits implements WritingModeTraitsSetter { } /** + * @return the "explicit-writing-mode" trait. + */ + public boolean getExplicitWritingMode() { + return explicit; + } + + /** * @param writingMode the "writing-mode" trait. */ - public void setWritingMode(WritingMode writingMode) { + public void setWritingMode(WritingMode writingMode, boolean explicit) { this.writingMode = writingMode; + this.explicit = explicit; } /** * @param writingMode the "writing-mode" trait. */ - public void assignWritingModeTraits(WritingMode writingMode) { - writingMode.assignWritingModeTraits(this); + public void assignWritingModeTraits(WritingMode writingMode, boolean explicit) { + writingMode.assignWritingModeTraits(this, explicit); } /** diff --git a/src/java/org/apache/fop/traits/WritingModeTraitsGetter.java b/src/java/org/apache/fop/traits/WritingModeTraitsGetter.java index a67e437c9..7340b3e8c 100644 --- a/src/java/org/apache/fop/traits/WritingModeTraitsGetter.java +++ b/src/java/org/apache/fop/traits/WritingModeTraitsGetter.java @@ -55,4 +55,9 @@ public interface WritingModeTraitsGetter { */ WritingMode getWritingMode(); + /** + * @return the "explicit-writing-mode" trait + */ + boolean getExplicitWritingMode(); + } diff --git a/src/java/org/apache/fop/traits/WritingModeTraitsSetter.java b/src/java/org/apache/fop/traits/WritingModeTraitsSetter.java index 6dcf0fb12..b70f73954 100644 --- a/src/java/org/apache/fop/traits/WritingModeTraitsSetter.java +++ b/src/java/org/apache/fop/traits/WritingModeTraitsSetter.java @@ -58,13 +58,14 @@ public interface WritingModeTraitsSetter extends WritingModeTraitsGetter { * Set value of writing-mode trait. * @param writingMode the "writing-mode" trait */ - void setWritingMode(WritingMode writingMode); + void setWritingMode(WritingMode writingMode, boolean explicit); /** * Collectivelly assign values to all writing mode traits based upon a specific * writing mode. * @param writingMode the "writing-mode" trait + * @param explicit true if writing mode explicitly specified */ - void assignWritingModeTraits(WritingMode writingMode); + void assignWritingModeTraits(WritingMode writingMode, boolean explicit); } |