jeremias    2005/01/25 02:42:06

  Modified:    src/java/org/apache/fop/area Area.java
  Log:
  Additional helper functions
  
  Revision  Changes    Path
  1.7       +19 -0     xml-fop/src/java/org/apache/fop/area/Area.java
  
  Index: Area.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/area/Area.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Area.java 12 Jan 2005 11:50:31 -0000      1.6
  +++ Area.java 25 Jan 2005 10:42:06 -0000      1.7
  @@ -342,6 +342,11 @@
           return this.props;
       }
   
  +    /** @return true if the area has traits */
  +    public boolean hasTraits() {
  +        return (this.props != null);
  +    }
  +    
       /**
        * Get a trait from this area.
        *
  @@ -350,6 +355,20 @@
        */
       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;
  +        }
       }
   
       /**
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to