de.tud.dvs1.example
Class ClientImplementation

java.lang.Object
  extended by java.lang.Thread
      extended by de.tud.dvs1.mmpgp2p.MmpgP2PServiceThread
          extended by de.tud.dvs1.mmpgp2p.ClientThread
              extended by de.tud.dvs1.example.ClientImplementation
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.ComponentListener, java.awt.event.WindowListener, java.lang.Runnable, java.util.EventListener

public class ClientImplementation
extends ClientThread
implements java.awt.event.ActionListener, java.awt.event.WindowListener, java.awt.event.ComponentListener

Beispiel-Implementierung eines mmpgp2p Clients. Ausgabe auf der Konsole (bisher kein GUI)


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
static java.lang.String DEFAULT_ZOOM
           
static long DRAW_CANNONBALL_MAX_AGE
           
static long DRAW_MAX_AGE
           
static int HELP_MANUAL
           
static int HELP_WHATIS
           
static int MAX_POWER
           
 
Fields inherited from class de.tud.dvs1.mmpgp2p.ClientThread
MAX_WAIT_NOP, STATUS_PAUSEING, STATUS_PLAYING, STATUS_STARTING, STATUS_UNDEFINED
 
Fields inherited from class de.tud.dvs1.mmpgp2p.MmpgP2PServiceThread
CR, logSystemStatsInterval, logSystemStatsLast, logSystemStatsStart, logSystemStatsWriter, MAGIC
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ClientImplementation(java.util.Properties p)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent ev)
          Methode des Interfaces ActionListener
 void componentHidden(java.awt.event.ComponentEvent e)
           
 void componentMoved(java.awt.event.ComponentEvent e)
           
 void componentResized(java.awt.event.ComponentEvent e)
           
 void componentShown(java.awt.event.ComponentEvent e)
           
 void createAndShowGUI()
          ein Swing GUI
 void gameWorldUpdated()
          Diese Methode wird aufgerufen, sobald die Welt sich geändert hat.
static void log_defered(java.lang.Exception e)
           
static void log_defered(java.lang.String s)
           
 void log(java.lang.Exception e)
           
 void log(java.lang.String s)
           
 void log(java.lang.String s, boolean fatal)
           
static void main(java.lang.String[] args)
          Hauptprogramm starten.
 void windowActivated(java.awt.event.WindowEvent e)
           
 void windowClosed(java.awt.event.WindowEvent e)
           
 void windowClosing(java.awt.event.WindowEvent e)
           
 void windowDeactivated(java.awt.event.WindowEvent e)
           
 void windowDeiconified(java.awt.event.WindowEvent e)
           
 void windowIconified(java.awt.event.WindowEvent e)
           
 void windowOpened(java.awt.event.WindowEvent e)
           
 
Methods inherited from class de.tud.dvs1.mmpgp2p.ClientThread
addCommand, closedConnection, executeCommand, getAvatars, getGameWorld, getRCInformationString, getTicket, incomingConnection, incomingData, login, logout, pauseGame, playGame, run, setGZIP, startGame, stopClient
 
Methods inherited from class de.tud.dvs1.mmpgp2p.MmpgP2PServiceThread
closeServerConnectionWorker, doLogSystemStats, getConnectionWorker, getDebug, getProperties, getProperty, getProperty, getServerConnectionWorker, getSystemLoad, getSystemMemory, getThreadName, getTime, getTraffic, initSystemStats, isRunning, isStarting, log_debug, log_debug, logSystemStats, openConnection, openServerConnection, printSystemStatsFirstLine, readFirstLine, resetSystemStats, setDebug, setProperty, setRunning, stopThread, waitFor, waitForShutdown
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DRAW_MAX_AGE

public static final long DRAW_MAX_AGE
See Also:
Constant Field Values

DRAW_CANNONBALL_MAX_AGE

public static final long DRAW_CANNONBALL_MAX_AGE
See Also:
Constant Field Values

HELP_WHATIS

public static final int HELP_WHATIS
See Also:
Constant Field Values

HELP_MANUAL

public static final int HELP_MANUAL
See Also:
Constant Field Values

MAX_POWER

public static final int MAX_POWER
See Also:
Constant Field Values

DEFAULT_ZOOM

public static final java.lang.String DEFAULT_ZOOM
See Also:
Constant Field Values
Constructor Detail

ClientImplementation

public ClientImplementation(java.util.Properties p)
Method Detail

main

public static void main(java.lang.String[] args)
Hauptprogramm starten. Hier werden hauptsächlich Kommandozeilenparameter ausgelesen und der ClientThread an sich gestartet.


gameWorldUpdated

public void gameWorldUpdated()
Description copied from class: ClientThread
Diese Methode wird aufgerufen, sobald die Welt sich geändert hat.

Specified by:
gameWorldUpdated in class ClientThread

createAndShowGUI

public void createAndShowGUI()
ein Swing GUI


componentHidden

public void componentHidden(java.awt.event.ComponentEvent e)
Specified by:
componentHidden in interface java.awt.event.ComponentListener

componentMoved

public void componentMoved(java.awt.event.ComponentEvent e)
Specified by:
componentMoved in interface java.awt.event.ComponentListener

componentShown

public void componentShown(java.awt.event.ComponentEvent e)
Specified by:
componentShown in interface java.awt.event.ComponentListener

componentResized

public void componentResized(java.awt.event.ComponentEvent e)
Specified by:
componentResized in interface java.awt.event.ComponentListener

windowActivated

public void windowActivated(java.awt.event.WindowEvent e)
Specified by:
windowActivated in interface java.awt.event.WindowListener

windowClosed

public void windowClosed(java.awt.event.WindowEvent e)
Specified by:
windowClosed in interface java.awt.event.WindowListener

windowClosing

public void windowClosing(java.awt.event.WindowEvent e)
Specified by:
windowClosing in interface java.awt.event.WindowListener

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent e)
Specified by:
windowDeactivated in interface java.awt.event.WindowListener

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent e)
Specified by:
windowDeiconified in interface java.awt.event.WindowListener

windowIconified

public void windowIconified(java.awt.event.WindowEvent e)
Specified by:
windowIconified in interface java.awt.event.WindowListener

windowOpened

public void windowOpened(java.awt.event.WindowEvent e)
Specified by:
windowOpened in interface java.awt.event.WindowListener

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent ev)
Methode des Interfaces ActionListener

Specified by:
actionPerformed in interface java.awt.event.ActionListener

log_defered

public static void log_defered(java.lang.String s)

log_defered

public static void log_defered(java.lang.Exception e)

log

public void log(java.lang.String s)
Specified by:
log in class MmpgP2PServiceThread

log

public void log(java.lang.String s,
                boolean fatal)

log

public void log(java.lang.Exception e)
Specified by:
log in class MmpgP2PServiceThread