Package games.stendhal.client.gui
Class j2DClient
java.lang.Object
games.stendhal.client.gui.j2DClient
- All Implemented Interfaces:
UserInterface
The main class that create the screen and starts the arianne client.
-
Constructor Summary
ConstructorDescriptionj2DClient(J2DClientGUI gui)
A constructor for JUnit tests.j2DClient(StendhalClient client, UserContext userContext, JFrame splash)
Create new j2DClient. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAchievementBox(String title, String description, String category)
Display a box for a reached achievementvoid
addEventLine(EventLine line)
Add an event line to the chat log.void
addGameScreenText(double x, double y, String text, NotificationType type, boolean isTalking)
adds a text box on the screenvoid
addWindow(ManagedWindow mw)
Add a new window.void
Initiate outfit selection by the user.void
Clear the visible channel log.static j2DClient
get()
Get the default UI.Get the client.Get the main window component.PerceptionListener for the game window.gets the sound systemvoid
void
Resets the clients width and height to their default values.void
setChatLine(String text)
Set the input chat line text.void
setPosition(double x, double y)
Set the user's position.void
Start the game loop thread.void
switchToSpellState(RPObject spell)
-
Constructor Details
-
j2DClient
A constructor for JUnit tests. -
j2DClient
Create new j2DClient.- Parameters:
client
-userContext
-splash
- splash screen ornull
. If notnull
, it will be used as the main window
-
-
Method Details
-
get
Get the default UI.- Returns:
- the instance
-
startGameLoop
public void startGameLoop()Start the game loop thread. -
addWindow
Add a new window.- Parameters:
mw
- A managed window.
-
requestQuit
public void requestQuit() -
addEventLine
Description copied from interface:UserInterface
Add an event line to the chat log.- Specified by:
addEventLine
in interfaceUserInterface
- Parameters:
line
- event line
-
addGameScreenText
public void addGameScreenText(double x, double y, String text, NotificationType type, boolean isTalking)Description copied from interface:UserInterface
adds a text box on the screen- Specified by:
addGameScreenText
in interfaceUserInterface
- Parameters:
x
- xy
- ytext
- text to displaytype
- type of textisTalking
- chat?
-
addAchievementBox
Description copied from interface:UserInterface
Display a box for a reached achievement- Specified by:
addAchievementBox
in interfaceUserInterface
- Parameters:
title
- the title of the achievementdescription
- the description of the achievementcategory
- the category of the achievement
-
chooseOutfit
public void chooseOutfit()Initiate outfit selection by the user. -
getMainFrame
Get the main window component.- Returns:
- main window
-
resetClientDimensions
public void resetClientDimensions()Resets the clients width and height to their default values. -
setChatLine
Set the input chat line text.- Parameters:
text
- The text.
-
clearGameLog
public void clearGameLog()Clear the visible channel log. -
setPosition
public void setPosition(double x, double y)Set the user's position.- Parameters:
x
- The user's X coordinate.y
- The user's Y coordinate.
-
getPerceptionListener
PerceptionListener for the game window.- Returns:
- listener
-
getClient
Get the client.- Returns:
- The client.
-
getSoundSystemFacade
Description copied from interface:UserInterface
gets the sound system- Specified by:
getSoundSystemFacade
in interfaceUserInterface
- Returns:
- SoundSystemFacade
-
switchToSpellState
-