Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## vutbr.checkers.client.swing
Class ClientThread

    java.lang.Object
      java.lang.Thread
          vutbr.checkers.protocol.ProtocolClient
              vutbr.checkers.client.swing.ClientThread

All Implemented Interfaces:
  java.lang.Runnable

    public class ClientThread

extends ProtocolClient

Trida ClientThread - vlakno komunikace klientske strany

Author:
  Ondrej Novy

Nested Class Summary

Nested classes/interfaces inherited from class java.lang.Thread
`java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler`

Field Summary

Fields inherited from class java.lang.Thread
`MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY`

Constructor Summary
`ClientThread(java.lang.String host, int port, java.lang.String login, boolean register)` Konstruktor

Method Summary
`void` | `connect()` Pripoji se k serveru
`void` | `disconnect()` Odpoji se od serveru
`void` | `game(java.lang.String login)` Odesle RequestGame zpravu
`void` | `gameAccepted(java.lang.String login)` Odesle ReplyGameAccept zpravu a vytvori klientskou hru
`void` | `gameDesync(java.lang.String error)` Rozsynchronizovani hry
`void` | `gameEnd()` Odesle RequestGameEnd zpravu
`void` | `gameRejected(java.lang.String login)` Odesle ReplyGameReject zpravu
`protected ClientGame` | `getClientGame()` Vrati klientskou cast hry
`java.lang.String` | `getHost()` Vrati host
`java.lang.String` | `getLogin()` Vrati login
`MainWindow` | `getMainWindow()` Vrati hlavni okno
`void` | `onBadCommand()`
`void` | `onExit()`
`void` | `onGame(java.lang.String login)`
`void` | `onGameAccept(java.lang.String login)`
`void` | `onGameEnd()`
`void` | `onGameError(java.lang.String error)`
`void` | `onGameReject(java.lang.String login)`
`void` | `onLogin(java.lang.String login)`
`void` | `onLoginError(java.lang.String error)`
`void` | `onLoginOk()`
`void` | `onRegister(java.lang.String login)`
`void` | `onRegisterError(java.lang.String error)`
`void` | `onRegisterOk()`
`void` | `onTurn(int x, int y, int toX, int toY)`
`void` | `onTurnEnd()`
`void` | `onTurnEndError(java.lang.String error)`
`void` | `onTurnEndOk()`
`void` | `onTurnError(java.lang.String error)`
`void` | `onTurnOk()`
`void` | `onUserInGame(java.lang.String login)`
`void` | `onUserLogin(java.lang.String login)`
`void` | `onUserLogout(java.lang.String login)`
`void` | `onUserOutGame(java.lang.String login)`
`void` | `setHost(java.lang.String host)` Nastavi host
`void` | `setLogin(java.lang.String login)` Nastavi login
`protected void` | `setMainWindow(MainWindow mainWindow)` Nastavi hlavni okno
`void` | `setPort(int port)` Nastavi port
`void` | `turn(int x, int y, int toX, int toY)` Odesle RequestTurn zpravu
`void` | `turnEnd()` Odesle RequestTurnEnd zpravu

Methods inherited from class vutbr.checkers.protocol.ProtocolClient
`denyMethod, getProtocolInput, getProtocolOutput, onPing, onPong, setProtocolInput, setProtocolOutput`

Methods inherited from class java.lang.Thread
`activeCount, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, checkAccess, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, 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`

Constructor Detail

### ClientThread

    public ClientThread(java.lang.String host,
                        int port,
                        java.lang.String login,
                        boolean register)

  Konstruktor

  Parameters:
    `host` - Host
    `port` - Port serveru
    `login` - Login hrace

Method Detail

### setMainWindow

    protected void setMainWindow(MainWindow mainWindow)

  Nastavi hlavni okno

  Parameters:
    `mainWindow` - Hlavni okno hry

### setHost

    public void setHost(java.lang.String host)

  Nastavi host

  Parameters:
    `host` - Host

### setPort

    public void setPort(int port)

  Nastavi port

  Parameters:
    `port` - Port serveru

### setLogin

    public void setLogin(java.lang.String login)

  Nastavi login

  Parameters:
    `login` - Login hrace

### getMainWindow

    public MainWindow getMainWindow()

  Vrati hlavni okno

  Returns:
    Hlavni okno hry

### getHost

    public java.lang.String getHost()

  Vrati host

  Returns:
    Host

### getLogin

    public java.lang.String getLogin()

  Vrati login

  Returns:
    Login hrace

### getClientGame

    protected ClientGame getClientGame()

  Vrati klientskou cast hry

  Returns:
    Klientska cast hry

### connect

    public void connect()
                 throws java.io.IOException

  Pripoji se k serveru

  Throws:
    `java.io.IOException`

### disconnect

    public void disconnect()

  Odpoji se od serveru

### game

    public void game(java.lang.String login)

  Odesle RequestGame zpravu

  Parameters:
    `login` - Login protihrace

### gameAccepted

    public void gameAccepted(java.lang.String login)

  Odesle ReplyGameAccept zpravu a vytvori klientskou hru

  Parameters:
    `login` - Login protihrace

### gameRejected

    public void gameRejected(java.lang.String login)

  Odesle ReplyGameReject zpravu

  Parameters:
    `login` - Login protihrace

### turn

    public void turn(int x,
                     int y,
                     int toX,
                     int toY)

  Odesle RequestTurn zpravu

  Parameters:
    `x` - Zdrojova souradnice X
    `y` - Zdrojova souradnice Y
    `toX` - Cilova souradnice X
    `toY` - Cilova souradnice Y

### turnEnd

    public void turnEnd()

  Odesle RequestTurnEnd zpravu

### gameEnd

    public void gameEnd()

  Odesle RequestGameEnd zpravu

### gameDesync

    public void gameDesync(java.lang.String error)

  Rozsynchronizovani hry

### onRegister

    public void onRegister(java.lang.String login)

  Specified by:
    `onRegister` in class `ProtocolClient`

### onLogin

    public void onLogin(java.lang.String login)

  Specified by:
    `onLogin` in class `ProtocolClient`

### onExit

    public void onExit()

  Specified by:
    `onExit` in class `ProtocolClient`

### onGame

    public void onGame(java.lang.String login)

  Specified by:
    `onGame` in class `ProtocolClient`

### onGameEnd

    public void onGameEnd()

  Specified by:
    `onGameEnd` in class `ProtocolClient`

### onTurn

    public void onTurn(int x,
                       int y,
                       int toX,
                       int toY)

  Specified by:
    `onTurn` in class `ProtocolClient`

### onTurnEnd

    public void onTurnEnd()

  Specified by:
    `onTurnEnd` in class `ProtocolClient`

### onBadCommand

    public void onBadCommand()

  Specified by:
    `onBadCommand` in class `ProtocolClient`

### onLoginOk

    public void onLoginOk()

  Specified by:
    `onLoginOk` in class `ProtocolClient`

### onLoginError

    public void onLoginError(java.lang.String error)

  Specified by:
    `onLoginError` in class `ProtocolClient`

### onRegisterOk

    public void onRegisterOk()

  Specified by:
    `onRegisterOk` in class `ProtocolClient`

### onRegisterError

    public void onRegisterError(java.lang.String error)

  Specified by:
    `onRegisterError` in class `ProtocolClient`

### onUserLogin

    public void onUserLogin(java.lang.String login)

  Specified by:
    `onUserLogin` in class `ProtocolClient`

### onUserLogout

    public void onUserLogout(java.lang.String login)

  Specified by:
    `onUserLogout` in class `ProtocolClient`

### onUserInGame

    public void onUserInGame(java.lang.String login)

  Specified by:
    `onUserInGame` in class `ProtocolClient`

### onUserOutGame

    public void onUserOutGame(java.lang.String login)

  Specified by:
    `onUserOutGame` in class `ProtocolClient`

### onGameAccept

    public void onGameAccept(java.lang.String login)

  Specified by:
    `onGameAccept` in class `ProtocolClient`

### onGameReject

    public void onGameReject(java.lang.String login)

  Specified by:
    `onGameReject` in class `ProtocolClient`

### onGameError

    public void onGameError(java.lang.String error)

  Specified by:
    `onGameError` in class `ProtocolClient`

### onTurnError

    public void onTurnError(java.lang.String error)

  Specified by:
    `onTurnError` in class `ProtocolClient`

### onTurnEndError

    public void onTurnEndError(java.lang.String error)

  Specified by:
    `onTurnEndError` in class `ProtocolClient`

### onTurnEndOk

    public void onTurnEndOk()

  Specified by:
    `onTurnEndOk` in class `ProtocolClient`

### onTurnOk

    public void onTurnOk()

  Specified by:
    `onTurnOk` in class `ProtocolClient`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD