- CellAttributes that = (CellAttributes)rhs;
-
- this.bold = that.bold;
- this.blink = that.blink;
- this.reverse = that.reverse;
- this.underline = that.underline;
- this.protect = that.protect;
- this.foreColor = that.foreColor;
- this.backColor = that.backColor;
- }
-
- /**
- * Convert enum to string
- *
- * @param color Color.RED, Color.BLUE, etc.
- * @return "red", "blue", etc.
- */
- static public String stringFromColor(Color color) {
- if (color.equals(Color.BLACK)) {
- return "black";
- } else if (color.equals(Color.WHITE)) {
- return "white";
- } else if (color.equals(Color.RED)) {
- return "red";
- } else if (color.equals(Color.CYAN)) {
- return "cyan";
- } else if (color.equals(Color.GREEN)) {
- return "green";
- } else if (color.equals(Color.MAGENTA)) {
- return "magenta";
- } else if (color.equals(Color.BLUE)) {
- return "blue";
- } else if (color.equals(Color.YELLOW)) {
- return "yellow";
- }
- throw new IllegalArgumentException("Invalid Color value: " +
- color.value);
- }
-
- /**
- * Convert string to enum
- *
- * @param color "red", "blue", etc.
- * @return Color.RED, Color.BLUE, etc.
- */
- static public Color colorFromString(String color) {
- switch (color.toLowerCase()) {
- case "black":
- return Color.BLACK;
- case "white":
- return Color.WHITE;
- case "red":
- return Color.RED;
- case "cyan":
- return Color.CYAN;
- case "green":
- return Color.GREEN;
- case "magenta":
- return Color.MAGENTA;
- case "blue":
- return Color.BLUE;
- case "yellow":
- return Color.YELLOW;
- case "brown":
- return Color.YELLOW;
- default:
- // Let unknown strings become white
- return Color.WHITE;
- }
- }
-
- /**
- * Make human-readable description of this CellAttributes
+ CellAttributes that = (CellAttributes) rhs;
+
+ this.bold = that.bold;
+ this.blink = that.blink;
+ this.reverse = that.reverse;
+ this.underline = that.underline;
+ this.protect = that.protect;
+ this.foreColor = that.foreColor;
+ this.backColor = that.backColor;
+ }
+
+ /**
+ * Make human-readable description of this CellAttributes.
+ *
+ * @return displayable String