Fixed for TJ
[fanfix.git] / src / jexer / bits / CellAttributes.java
index 36cf700ea7b3da41b045874e6aa59274155dbc56..c14557679ee4ff28298021d492b502661ebd0e2a 100644 (file)
@@ -218,6 +218,16 @@ public class CellAttributes {
         reset();
     }
 
+    /**
+     * Public constructor makes a copy from another instance.
+     *
+     * @param that another CellAttributes instance
+     * @see #reset()
+     */
+    public CellAttributes(final CellAttributes that) {
+        setTo(that);
+    }
+
     /**
      * Comparison check.  All fields must match to return true.
      *
@@ -284,12 +294,8 @@ public class CellAttributes {
      */
     @Override
     public String toString() {
-        if (bold) {
-            return String.format("bold %s on %s",
-                foreColor, backColor);
-        } else {
-            return String.format("%s on %s", foreColor, backColor);
-        }
+        return String.format("%s%s%s on %s", (bold == true ? "bold " : ""),
+            (blink == true ? "blink " : ""), foreColor, backColor);
     }
 
 }