public class CheckeredBackgroundDisplay extends java.lang.Object implements GridBackgroundDisplay
GridBackgroundDisplay
interface specifies the
method that must be provided by any class used to display
a Grid
background.Constructor and Description |
---|
CheckeredBackgroundDisplay(ScrollableGridDisplay enclosingDisplay,
java.awt.Color upperLeftColor,
java.awt.Color otherColor)
Constructs a background display that draws a checkered background
for a grid, using the specified colors.
|
Modifier and Type | Method and Description |
---|---|
void |
drawBackground(java.awt.Graphics2D g2)
Draws the grid background.
|
public CheckeredBackgroundDisplay(ScrollableGridDisplay enclosingDisplay, java.awt.Color upperLeftColor, java.awt.Color otherColor)
enclosingDisplay
- the overall grid display for which this
object will draw the backgroundupperLeftColor
- color to display in upper-left corner
and every other cell after thatotherColor
- the alternate colorpublic void drawBackground(java.awt.Graphics2D g2)
GridBackgroundDisplay
drawBackground
in interface GridBackgroundDisplay
g2
- the Graphics2 object to use to render