nl.bluering.ppracing
Class Ppracing

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--java.applet.Applet
                          |
                          +--nl.bluering.ppracing.Ppracing
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.event.KeyListener, java.awt.MenuContainer, java.awt.event.MouseListener, java.io.Serializable

public class Ppracing
extends java.applet.Applet
implements java.awt.event.MouseListener, java.awt.event.KeyListener, java.awt.event.ActionListener

Paper & Pencil Racing Designed by bluering software development . You can send questions about this source to ernst@bluering.nl this applet can be freely used for whatever you want as long as you first ask permission from the author.

project overview

This applet consists of 15 classes.We have put all these classes in one file for easy downloading. To get the right javadoc documentation, we had to make all classes and many methods public. You might want to put each class in a separate file with the filename equal to the class name. You can also make all classes except reversi non-public (just remove the word public) to avoid errors. The drawback is that you will not see those classes in the documentation.

The javadoc files contain much of the comment, but not all of it. Check the sourcecode for the last details. The list of all classes is:

Ppracing
the toplevel applet class. It contains and handles buttons.
Circuit
The class containing the circuit, and routines for generating a new one.
Player
Contains the routines for handling the player as well as information about him or her.
Car
Contains the basic information about the car, it's speed and it's history
Vector
Basic data class for handling movement-vectors
Mainview
Puts scroll bars around the board
Paperview
the class that paints the board and the cars.
newgamewindow
the window that allows you to set up a new game. It appears when you press new game
newnetwindow
the window that allows you to set up a network game. It also shows a chat-interface.
NetClient
The class that handles all events concerning a client
NetSClient
The class that handles all events concerning the server
NetSClient
The class that handles all events concerning the server
NetSend
This class handles the outgoing communication
NetReceive
This class handles the incoming communication
NetServer
a simple class for detecting new clients.

See Also:
Serialized Form

Inner classes inherited from class java.applet.Applet
java.applet.Applet.AccessibleApplet
 
Inner classes inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
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
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent avt)
          Detects when a button is pressed
 Game getgame()
           
 Paperview getpaper()
           
 void init()
          The init method is called when the applet is loaded by the browser.
 void keyPressed(java.awt.event.KeyEvent kvt)
          Detects when a key is pressed
 void keyReleased(java.awt.event.KeyEvent kvt)
           
 void keyTyped(java.awt.event.KeyEvent kvt)
           
static void main(java.lang.String[] ps)
          this method is quick & dirty trick for running this applet as an application.
 void message(java.lang.String s)
          sets a given text in the message label.
 void mouseClicked(java.awt.event.MouseEvent evt)
          Detects mouse clicks
 void mouseEntered(java.awt.event.MouseEvent evt)
           
 void mouseExited(java.awt.event.MouseEvent evt)
           
 void mousePressed(java.awt.event.MouseEvent evt)
           
 void mouseReleased(java.awt.event.MouseEvent evt)
           
 void paint(java.awt.Graphics g)
          Updates the graphics
 void setmessages()
           
 void showcurrentplayer()
          sets a given text in the player label.
 
Methods inherited from class java.applet.Applet
destroy, getAccessibleContext, 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, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFont, setLayout, update, validate, validateTree
 
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, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, 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, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, 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
 

Method Detail

init

public void init()
The init method is called when the applet is loaded by the browser. It contains mainly layout-concerning items
Overrides:
init in class java.applet.Applet

main

public static void main(java.lang.String[] ps)
this method is quick & dirty trick for running this applet as an application. It is not used when a browser runs this class as an applet.

paint

public void paint(java.awt.Graphics g)
Updates the graphics
Overrides:
paint in class java.awt.Container

message

public void message(java.lang.String s)
sets a given text in the message label.
Parameters:
s - the message to display.

showcurrentplayer

public void showcurrentplayer()
sets a given text in the player label.

setmessages

public void setmessages()

getgame

public Game getgame()
Returns:
The current game

getpaper

public Paperview getpaper()
Returns:
The current paperview

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent evt)
Detects mouse clicks
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent evt)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent evt)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent evt)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent evt)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

keyPressed

public void keyPressed(java.awt.event.KeyEvent kvt)
Detects when a key is pressed
Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent kvt)
Specified by:
keyReleased in interface java.awt.event.KeyListener

keyTyped

public void keyTyped(java.awt.event.KeyEvent kvt)
Specified by:
keyTyped in interface java.awt.event.KeyListener

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent avt)
Detects when a button is pressed
Specified by:
actionPerformed in interface java.awt.event.ActionListener