|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Panel
java.applet.Applet
javax.swing.JApplet
BattleS
public class BattleS
| Nested Class Summary | |
|---|---|
class |
BattleS.HealthBox
The healthbox is used to display the headpoints your ships have left before they are sunk |
class |
BattleS.ImagePanel
The ImagePanel class is used to draw images to a panel by passing a image |
protected class |
BattleS.PlayImage
The PlayImage class is used to create the animation you see throughout the game play |
(package private) class |
BattleS.SocketThrdServer
The SocketThrdServer Class, this class is used to create the server object that runs in a thread and continually listens for input from clients taken from the AppletCliSer.java and modified to work with battle ship |
class |
BattleS.TurnBox
The class that is used to create the turn box which displays the number of turns you and your opponent have taken |
(package private) class |
BattleS.UseSocket
The construction for the Client - UseSocket class that uses a thread to lsiten for input connections Also taken from the AppletCliSer.java exmaple and modified for the battleship game |
| Nested classes/interfaces inherited from class javax.swing.JApplet |
|---|
javax.swing.JApplet.AccessibleJApplet |
| Nested classes/interfaces inherited from class java.applet.Applet |
|---|
java.applet.Applet.AccessibleApplet |
| Nested classes/interfaces inherited from class java.awt.Panel |
|---|
java.awt.Panel.AccessibleAWTPanel |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
java.awt.Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
BattleS.ImagePanel |
aircraft
|
javax.swing.JButton |
BattleBut
|
BattleS.ImagePanel |
battleship
|
java.awt.Image[] |
battleshipImages
|
javax.swing.JLabel |
BattleSunk
|
javax.swing.JLabel |
BattleSunk2
|
java.net.URL |
buticon
|
javax.swing.JButton[][] |
butspot
|
javax.swing.JButton[][] |
butspot1
|
int |
bypass
|
javax.swing.JButton |
CarrierBut
|
java.awt.Image[] |
carrierImages
|
javax.swing.JLabel |
CarrierSunk
|
javax.swing.JLabel |
CarrierSunk2
|
java.awt.Image[] |
clapArray
|
Grid |
CompGrid
|
int |
counter
|
BattleS.ImagePanel |
destroyer
|
javax.swing.JButton |
DestroyerBut
|
java.awt.Image[] |
destroyerImages
|
javax.swing.JLabel |
DestroyerSunk
|
javax.swing.JLabel |
DestroyerSunk2
|
javax.swing.JLabel |
GameOver
|
java.awt.Panel |
gameQuit
|
javax.swing.JOptionPane |
gametype
|
int |
gtype
|
BattleS.HealthBox |
healthbox
|
javax.swing.JOptionPane |
historyp
|
java.applet.AudioClip |
hit
|
javax.swing.JRadioButton |
horizontalButton
|
java.awt.Image[] |
imageArray
|
protected BattleS.PlayImage |
imagePanel
|
java.awt.Image |
imageToDisplay
|
(package private) java.io.BufferedReader |
in
|
(package private) java.io.BufferedReader |
in2
|
(package private) boolean |
isAlive
|
(package private) boolean |
isServer
|
javax.swing.JLabel |
LastTurn
|
javax.swing.JLabel |
LastTurn1
|
javax.swing.JLabel |
LastTurn1a
|
javax.swing.JLabel |
LastTurna
|
java.applet.AudioClip |
lose
|
java.awt.Image[] |
loseArray
|
protected BattleS.PlayImage |
losePanel
|
java.awt.Panel |
LPanel
|
java.awt.Panel |
LPanel2
|
javax.swing.JPopupMenu |
menu
|
java.applet.AudioClip |
missed
|
int |
netX
|
int |
netY
|
java.awt.Panel |
numPanel
|
java.awt.Panel |
numPanel2
|
javax.swing.JLabel |
Opp
|
javax.swing.JLabel |
opready1
|
javax.swing.JLabel |
opready2
|
int[] |
opshiploc
|
BattleS.ImagePanel |
opsunkaircraft
|
BattleS.ImagePanel |
opsunkbattle
|
BattleS.ImagePanel |
opsunkdestroyer
|
BattleS.ImagePanel |
opsunkpatrol
|
BattleS.ImagePanel |
opsunksub
|
javax.swing.JButton |
otherClasstest
|
(package private) java.io.PrintWriter |
out
|
(package private) java.io.PrintWriter |
out2
|
java.awt.Panel |
p1
|
java.awt.Panel |
p2
|
javax.swing.JPanel |
panel
|
BattleS.ImagePanel |
patrolboat
|
javax.swing.JButton |
PatrolBut
|
javax.swing.JLabel |
PatrolSunk
|
javax.swing.JLabel |
PatrolSunk2
|
Player |
Play1
|
int |
play1lose
|
int |
play1win
|
Player |
Play2
|
int |
play2lose
|
int |
play2win
|
javax.swing.JLabel |
Player1
|
javax.swing.JLabel |
Player2
|
Grid |
PlayerOne
|
int |
port
|
java.awt.Image[] |
ptboatImages
|
int |
rad
|
javax.swing.JLabel |
ready1
|
javax.swing.JLabel |
ready2
|
(package private) boolean |
registering
|
javax.swing.JOptionPane |
replay
|
int |
ret2
|
java.net.URL |
rolloverbut
|
(package private) java.net.Socket |
serverSocket
|
java.awt.Image[] |
shipArray
|
java.awt.Button[][] |
shipbut1
|
int[][] |
shiploc
|
int |
shipT
|
int |
size
|
(package private) java.net.Socket |
socket
|
javax.swing.JLabel |
StatusL
|
javax.swing.JLabel |
StatusT
|
javax.swing.JButton |
SubBut
|
BattleS.ImagePanel |
submarine
|
java.awt.Image[] |
submarineImages
|
javax.swing.JLabel |
SubSunk
|
javax.swing.JLabel |
SubSunk2
|
java.applet.AudioClip |
sunk
|
java.awt.Image[] |
sunkshipArray
|
int |
tCount
|
javax.swing.JButton |
tempButton2
|
javax.swing.JLabel |
Title
|
BattleS.TurnBox |
turnbox
|
BattleS.ImagePanel |
usunkaircraft
|
BattleS.ImagePanel |
usunkbattle
|
BattleS.ImagePanel |
usunkdestroyer
|
BattleS.ImagePanel |
usunkpatrol
|
BattleS.ImagePanel |
usunksub
|
javax.swing.JRadioButton |
verticalButton
|
javax.swing.JLabel |
Waiting
|
javax.swing.JOptionPane |
win
|
protected BattleS.PlayImage |
winPanel
|
java.applet.AudioClip |
won
|
javax.swing.JLabel |
you
|
| Fields inherited from class javax.swing.JApplet |
|---|
accessibleContext, rootPane, rootPaneCheckingEnabled |
| 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 | |
|---|---|
BattleS()
|
|
| Method Summary | |
|---|---|
void |
byPass(int k)
Sets the bypass mode up to skip computer shot |
void |
gameExit()
This function exits the game when its called. |
void |
gameReplay()
This resets the values in the game so the game can be played over again |
int |
getbyPass()
Gets the bypass mode status |
int |
getCounter()
Gets the counter number |
int |
getRadio()
Gets the radio buttons attribute |
int |
getShip()
gets the ship type |
int |
getShipSize()
Gets the ship size of the ship stored in temp memory |
int |
getTurnCounter()
gets the turn count for each player |
void |
gui()
Used to create the Graphics User Interface devised of numerous objects pretaining to ships |
void |
init()
The start of the applet where the gui is called and is defined |
void |
setCounter(int c)
Sets the counter |
void |
setRadio(int radio)
Sets the radio buttons attribute |
void |
setShip(int type)
Sets the ships type |
void |
setShipSize(int s)
Sets the ship size |
void |
setTurnCounter()
Sets the turn counter by incrementing it |
void |
updateConnected()
|
| Methods inherited from class javax.swing.JApplet |
|---|
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, remove, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update |
| 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, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
| Methods inherited from class java.awt.Component |
|---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, 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, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public Grid PlayerOne
public Grid CompGrid
public Player Play1
public Player Play2
public javax.swing.JButton[][] butspot
public javax.swing.JButton[][] butspot1
public java.awt.Button[][] shipbut1
public javax.swing.JLabel CarrierSunk
public javax.swing.JLabel BattleSunk
public javax.swing.JLabel PatrolSunk
public javax.swing.JLabel SubSunk
public javax.swing.JLabel DestroyerSunk
public javax.swing.JLabel CarrierSunk2
public javax.swing.JLabel BattleSunk2
public javax.swing.JLabel PatrolSunk2
public javax.swing.JLabel SubSunk2
public javax.swing.JLabel DestroyerSunk2
public javax.swing.JLabel Player1
public javax.swing.JLabel Waiting
public javax.swing.JLabel Player2
public javax.swing.JLabel Opp
public javax.swing.JLabel you
public javax.swing.JLabel Title
public javax.swing.JLabel ready1
public javax.swing.JLabel ready2
public javax.swing.JLabel opready1
public javax.swing.JLabel opready2
public javax.swing.JLabel LastTurn
public javax.swing.JLabel LastTurna
public javax.swing.JLabel LastTurn1
public javax.swing.JLabel LastTurn1a
public javax.swing.JLabel StatusL
public javax.swing.JLabel StatusT
public javax.swing.JLabel GameOver
public javax.swing.JRadioButton horizontalButton
public javax.swing.JRadioButton verticalButton
public int rad
public int shipT
public int size
public int counter
public int tCount
public int bypass
public int play1win
public int play1lose
public int play2win
public int play2lose
public javax.swing.JButton CarrierBut
public javax.swing.JButton BattleBut
public javax.swing.JButton PatrolBut
public javax.swing.JButton SubBut
public javax.swing.JButton DestroyerBut
public javax.swing.JButton tempButton2
public javax.swing.JButton otherClasstest
public java.awt.Panel p1
public java.awt.Panel p2
public java.awt.Panel gameQuit
public javax.swing.JOptionPane win
public javax.swing.JOptionPane replay
public javax.swing.JOptionPane historyp
public javax.swing.JPanel panel
public java.applet.AudioClip hit
public java.applet.AudioClip missed
public java.applet.AudioClip won
public java.applet.AudioClip lose
public java.applet.AudioClip sunk
public java.net.URL buticon
public java.net.URL rolloverbut
protected BattleS.PlayImage imagePanel
protected BattleS.PlayImage winPanel
protected BattleS.PlayImage losePanel
public java.awt.Image[] carrierImages
public java.awt.Image[] battleshipImages
public java.awt.Image[] submarineImages
public java.awt.Image[] ptboatImages
public java.awt.Image[] destroyerImages
public BattleS.HealthBox healthbox
public BattleS.TurnBox turnbox
public java.awt.Image imageToDisplay
public java.awt.Image[] imageArray
public java.awt.Image[] shipArray
public java.awt.Image[] sunkshipArray
public java.awt.Image[] clapArray
public java.awt.Image[] loseArray
public BattleS.ImagePanel aircraft
public BattleS.ImagePanel battleship
public BattleS.ImagePanel destroyer
public BattleS.ImagePanel submarine
public BattleS.ImagePanel patrolboat
public javax.swing.JPopupMenu menu
public BattleS.ImagePanel usunkaircraft
public BattleS.ImagePanel usunkbattle
public BattleS.ImagePanel usunksub
public BattleS.ImagePanel usunkdestroyer
public BattleS.ImagePanel usunkpatrol
public BattleS.ImagePanel opsunkaircraft
public BattleS.ImagePanel opsunkbattle
public BattleS.ImagePanel opsunksub
public BattleS.ImagePanel opsunkdestroyer
public BattleS.ImagePanel opsunkpatrol
public java.awt.Panel numPanel
public java.awt.Panel numPanel2
public java.awt.Panel LPanel
public java.awt.Panel LPanel2
public javax.swing.JOptionPane gametype
public int gtype
public int[][] shiploc
public int[] opshiploc
public int netX
public int netY
public int ret2
java.net.Socket socket
java.net.Socket serverSocket
java.io.PrintWriter out
java.io.BufferedReader in
java.io.PrintWriter out2
java.io.BufferedReader in2
boolean isServer
boolean registering
boolean isAlive
public int port
| Constructor Detail |
|---|
public BattleS()
| Method Detail |
|---|
public void init()
init in class java.applet.Appletpublic void gui()
public void setRadio(int radio)
radio - - the value of the radio button either 1 or 2public int getRadio()
public void setShip(int type)
type - - the type of ship is set herepublic int getShip()
public void setShipSize(int s)
s - - the size of the ship being temporay storedpublic int getShipSize()
public void setCounter(int c)
c - - the current countpublic int getCounter()
public void setTurnCounter()
public int getTurnCounter()
public void byPass(int k)
k - - the bypass modepublic int getbyPass()
public void gameReplay()
public void gameExit()
public void updateConnected()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||