Class Sarj

java.lang.Object
  extended by java.awt.event.WindowAdapter
      extended by Sarj
All Implemented Interfaces:
ConnectionListener, GUIListener, java.awt.event.WindowFocusListener, java.awt.event.WindowListener, java.awt.event.WindowStateListener, java.lang.Runnable, java.util.EventListener

public class Sarj
extends java.awt.event.WindowAdapter
implements java.lang.Runnable, GUIListener, ConnectionListener

The main SARJ application class


Constructor Summary
Sarj()
           
 
Method Summary
static void main(java.lang.String[] args)
          The main method
 void onAction(int actionID)
          Called when the Perform button is clicked on the GUI
 void onAddAdmin(java.lang.String playerIP)
          Called when the user chooses to add a player to the remote administrators list
 void onBanPlayer(int playerNumber)
          Called when the user chooses to ban a player from the list of currently connected players
 void onCommand(java.lang.String command)
          Called when a command is sent from the user
 void onConnect(java.lang.String address, int port, java.lang.String password)
          Called when the Connect button is clicked on the GUI
 void onConnected()
          Called when a connection is successfully established with a server, as a result of calling the connect method of a Connection object.
 void onDisconnect()
          Called when the Disconnect button is clicked on the GUI
 void onDisconnected()
          Called when a connection to a server is lost, either gracefully or due to error
 void onError(java.lang.String message)
          Called when a connection error occurrs
 void onExit()
          Called when the Exit button is clicked on the GUI, or the main GUI window is closed
 void onKickPlayer(int playerNumber)
          Called when the user chooses to kick a player from the list of currently connected players
 void onRefresh()
          Called when the Refresh button is clicked on the GUI, or the refresh timer triggers
 void onRemoveAdmin(java.lang.String playerIP)
          Called when the user chooses to remove a player from the remote administrators list
 void onSetTeam(int playerNumber, int teamNumber)
          Called when the user chooses to assign a connected player to a particular team
 void run()
          Called when the main execution thread is started by a call to Thread.start()
 void Sarj()
          Default constructor
 
Methods inherited from class java.awt.event.WindowAdapter
windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowGainedFocus, windowIconified, windowLostFocus, windowOpened, windowStateChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Sarj

public Sarj()
Method Detail

main

public static void main(java.lang.String[] args)
The main method


Sarj

public void Sarj()
Default constructor


run

public void run()
Called when the main execution thread is started by a call to Thread.start()

Specified by:
run in interface java.lang.Runnable

onConnect

public void onConnect(java.lang.String address,
                      int port,
                      java.lang.String password)
Called when the Connect button is clicked on the GUI

Specified by:
onConnect in interface GUIListener
Parameters:
address - the address of the Soldat server, in dotted IP format (X.X.X.X)
port - the port number of the Soldat server
password - the remote administration password for the server

onDisconnect

public void onDisconnect()
Called when the Disconnect button is clicked on the GUI

Specified by:
onDisconnect in interface GUIListener

onExit

public void onExit()
Called when the Exit button is clicked on the GUI, or the main GUI window is closed

Specified by:
onExit in interface GUIListener

onAction

public void onAction(int actionID)
Called when the Perform button is clicked on the GUI

Specified by:
onAction in interface GUIListener
Parameters:
actionID - the ID of the action to be performed

onRefresh

public void onRefresh()
Called when the Refresh button is clicked on the GUI, or the refresh timer triggers

Specified by:
onRefresh in interface GUIListener

onCommand

public void onCommand(java.lang.String command)
Called when a command is sent from the user

Specified by:
onCommand in interface GUIListener
Parameters:
command - the command string issued by the user

onKickPlayer

public void onKickPlayer(int playerNumber)
Called when the user chooses to kick a player from the list of currently connected players

Specified by:
onKickPlayer in interface GUIListener
Parameters:
playerNumber - the unique in-game ID number of the player

onBanPlayer

public void onBanPlayer(int playerNumber)
Called when the user chooses to ban a player from the list of currently connected players

Specified by:
onBanPlayer in interface GUIListener
Parameters:
playerNumber - the unique in-game ID number of the player

onAddAdmin

public void onAddAdmin(java.lang.String playerIP)
Called when the user chooses to add a player to the remote administrators list

Specified by:
onAddAdmin in interface GUIListener
Parameters:
playerIP - the IP address of the player

onRemoveAdmin

public void onRemoveAdmin(java.lang.String playerIP)
Called when the user chooses to remove a player from the remote administrators list

Specified by:
onRemoveAdmin in interface GUIListener
Parameters:
playerIP - the IP address of the player

onSetTeam

public void onSetTeam(int playerNumber,
                      int teamNumber)
Called when the user chooses to assign a connected player to a particular team

Specified by:
onSetTeam in interface GUIListener
Parameters:
playerNumber - the unique in-game ID number of the player
teamNumber - the ID of the team to assign the player to, where 1 = alpha, 2 = beta, 3 = charlie and 4 = delta

onConnected

public void onConnected()
Called when a connection is successfully established with a server, as a result of calling the connect method of a Connection object.

Specified by:
onConnected in interface ConnectionListener

onDisconnected

public void onDisconnected()
Called when a connection to a server is lost, either gracefully or due to error

Specified by:
onDisconnected in interface ConnectionListener

onError

public void onError(java.lang.String message)
Called when a connection error occurrs

Specified by:
onError in interface ConnectionListener
Parameters:
message - the error message