public final class Cell extends CellAttributes
Modifier and Type | Class and Description |
---|---|
static class |
Cell.Width
How this cell needs to be displayed if it is part of a larger glyph.
|
Constructor and Description |
---|
Cell()
Public constructor sets default values of the cell to blank.
|
Cell(Cell cell)
Public constructor creates a duplicate.
|
Cell(CellAttributes attr)
Public constructor sets the attributes.
|
Cell(int ch)
Public constructor sets the character.
|
Cell(int ch,
CellAttributes attr)
Public constructor sets the character and attributes.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object rhs)
Comparison check.
|
java.awt.Color |
getBackground()
Get the bitmap image background color for this cell.
|
int |
getChar()
Getter for cell character.
|
java.awt.image.BufferedImage |
getImage()
Get the image data for this cell.
|
Cell.Width |
getWidth()
Getter for cell width.
|
int |
hashCode()
Hashcode uses all fields in equals().
|
void |
invertImage()
Invert the image in this cell, if it has one.
|
boolean |
isBlank()
Check to see if this cell has default attributes: white foreground,
black background, no bold/blink/reverse/underline/protect, and a
character value of ' ' (space).
|
boolean |
isImage()
If true, this cell has image data.
|
boolean |
isInvertedImage()
If true, this cell has image data, and that data is inverted.
|
void |
reset()
Reset this cell to a blank.
|
void |
restoreImage()
Restore the image in this cell to its normal version, if it has one.
|
void |
setAttr(CellAttributes that)
Set my field attr values to that's field.
|
void |
setChar(int ch)
Setter for cell character.
|
void |
setImage(java.awt.image.BufferedImage image)
Set the image data for this cell.
|
void |
setTo(java.lang.Object rhs)
Set my field values to that's field.
|
void |
setWidth(Cell.Width width)
Setter for cell width.
|
java.lang.String |
toString()
Make human-readable description of this Cell.
|
void |
unset()
UNset this cell.
|
getBackColor, getBackColorRGB, getForeColor, getForeColorRGB, isBlink, isBold, isProtect, isReverse, isRGB, isUnderline, setBackColor, setBackColorRGB, setBlink, setBold, setForeColor, setForeColorRGB, setProtect, setReverse, setUnderline
public Cell()
public Cell(int ch)
ch
- character to set toreset()
public Cell(CellAttributes attr)
attr
- attributes to usepublic Cell(int ch, CellAttributes attr)
ch
- character to set toattr
- attributes to usepublic Cell(Cell cell)
cell
- the instance to copypublic void setImage(java.awt.image.BufferedImage image)
image
- the image for this cellpublic java.awt.image.BufferedImage getImage()
public java.awt.Color getBackground()
public boolean isImage()
public void restoreImage()
public boolean isInvertedImage()
public void invertImage()
public int getChar()
public void setChar(int ch)
ch
- new cell characterpublic Cell.Width getWidth()
public void setWidth(Cell.Width width)
width
- new cell width, one of Width.SINGLE, Width.LEFT, or
Width.RIGHTpublic void reset()
reset
in class CellAttributes
public void unset()
public boolean isBlank()
public boolean equals(java.lang.Object rhs)
equals
in class CellAttributes
rhs
- another Cell instancepublic int hashCode()
hashCode
in class CellAttributes
public void setTo(java.lang.Object rhs)
setTo
in class CellAttributes
rhs
- an instance of either Cell or CellAttributespublic void setAttr(CellAttributes that)
that
- a CellAttributes instancepublic java.lang.String toString()
toString
in class CellAttributes
Copyright © 2019 Kevin Lamonte. Licensed MIT.