public class Cell
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
FrequencyMatrixApplet |
app |
java.awt.Color |
bgColor |
int |
CellAlignment |
int |
CellType |
static int |
CENTER |
boolean |
centered |
boolean |
editable |
java.awt.Color |
fgColor |
int |
height |
java.awt.Color |
initbgColor |
java.awt.Color |
initfgColor |
int |
itsFontSize |
static int |
LEFT |
static int |
RIGHT |
static int |
SUM |
static int |
VALUE |
int |
width |
int |
xLoc |
int |
yLoc |
Constructor and Description |
---|
Cell(FrequencyMatrixApplet app,
java.awt.Color bgColor,
java.awt.Color fgColor,
boolean editable,
int width,
int height,
int xLoc,
int yLoc,
int CellAlignment)
standard constructor to initialize the cell with a set of values
|
Cell(int xLoc,
int yLoc,
java.lang.Double theValue)
standard constructor to initialize the cell with a set of values
|
Modifier and Type | Method and Description |
---|---|
void |
appendString(java.lang.String aString)
appends a given String to the pre-existing text for the cell
|
void |
clearCell()
sets string content to empty and its number value to 0
|
void |
drawCell(java.awt.Graphics g)
draws the cell
|
void |
drawLabel(java.awt.Graphics g)
draws the label for the cell
|
java.lang.String |
getString()
returns the cell value as a formatted String or the label string
|
double |
getValue()
returns the double value for the cell
|
void |
paint(java.awt.Graphics g)
paints the cell
|
void |
setbgColor(java.awt.Color bgColor)
sets a color for the background
|
void |
setDefaultbgColor()
sets the color of the background to the default background color
|
void |
setDefaultfgColor()
sets the color of the content to the default foreground color
|
void |
setfgColor(java.awt.Color fgColor)
sets a color of the content
|
void |
setFontSize(int fSize)
sets the size of the font for the cell
|
void |
setLocation(int x,
int y)
positions the cell at a given screen Capture
|
void |
setString(java.lang.String aString)
sets string content to the string provided and gets rid of the numeric
value for the cell
|
void |
setValue(double aDouble)
installs a double value for the cell
|
java.lang.String |
toString()
returns as a string
|
public FrequencyMatrixApplet app
public boolean centered
public static final int VALUE
public static final int SUM
public static final int LEFT
public static final int CENTER
public static final int RIGHT
public int CellType
public int CellAlignment
public java.awt.Color bgColor
public java.awt.Color fgColor
public java.awt.Color initbgColor
public java.awt.Color initfgColor
public int width
public int height
public int xLoc
public int yLoc
public boolean editable
public int itsFontSize
public Cell(int xLoc, int yLoc, java.lang.Double theValue)
xLoc
- the horizontal position of the cell in screen pixelsyLoc
- the vertical position of the cell in screen pixelstheValue
- the alignment of the text in the cellpublic Cell(FrequencyMatrixApplet app, java.awt.Color bgColor, java.awt.Color fgColor, boolean editable, int width, int height, int xLoc, int yLoc, int CellAlignment)
app
- the instance of a frequency matrix applicationbgColor
- a background ColorfgColor
- a foreground Coloreditable
- can the cell be edited?width
- the width of the cell in screen pixelsheight
- the height of the cell in screen pixelsxLoc
- the horizontal position of the cell in screen pixelsyLoc
- the vertical position of the cell in screen pixelsCellAlignment
- the alignment of the text in the cellpublic void setfgColor(java.awt.Color fgColor)
fgColor
- a foreground Colorpublic void setbgColor(java.awt.Color bgColor)
bgColor
- a background Colorpublic void setDefaultfgColor()
public void setDefaultbgColor()
public void setLocation(int x, int y)
x
- horizontal position in screen pixelsy
- vertical position in screen pixelspublic void clearCell()
public void setString(java.lang.String aString)
aString
- String to setpublic void appendString(java.lang.String aString)
aString
- String to setpublic java.lang.String getString()
public void setValue(double aDouble)
aDouble
- the double value to setpublic double getValue()
public void setFontSize(int fSize)
fSize
- font size to setpublic void drawLabel(java.awt.Graphics g)
g
- the graphics world for the operationpublic void drawCell(java.awt.Graphics g)
g
- the graphics world for the operationpublic void paint(java.awt.Graphics g)
g
- the graphics world for the operationpublic java.lang.String toString()
toString
in class java.lang.Object
RH, 2017