Package jexer.tackboard
Class Bitmap
- java.lang.Object
-
- jexer.tackboard.TackboardItem
-
- jexer.tackboard.Bitmap
-
- All Implemented Interfaces:
java.lang.Comparable<TackboardItem>
- Direct Known Subclasses:
MousePointer
,Text
public class Bitmap extends TackboardItem
Bitmap is a raw bitmap image.
-
-
Field Summary
-
Fields inherited from class jexer.tackboard.TackboardItem
dirty
-
-
Constructor Summary
Constructors Constructor Description Bitmap(int x, int y, int z, java.awt.image.BufferedImage image)
Public constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object rhs)
Comparison check.java.awt.image.BufferedImage
getImage(int textWidth, int textHeight)
Get this item rendered to a bitmap, offset to align on a grid of cells with pixel dimensions (textWidth, textHeight).int
hashCode()
Hashcode uses all fields in equals().void
setImage(java.awt.image.BufferedImage image)
Set the image.java.lang.String
toString()
Make human-readable description of this item.
-
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object rhs)
Comparison check. All fields must match to return true.- Overrides:
equals
in classTackboardItem
- Parameters:
rhs
- another Bitmap instance- Returns:
- true if all fields are equal
-
hashCode
public int hashCode()
Hashcode uses all fields in equals().- Overrides:
hashCode
in classTackboardItem
- Returns:
- the hash
-
toString
public java.lang.String toString()
Make human-readable description of this item.- Overrides:
toString
in classTackboardItem
- Returns:
- displayable String
-
getImage
public java.awt.image.BufferedImage getImage(int textWidth, int textHeight)
Get this item rendered to a bitmap, offset to align on a grid of cells with pixel dimensions (textWidth, textHeight).- Overrides:
getImage
in classTackboardItem
- Parameters:
textWidth
- the width of a text celltextHeight
- the height of a text cell- Returns:
- the image, or null if this item does not have any pixels to show
-
setImage
public void setImage(java.awt.image.BufferedImage image)
Set the image.- Parameters:
image
- the new image
-
-