|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Canvas
|
+--boardview
a boardview is a canvas (a rectangle that can be displayed on the screen and painted on) that can display a board. It can be used in two ways
| Inner classes inherited from class java.awt.Canvas |
java.awt.Canvas.AccessibleAWTCanvas |
| Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent |
| 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 | |
boardview(board ib)
constructor in non-applet mode |
|
boardview(board ib,
reversi ir)
constructor for applet mode |
|
| Method Summary | |
void |
answer(java.lang.String s,
int m)
this method is called by movers to return return the move they want to do. |
void |
display()
creates a frame that shows this boardview. |
void |
domove(int m)
do the given move on the board. |
boolean |
mouseDown(java.awt.Event evt,
int x,
int y)
this method is called if the user clicked the mouse. |
void |
paint(java.awt.Graphics newg)
this method is called by the operating system if the frame must be redrawn, and by the rest of the program if something changed on the board. |
void |
run()
this method is the one that runs in its own thread to do the animation. it calls fade() every 150 milliseconds. |
void |
setplayers(boolean a,
boolean b)
you can indicate here whether computer players must be used. |
void |
start()
is called if a new thread is created for the animation. |
void |
stop()
is called if someone wants the thread to stop. |
void |
undomove()
undo the last move on the board. |
| Methods inherited from class java.awt.Canvas |
addNotify, getAccessibleContext |
| Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public boardview(board ib,
reversi ir)
public boardview(board ib)
| Method Detail |
public void display()
public boolean mouseDown(java.awt.Event evt,
int x,
int y)
mouseDown in class java.awt.Componentevt - an object that contains details on the click.x - the horizontal position of the cursory - the vertical positionpublic void domove(int m)
m - the move to be done.public void undomove()
public void setplayers(boolean a,
boolean b)
a - true if a computer player must be used for the first
player. False if the user operates this player.b - same for second player.public void paint(java.awt.Graphics newg)
paint in class java.awt.Canvas
public void answer(java.lang.String s,
int m)
s - s is not used. It is a little joke: it can be used by callers to give
a comment to this function.m - the move to be done.public void start()
public void stop()
public void run()
run in interface java.lang.Runnable
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||