|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--java.awt.Panel
|
+--java.applet.Applet
|
+--MyApplet
This class is my applet and is responsible for drawing start and close buttons and acts as my " MONITOR " class.
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT,
CENTER_ALIGNMENT,
LEFT_ALIGNMENT,
RIGHT_ALIGNMENT,
TOP_ALIGNMENT |
| Constructor Summary | |
MyApplet()
|
|
| Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent e)
This method sets the action to be performed when the start and close buttons are pressed. |
void |
ballmissed()
This is a synchronized method which is called by the Consumer class. |
void |
draw()
This method is use to draw the ping pong ball. |
void |
drawPlate()
This method is used draw the rectangular plate. |
void |
init()
This method initializes and instansiates the applet. |
void |
keyPressed(java.awt.event.KeyEvent ke)
This method sets the action of the left arrow and right arrow key |
void |
keyReleased(java.awt.event.KeyEvent ke)
|
void |
keyTyped(java.awt.event.KeyEvent ke)
|
void |
move()
This is a synchronized method which is called by the Producer class. |
void |
paint(java.awt.Graphics g)
This method paints the rectangular plate on the screen. |
| Methods inherited from class java.applet.Applet |
destroy,
getAppletContext,
getAppletInfo,
getAudioClip,
getAudioClip,
getCodeBase,
getDocumentBase,
getImage,
getImage,
getLocale,
getParameter,
getParameterInfo,
isActive,
newAudioClip,
play,
play,
resize,
resize,
setStub,
showStatus,
start,
stop |
| Methods inherited from class java.awt.Panel |
addNotify |
| Methods inherited from class java.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
addImpl,
countComponents,
deliverEvent,
doLayout,
findComponentAt,
findComponentAt,
getAlignmentX,
getAlignmentY,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents,
getInsets,
getLayout,
getMaximumSize,
getMinimumSize,
getPreferredSize,
insets,
invalidate,
isAncestorOf,
layout,
list,
list,
locate,
minimumSize,
paintComponents,
paramString,
preferredSize,
print,
printComponents,
processContainerEvent,
processEvent,
remove,
remove,
removeAll,
removeContainerListener,
removeNotify,
setCursor,
setFont,
setLayout,
update,
validate,
validateTree |
| Methods inherited from class java.awt.Component |
action,
add,
addComponentListener,
addFocusListener,
addInputMethodListener,
addKeyListener,
addMouseListener,
addMouseMotionListener,
addPropertyChangeListener,
addPropertyChangeListener,
bounds,
checkImage,
checkImage,
coalesceEvents,
contains,
contains,
createImage,
createImage,
disable,
disableEvents,
dispatchEvent,
enable,
enable,
enableEvents,
enableInputMethods,
firePropertyChange,
getBackground,
getBounds,
getBounds,
getColorModel,
getComponentOrientation,
getCursor,
getDropTarget,
getFont,
getFontMetrics,
getForeground,
getGraphics,
getHeight,
getInputContext,
getInputMethodRequests,
getLocation,
getLocation,
getLocationOnScreen,
getName,
getParent,
getPeer,
getSize,
getSize,
getToolkit,
getTreeLock,
getWidth,
getX,
getY,
gotFocus,
handleEvent,
hasFocus,
hide,
imageUpdate,
inside,
isDisplayable,
isDoubleBuffered,
isEnabled,
isFocusTraversable,
isLightweight,
isOpaque,
isShowing,
isValid,
isVisible,
keyDown,
keyUp,
list,
list,
list,
location,
lostFocus,
mouseDown,
mouseDrag,
mouseEnter,
mouseExit,
mouseMove,
mouseUp,
move,
nextFocus,
paintAll,
postEvent,
prepareImage,
prepareImage,
printAll,
processComponentEvent,
processFocusEvent,
processInputMethodEvent,
processKeyEvent,
processMouseEvent,
processMouseMotionEvent,
remove,
removeComponentListener,
removeFocusListener,
removeInputMethodListener,
removeKeyListener,
removeMouseListener,
removeMouseMotionListener,
removePropertyChangeListener,
removePropertyChangeListener,
repaint,
repaint,
repaint,
repaint,
requestFocus,
reshape,
setBackground,
setBounds,
setBounds,
setComponentOrientation,
setDropTarget,
setEnabled,
setForeground,
setLocale,
setLocation,
setLocation,
setName,
setSize,
setSize,
setVisible,
show,
show,
size,
toString,
transferFocus |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Constructor Detail |
public MyApplet()
| Method Detail |
public void init()
PRE CONDITION : The applet should be open from a browser .
POST CONDITION: Applet is initialised .
public void keyPressed(java.awt.event.KeyEvent ke)
PRE CONDITION : Key Events should take place .
POST CONDITION: sets new position of the rectangular plate .
public void keyTyped(java.awt.event.KeyEvent ke)
public void keyReleased(java.awt.event.KeyEvent ke)
public void paint(java.awt.Graphics g)
PRE CONDITION : The Arrowkey needs to be pressed .
POST CONDITION: the Rectangular plate is being painted .
public void actionPerformed(java.awt.event.ActionEvent e)
PRE CONDITION : The Applet needs to be started .
POST CONDITION: The start button starts the game while the close button ceases the applet.
public void draw()
PRE CONDITION : The start button needs to be pressed.
POST CONDITION: The Ball starts moving as the start button is pressed.
public void move()
PRE CONDITION : Producer Thread needs to be running.
POST CONDITION : It allows the ball to be moved on the screen.
public void drawPlate()
PRE CONDITION : The Start button needs to be clicked.
POST CONDITION : The Rectangular plates appears on the applet.
public void ballmissed()
PRE CONDITION : Consumer Thread needs to be running.
POST CONDITION :It destroyes the ball from the screen.
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||