public class TextCellFactory
extends java.lang.Object
implements java.lang.Cloneable
Constructor and Description |
---|
TextCellFactory()
Sets up this factory to ensure ASCII (or UTF-8) characters in the range
33 to 125 all fit and no padding on the cells.
|
Modifier and Type | Method and Description |
---|---|
TextCellFactory |
clone() |
void |
emptyCache()
Clears out the backing cache.
|
java.awt.Dimension |
getCellDimension()
Returns the dimension of a single grid cell.
|
java.awt.Font |
getFont()
Returns the font used by this factory.
|
java.awt.image.BufferedImage |
getImageFor(char c,
java.awt.Color foreground)
Returns the image of the character provided with a transparent
background.
|
java.awt.image.BufferedImage |
getImageFor(char c,
java.awt.Color foreground,
java.awt.Color background)
Returns the image for the given character.
|
java.lang.String |
getStringRepresentationOf(char c,
java.awt.Color foreground)
Returns a string representation of the character and the hex value of the
foreground.
|
java.lang.String |
getStringRepresentationOf(char c,
java.awt.Color foreground,
java.awt.Color background)
Returns a string representation of the character and the hex value of the
foreground and background argb values.
|
void |
initializeByFont(java.awt.Font font)
Sets up the factory to provide images based on the font's size.
|
void |
initializeBySize(int cellWidth,
int cellHeight,
java.awt.Font font)
Sets up the factory to provide images based on the cell cellWidth and
cellHeight passed in.
|
void |
setAntialias(boolean set)
Sets whether or not characters should be drawn with antialiasing.
|
void |
setFitCharacters(char[] fit)
Sets the array of characters that will be checked to ensure they all fit
in the text block.
|
void |
setPadding(int pad)
Sets the minimum amount of space between the characters and all four
edges.
|
void |
setPadding(int left,
int right,
int top,
int bottom)
Sets the minimum amount of space between the characters and the edges.
|
boolean |
willFit(char c)
Returns true if the given character will fit inside the current cell
dimensions with the current font.
|
public TextCellFactory()
public java.awt.Dimension getCellDimension()
public java.awt.Font getFont()
public void emptyCache()
public void setAntialias(boolean set)
set
- public void setFitCharacters(char[] fit)
fit
- public void setPadding(int pad)
pad
- public void setPadding(int left, int right, int top, int bottom)
left
- right
- top
- bottom
- public void initializeByFont(java.awt.Font font)
font
- public void initializeBySize(int cellWidth, int cellHeight, java.awt.Font font)
cellWidth
- cellHeight
- font
- whiteSpace
- public boolean willFit(char c)
c
- public java.awt.image.BufferedImage getImageFor(char c, java.awt.Color foreground, java.awt.Color background)
c
- foreground
- background
- public java.awt.image.BufferedImage getImageFor(char c, java.awt.Color foreground)
c
- foreground
- public java.lang.String getStringRepresentationOf(char c, java.awt.Color foreground, java.awt.Color background)
c
- foreground
- background
- public java.lang.String getStringRepresentationOf(char c, java.awt.Color foreground)
c
- foreground
- background
- public TextCellFactory clone()
clone
in class java.lang.Object