|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
bot.CheckerCanvas
| Nested Class Summary |
| Nested classes inherited from class javax.swing.JPanel |
JPanel.AccessibleJPanel |
| Nested classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
| Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
| Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
static int |
CHECKER_HEIGHT
|
static int |
CHECKER_WIDTH
Default size of checkers in pixels on screen |
| Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
CheckerCanvas()
Make the checker canvas--no size set yet. |
|
| Method Summary | |
void |
addImage(Point p,
Image img)
Add image to given point on board (on top of previous images). |
void |
alert(String s)
Put message in center of screen. |
void |
clearImages()
Dump database of images. |
boolean |
containsPoint(Point p)
|
Point |
generateULPoint(int x,
int y)
|
Point |
generateULPoint(Point p)
Generate graphic coordinate of upperleft of given checker |
void |
paintCheck(Point p)
|
void |
paintCheck(Point p,
Image img)
Paint the given check to the passed image, and save the image to the old version. |
void |
paintCheckDetail(Point p,
Image img)
|
void |
paintComponent(Graphics g)
|
void |
resizeToInclude(Point p)
Call if board is asked to include a point outside original dimensions. |
void |
setBoard(Board bd)
|
void |
setCheckerSize(int w,
int h)
Set size of individual checkers on screen. |
void |
setDefaultImage(Image img)
What each tile looks like if empty. |
void |
setImage(Point p,
Image img)
Set the image of the given point to the passed image. |
void |
tint(Color color)
Tint the screen a given color. |
void |
waitUntilClean()
Wait until the image has been painted and so all checker update calls have been dealt with |
| Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int CHECKER_WIDTH
public static final int CHECKER_HEIGHT
| Constructor Detail |
public CheckerCanvas()
| Method Detail |
public void setCheckerSize(int w,
int h)
public void setBoard(Board bd)
public void resizeToInclude(Point p)
Checks to see if point is outside bounds before taking action.
public boolean containsPoint(Point p)
public void setImage(Point p,
Image img)
public void addImage(Point p,
Image img)
public void clearImages()
public void waitUntilClean()
public void paintComponent(Graphics g)
public void tint(Color color)
public void alert(String s)
public void paintCheck(Point p)
public void paintCheck(Point p,
Image img)
public void paintCheckDetail(Point p,
Image img)
public Point generateULPoint(Point p)
public Point generateULPoint(int x,
int y)
public void setDefaultImage(Image img)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||