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.Bitmap(int x, int y, int z, Animation animation, TApplication application)Public constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object rhs)Comparison check.java.awt.image.BufferedImagegetImage(int textWidth, int textHeight)Get this item rendered to a bitmap, offset to align on a grid of cells with pixel dimensions (textWidth, textHeight).inthashCode()Hashcode uses all fields in equals().voidremove()Remove this item from its board.voidsetImage(java.awt.image.BufferedImage image)Set the image.java.lang.StringtoString()Make human-readable description of this item.
-
-
-
Constructor Detail
-
Bitmap
public Bitmap(int x, int y, int z, java.awt.image.BufferedImage image)Public constructor.- Parameters:
x- X pixel coordinatey- Y pixel coordinatez- Z coordinateimage- the image
-
Bitmap
public Bitmap(int x, int y, int z, Animation animation, TApplication application)Public constructor. Due to the use of a timer, the Bitmap needs to see TApplication to start the Animation.- Parameters:
x- X pixel coordinatey- Y pixel coordinatez- Z coordinateanimation- the animation to displayapplication- the application to set the animation timer on
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object rhs)
Comparison check. All fields must match to return true.- Overrides:
equalsin classTackboardItem- Parameters:
rhs- another Bitmap instance- Returns:
- true if all fields are equal
-
hashCode
public int hashCode()
Hashcode uses all fields in equals().- Overrides:
hashCodein classTackboardItem- Returns:
- the hash
-
toString
public java.lang.String toString()
Make human-readable description of this item.- Overrides:
toStringin 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:
getImagein 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
-
remove
public void remove()
Remove this item from its board. Subclasses can use this for cleanup also.- Overrides:
removein classTackboardItem
-
setImage
public void setImage(java.awt.image.BufferedImage image)
Set the image.- Parameters:
image- the new image
-
-