Package jexer.bits
Class ComplexCell
- java.lang.Object
-
- jexer.bits.CellAttributes
-
- jexer.bits.Cell
-
- jexer.bits.ComplexCell
-
public class ComplexCell extends Cell
ComplexCell represents a multi-codepoint glyph, as commonly used in color emojis, accented characters, and more.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jexer.bits.Cell
Cell.Width
-
-
Constructor Summary
Constructors Constructor Description ComplexCell()Public constructor sets default values of the cell to blank.ComplexCell(int codePoint)Public constructor sets a single codepoint.ComplexCell(int[] codePoints)Public constructor sets multiple codepoints.ComplexCell(int[] codePoints, CellAttributes attr)Public constructor sets multiple codepoints and attributes.ComplexCell(int codePoint, CellAttributes attr)Public constructor sets a single codepoint and attributes.ComplexCell(Cell cell)Public constructor creates a duplicate.ComplexCell(CellAttributes attr)Public constructor sets the attributes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int codePoint)Append one codepoint to the end of the sequence.booleanequals(java.lang.Object rhs)Comparison check.intgetChar()Getter for cell character.intgetCodePointCount()Getter for number of codepoints in this cell.int[]getCodePoints()Getter for cell codepoints.intgetDisplayWidth()Get for number of display cells required to show this cell's text.inthashCode()Hashcode uses all fields in equals().booleanisCodePoint(int codePoint)Compare this complex cell's codepoint(s) to another single codepoint.booleanisEmoji()See if this cell is an emoji.voidreset()Reset this cell to a blank.voidsetChar(int ch)Setter for cell character.voidsetChar(Cell other)Set the cell character to another cell's character.voidsetCodePoints(int[] codePoints)Set all cell codepoints.voidsetTo(java.lang.Object rhs)Set my field values to rhs's field.char[]toCharArray()Convert the codepoints to a character array.java.lang.StringtoHtml()Convert this cell into an HTML entity inside a <font> tag.java.lang.StringtoString()Make human-readable description of this Cell.voidunset()UNset this cell.-
Methods inherited from class jexer.bits.Cell
checkForSingleColor, flattenImage, getImage, getImage, getImageId, getWidth, invertImage, isBlank, isCacheable, isFullyTransparentImage, isImage, isInvertedImage, isSpaceChar, isTransparentImage, mixImageId, mixImageId, restoreImage, setAttr, setAttr, setImage, setImage, setImageId, setOpaqueImage, setWidth
-
Methods inherited from class jexer.bits.CellAttributes
getAnimations, getBackColor, getBackColorRGB, getForeColor, getForeColorPulseRGB, getForeColorRGB, getPulseColorRGB, isBlink, isBold, isProtect, isPulse, isReverse, isRGB, isUnderline, setAnimations, setBackColor, setBackColorRGB, setBlink, setBold, setDimmedForeColor, setForeColor, setForeColorRGB, setInvisibleForeColor, setProtect, setPulse, setPulseColorRGB, setReverse, setUnderline
-
-
-
-
Constructor Detail
-
ComplexCell
public ComplexCell()
Public constructor sets default values of the cell to blank.- See Also:
Cell.isBlank(),reset()
-
ComplexCell
public ComplexCell(CellAttributes attr)
Public constructor sets the attributes.- Parameters:
attr- attributes to use
-
ComplexCell
public ComplexCell(int codePoint, CellAttributes attr)Public constructor sets a single codepoint and attributes.- Parameters:
codePoint- the codepoint to set toattr- attributes to use
-
ComplexCell
public ComplexCell(int codePoint)
Public constructor sets a single codepoint. Attributes are the same as default.- Parameters:
codePoint- the codepoint to set to- See Also:
reset()
-
ComplexCell
public ComplexCell(int[] codePoints)
Public constructor sets multiple codepoints. Attributes are the same as default.- Parameters:
codePoints- the codepoints to set to- See Also:
reset()
-
ComplexCell
public ComplexCell(int[] codePoints, CellAttributes attr)Public constructor sets multiple codepoints and attributes. as default.- Parameters:
codePoints- the codepoints to set toattr- attributes to use
-
ComplexCell
public ComplexCell(Cell cell)
Public constructor creates a duplicate.- Parameters:
cell- the instance to copy
-
-
Method Detail
-
getChar
public int getChar()
Getter for cell character.
-
setChar
public void setChar(int ch)
Setter for cell character.
-
setChar
public void setChar(Cell other)
Set the cell character to another cell's character.
-
unset
public void unset()
UNset this cell. It will not be equal to any other cell until it has been assigned attributes and a character.
-
equals
public boolean equals(java.lang.Object rhs)
Comparison check. All fields must match to return true.
-
hashCode
public int hashCode()
Hashcode uses all fields in equals().
-
setTo
public void setTo(java.lang.Object rhs)
Set my field values to rhs's field.
-
toString
public java.lang.String toString()
Make human-readable description of this Cell.
-
toHtml
public java.lang.String toHtml()
Convert this cell into an HTML entity inside a <font> tag.
-
getDisplayWidth
public int getDisplayWidth()
Get for number of display cells required to show this cell's text.- Overrides:
getDisplayWidthin classCell- Returns:
- 1 or 2
-
isCodePoint
public boolean isCodePoint(int codePoint)
Compare this complex cell's codepoint(s) to another single codepoint.- Overrides:
isCodePointin classCell- Parameters:
codePoint- codepoint to compare to- Returns:
- true if this cell has one codepoint, and it is equal
-
isEmoji
public boolean isEmoji()
See if this cell is an emoji.
-
setCodePoints
public void setCodePoints(int[] codePoints)
Set all cell codepoints.- Parameters:
codePoints- the codepoints to set to
-
getCodePoints
public int[] getCodePoints()
Getter for cell codepoints.- Returns:
- a copy of the codepoints
-
getCodePointCount
public int getCodePointCount()
Getter for number of codepoints in this cell.- Returns:
- the number of codepoints
-
add
public void add(int codePoint)
Append one codepoint to the end of the sequence.- Parameters:
codePoint- the codepoint to add
-
toCharArray
public char[] toCharArray()
Convert the codepoints to a character array.- Returns:
- an array of all of the codepoints
-
-