Class UserInterface

java.lang.Object
  |
  +--UserInterface
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener

public class UserInterface
extends java.lang.Object
implements java.awt.event.ActionListener

This class implements a simple graphical user interface with a text entry area, a text output area and an optional image.

Version:
1.0 (Jan 2003)
Author:
Michael Kolling

Constructor Summary
UserInterface(GameEngine gameEngine)
          Construct a UserInterface.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Actionlistener interface for entry textfield.
 void enable(boolean on)
          Enable or disable input in the input field.
 void print(java.lang.String text)
          Print out some text into the text area.
 void println(java.lang.String text)
          Print out some text into the text area, followed by a line break.
 void showImage(java.lang.String imageName)
          Show an image file in the interface.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserInterface

public UserInterface(GameEngine gameEngine)
Construct a UserInterface. As a parameter, a Game Engine (an object processing and executing the game commands) is needed.
Parameters:
gameEngine - The GameEngine object implementing the game logic.
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Actionlistener interface for entry textfield.
Specified by:
actionPerformed in interface java.awt.event.ActionListener

enable

public void enable(boolean on)
Enable or disable input in the input field.

print

public void print(java.lang.String text)
Print out some text into the text area.

println

public void println(java.lang.String text)
Print out some text into the text area, followed by a line break.

showImage

public void showImage(java.lang.String imageName)
Show an image file in the interface.


Generated by BlueJ