|
|||||||
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 | +--PoolTableCanvas
Inner classes inherited from class java.awt.Canvas |
java.awt.Canvas.AccessibleAWTCanvas |
Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent |
Field Summary | |
protected Ball[] |
ball
|
protected java.awt.Color |
ballColor
|
protected boolean |
ballFlag
|
protected int |
ballRadius
|
protected Vector |
clickedPoint
|
protected java.awt.Dimension |
d
|
protected DoubleBufferHandler |
dbHandler
|
protected int |
dx
|
protected int |
dy
|
protected int |
edgeThickness
|
protected Hole[] |
hole
|
protected int |
holeRadius
|
protected Rectangle |
interior
|
protected boolean |
moving
|
protected int |
nballs
|
protected int |
nholes
|
protected Vector |
oldClick
|
java.awt.Label |
output
|
protected int |
radius
|
protected int |
tableHeight
|
protected int |
tableWidth
|
protected int |
x
|
protected int |
y
|
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 | |
PoolTableCanvas()
|
Method Summary | |
Ball |
getBall(int i)
|
boolean |
getBallFlag()
|
Vector |
getClickedPoint()
|
boolean |
getMoving()
|
Vector |
getOldClick()
|
void |
initCanvas()
|
void |
paint(java.awt.Graphics g)
method paint calls update to paint the canvas on applet |
void |
paintFrame(java.awt.Graphics g)
method paintFrame actually draws the canvas on applet with various components like pockets(holes) and sets up balls with white cue ball |
void |
setBallFlag(boolean flag)
|
void |
setMoving(boolean flag)
|
void |
update(java.awt.Graphics g)
method update updates the canvas |
void |
updateBalls()
updateBalls method updates the latest positions of the balls it uses methods like detectTableCollision,detectBallCollision, setPosition,kill,isLive,getPosition,ductStopTime,fallIntoHole, setVelocity,pushIntoDuct,bounceOffWall,collideWithBall,endOfDuct, decelerate from Ball class. |
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, mouseDown, 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, validate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface DoubleBufferedComponent |
createImage, getSize |
Field Detail |
protected int tableHeight
protected int tableWidth
protected int edgeThickness
protected int holeRadius
protected int ballRadius
protected int nholes
protected int nballs
protected Rectangle interior
protected Hole[] hole
protected Ball[] ball
protected Vector clickedPoint
protected Vector oldClick
protected boolean moving
protected boolean ballFlag
protected int x
protected int y
protected int dx
protected int dy
protected int radius
protected java.awt.Color ballColor
protected java.awt.Dimension d
protected DoubleBufferHandler dbHandler
public java.awt.Label output
Constructor Detail |
public PoolTableCanvas()
Method Detail |
public void initCanvas()
public void update(java.awt.Graphics g)
update
in class java.awt.Component
public void paint(java.awt.Graphics g)
paint
in class java.awt.Canvas
public void paintFrame(java.awt.Graphics g)
paintFrame
in interface DoubleBufferedComponent
public void updateBalls()
public Ball getBall(int i)
public Vector getClickedPoint()
public Vector getOldClick()
public boolean getMoving()
public void setMoving(boolean flag)
public boolean getBallFlag()
public void setBallFlag(boolean flag)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |