Browse Source

Additional helper functions


git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198312 13f79535-47bb-0310-9956-ffa450edef68
tags/Root_Temp_KnuthStylePageBreaking
Jeremias Maerki 19 years ago
parent
commit
dcc549d859
1 changed files with 19 additions and 0 deletions
  1. 19
    0
      src/java/org/apache/fop/area/Area.java

+ 19
- 0
src/java/org/apache/fop/area/Area.java View File

@@ -342,6 +342,11 @@ public class Area implements Serializable {
return this.props;
}

/** @return true if the area has traits */
public boolean hasTraits() {
return (this.props != null);
}
/**
* Get a trait from this area.
*
@@ -351,6 +356,20 @@ public class Area implements Serializable {
public Object getTrait(Object oTraitCode) {
return (props != null ? props.get(oTraitCode) : null);
}
/**
* Get a boolean trait from this area.
* @param oTraitCode the trait key
* @return the trait value
*/
public boolean getBooleanTrait(Object oTraitCode) {
final Object obj = getTrait(oTraitCode);
if (obj instanceof Boolean) {
return ((Boolean)obj).booleanValue();
} else {
return false;
}
}

/**
* Get a trait from this area as an integer.

Loading…
Cancel
Save