From: Peter Bernard West Date: Thu, 27 May 2004 15:09:08 +0000 (+0000) Subject: Added boolean decoration tests X-Git-Tag: Defoe_export~138 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3520b80f91ae7e7e4eeb3dc54aa1d865c87bf4de;p=xmlgraphics-fop.git Added boolean decoration tests git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP_0-20-0_Alt-Design@197636 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/datatypes/TextDecorations.java b/src/java/org/apache/fop/datatypes/TextDecorations.java index 602435c76..24ef3203c 100644 --- a/src/java/org/apache/fop/datatypes/TextDecorations.java +++ b/src/java/org/apache/fop/datatypes/TextDecorations.java @@ -26,6 +26,7 @@ package org.apache.fop.datatypes; import org.apache.fop.fo.PropNames; import org.apache.fop.fo.expr.PropertyException; +import org.apache.fop.fo.properties.TextDecoration; /** * Class for the text decorations to be applied according to the @@ -33,6 +34,7 @@ import org.apache.fop.fo.expr.PropertyException; * set of text decorations. Modifications to the set are specified in a * TextDecorator object, which contains the on and off masks to be applied * to the "current" set of decorations. + * TODO Should this be a PropertyValue at all? I don't think so. */ public class TextDecorations @@ -74,6 +76,27 @@ public class TextDecorations this.decorations = decorations; } + public boolean overlined() { + if ((decorations & TextDecoration.OVERLINE) != 0) { + return true; + } + return false; + } + + public boolean struckthrough() { + if ((decorations & TextDecoration.LINE_THROUGH) != 0) { + return true; + } + return false; + } + + public boolean underlined() { + if ((decorations & TextDecoration.UNDERLINE) != 0) { + return true; + } + return false; + } + /** * Get the set of decorations. * @return byte decorations value