From 046d2a92ed471f56a4b38df1e8c3bb77474dc7c4 Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Sun, 21 Aug 2005 13:00:32 +0000 Subject: [PATCH] New hasTrait() method. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@234197 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/area/Area.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/java/org/apache/fop/area/Area.java b/src/java/org/apache/fop/area/Area.java index da00665d2..5ce94de92 100644 --- a/src/java/org/apache/fop/area/Area.java +++ b/src/java/org/apache/fop/area/Area.java @@ -120,7 +120,9 @@ public class Area implements Serializable { public static final int CLASS_MAX = CLASS_SIDE_FLOAT + 1; private int areaClass = CLASS_NORMAL; + /** the area's inline-progression-dimension */ protected int ipd; + /** the area's block-progression-dimension */ protected int bpd; /** @@ -357,6 +359,15 @@ public class Area implements Serializable { return (props != null ? props.get(oTraitCode) : null); } + /** + * Checks whether a certain trait is set on this area. + * @param oTraitCode the trait key + * @return true if the trait is set + */ + public boolean hasTrait(Object oTraitCode) { + return (getTrait(oTraitCode) != null); + } + /** * Get a boolean trait from this area. * @param oTraitCode the trait key @@ -388,6 +399,7 @@ public class Area implements Serializable { } } + /** @see java.lang.Object#toString() */ public String toString() { StringBuffer sb = new StringBuffer(super.toString()); sb.append(" {ipd=").append(Integer.toString(getIPD())); -- 2.39.5