|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.adom.jade.ui.UserInterface
Defines all the operations that a user interface has to provide in order to present the internal game data in an adequate way to the player. The user interface makes no specific assumptions about the way the data should be presented to the player athough the basic map structure somewhat limits arbitrariy complex displays.
See the comments for the class UserInterfaceFactory about
how to build a user interface.
User interfaces will be instantiated by calling the methods defined below in the following order:
getName and maybe getDescription are called
to allow the player to choose a specific interface.
getProgressAddition is called to determine how much
the initialization of the user interface will add to the overall initialization
of the game.
initialize is called when the specific user interface has
been chosen. This allows the detailed initialization.
Important: JADE itself runs in a separate thread. Thus all methods
below that require user input need some way to block the game thread (probably
with some notify/wait mechanic).
UserInterfaceFactory| Constructor Summary | |
|---|---|
UserInterface()
|
|
| Method Summary | |
|---|---|
abstract void |
centerMap()
Centers the map on the centrail being. |
abstract void |
clearMessages()
Clears the message display area provided by the UI implementation. |
abstract boolean |
displayErrorDialog(java.lang.String message,
java.lang.Throwable error)
Displays a runtime error together with a message. |
abstract Command |
getCommand()
Returns a command from the user interface. |
abstract java.lang.String |
getDescription()
Returns the extended description for this user interface (not more than 400 characters). |
abstract java.lang.String |
getName()
Returns the short name of this specific user interface (not more than 40 characters). |
abstract int |
getProgressAddition()
Returns the numerical amount added to the startup progress maximum by the initialize method of this class. |
abstract TileRepresentation |
getTileRepresentation(int id)
Returns a specific tile representation for a tile ID. |
abstract void |
hideGameWindow()
Hides the game window. |
abstract void |
initialize(SplashScreen splashScreen)
Initializes this particular user interface by executing all CPU intensive initializaton routines. |
abstract void |
message(java.lang.String message)
Displays a message to the user. |
void |
observe(Being originator,
Being target,
java.lang.String message)
Displays a message to the user if this being is visible to the PC. |
void |
observe(Being originator,
java.lang.String message)
Displays a message to the user if this being is visible to the PC. |
abstract void |
setMap(Map currentMap)
Sets the map to use. |
abstract void |
setNonKeyCommandInput(boolean active)
Enables / disables non-keyboard input methods. |
abstract void |
setPointOfView(Being being)
Sets the point of view for the map. |
abstract void |
showGameWindow()
Displays the game window. |
abstract void |
update()
Requires the UI implementation to update the screen right away. |
abstract void |
updateStatistics()
Updates the statistics area. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public UserInterface()
| Method Detail |
|---|
public abstract java.lang.String getName()
public abstract java.lang.String getDescription()
public abstract int getProgressAddition()
initialize method of this class.
public abstract void initialize(SplashScreen splashScreen)
getProgressAddition.
Don't forget to add StartupConstants.PL_PRE_UI_INITIALIZATION
to the progress values you set in this method!
splashScreen - the splash screen to use during
initializationgetProgressAddition(),
SplashScreen,
SplashScreen.setMessage(java.lang.String),
SplashScreen.setProgress(int),
SplashScreen.setStatus(java.lang.String, int),
StartupConstantspublic abstract void setMap(Map currentMap)
currentMap - the map to use for nowpublic abstract Command getCommand()
public abstract void update()
public abstract void setPointOfView(Being being)
being - the being to use as the reference being for the next
map viewpublic abstract void showGameWindow()
public abstract void hideGameWindow()
public void observe(Being originator,
java.lang.String message)
originator - the being responsible for the messagemessage - the message to display
public void observe(Being originator,
Being target,
java.lang.String message)
originator - the being responsible for the messagetarget - the target of the messagemessage - the message to displaypublic abstract void message(java.lang.String message)
message - the message to displaypublic abstract void clearMessages()
public abstract void updateStatistics()
public abstract boolean displayErrorDialog(java.lang.String message,
java.lang.Throwable error)
message - the message to displayerror - the runtime error that occurred
public abstract void setNonKeyCommandInput(boolean active)
active - a boolean value indicating whether other command input
methods are enabled or notpublic abstract void centerMap()
public abstract TileRepresentation getTileRepresentation(int id)
id - the tile ID
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||