+ public Cell(final char ch) {
+ reset();
+ this.ch = ch;
+ }
+
+ // ------------------------------------------------------------------------
+ // Cell -------------------------------------------------------------------
+ // ------------------------------------------------------------------------
+
+
+ /**
+ * Set the image data for this cell.
+ *
+ * @param image the image for this cell
+ */
+ public void setImage(final BufferedImage image) {
+ this.image = image;
+ imageHashCode = image.hashCode();
+ }
+
+ /**
+ * Get the image data for this cell.
+ *
+ * @return the image for this cell
+ */
+ public BufferedImage getImage() {
+ if (invertedImage != null) {
+ return invertedImage;
+ }
+ return image;
+ }
+
+ /**
+ * Get the bitmap image background color for this cell.
+ *
+ * @return the bitmap image background color
+ */
+ public Color getBackground() {
+ return background;
+ }
+
+ /**
+ * If true, this cell has image data.
+ *
+ * @return true if this cell is an image rather than a character with
+ * attributes
+ */
+ public boolean isImage() {
+ if (image != null) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Restore the image in this cell to its normal version, if it has one.
+ */
+ public void restoreImage() {
+ invertedImage = null;
+ }
+
+ /**
+ * If true, this cell has image data, and that data is inverted.
+ *
+ * @return true if this cell is an image rather than a character with
+ * attributes, and the data is inverted
+ */
+ public boolean isInvertedImage() {
+ if ((image != null) && (invertedImage != null)) {
+ return true;
+ }
+ return false;
+ }