]> source.dussan.org Git - poi.git/commitdiff
add toString() and isEmpty() to ShadingDescriptor
authorSergey Vladimirov <sergey@apache.org>
Sat, 9 Jul 2011 12:10:09 +0000 (12:10 +0000)
committerSergey Vladimirov <sergey@apache.org>
Sat, 9 Jul 2011 12:10:09 +0000 (12:10 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1144661 13f79535-47bb-0310-9956-ffa450edef68

src/scratchpad/src/org/apache/poi/hwpf/usermodel/ShadingDescriptor.java

index 3e9d2b3ca9d7682ca8b91c092ebdb5c8482c7337..602ee285e4b7ef84d33ffe4bf47a366ffe299022 100644 (file)
@@ -60,4 +60,20 @@ public final class ShadingDescriptor
   {
     return super.clone();
   }
+
+    public boolean isEmpty()
+    {
+        return _info == 0;
+    }
+
+    @Override
+    public String toString()
+    {
+        if ( isEmpty() )
+            return "[SHD] EMPTY]";
+
+        return "[SHD] (cvFore: " + _icoFore.getShortValue( _info )
+                + "; cvBack: " + _icoBack.getShortValue( _info ) + "; iPat: "
+                + _ipat.getShortValue( _info ) + ")";
+    }
 }