feud.testgame.gui
Class ServerSelection

java.lang.Object
  extended byfeud.testgame.gui.ServerSelection
All Implemented Interfaces:
DataChangeListener, GUIListener

public class ServerSelection
extends java.lang.Object
implements DataChangeListener, GUIListener

Sets up and manages the server selection window which is displayed after startup and when pressing ESC while playing.


Constructor Summary
ServerSelection(ServerBrowser sb, GameClient client)
          Creates a new instance using a given server browser and client instance.
 
Method Summary
 void dataChanged(java.lang.Object data)
          Data has been changed...
 void draw(com.threed.jpct.FrameBuffer buffer)
          Draws the ServerSelection.
 void elementChanged(java.lang.String label, java.lang.String data)
          Notify the implemention about a change in the GUI.
 void evaluateInput(MouseMapper mouse, com.threed.jpct.util.KeyMapper keyMapper)
          Processes key and mouse events.
 boolean isVisible()
          Is the ServerSelection visible?
 void setVisible(boolean visible)
          Enables/Disables the whole ServerSelection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerSelection

public ServerSelection(ServerBrowser sb,
                       GameClient client)
                throws java.lang.Exception
Creates a new instance using a given server browser and client instance. Albeit this behaves like a GUIComponent in some ways, it isn't any.

Parameters:
sb - the server browser as an instance of ServerBrowser
client - the client as an instance of GameClient
Throws:
java.lang.Exception
Method Detail

dataChanged

public void dataChanged(java.lang.Object data)
Description copied from interface: DataChangeListener
Data has been changed...

Specified by:
dataChanged in interface DataChangeListener
Parameters:
data - the new data

setVisible

public void setVisible(boolean visible)
Enables/Disables the whole ServerSelection.

Parameters:
visible - visible...or not...

isVisible

public boolean isVisible()
Is the ServerSelection visible?

Returns:
boolean is it?

evaluateInput

public void evaluateInput(MouseMapper mouse,
                          com.threed.jpct.util.KeyMapper keyMapper)
Processes key and mouse events. What this actually does, is to redirect such events to the server selection window, which is a real GUIComponent which can process these events.

Parameters:
mouse - the MouseMapper
keyMapper - the KeyMapper

draw

public void draw(com.threed.jpct.FrameBuffer buffer)
Draws the ServerSelection.

Parameters:
buffer - the FrameBuffer to draw to.

elementChanged

public void elementChanged(java.lang.String label,
                           java.lang.String data)
Description copied from interface: GUIListener
Notify the implemention about a change in the GUI.

Specified by:
elementChanged in interface GUIListener
Parameters:
label - the label of the element in question
data - the data that this element holds (if any, null otherwise)