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
ConstructorsConstructorDescriptionj2DClient(J2DClientGUI gui) A constructor for JUnit tests.j2DClient(StendhalClient client, UserContext userContext, JFrame splash) Create new j2DClient. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAchievementBox(String title, String description, String category) Display a box for a reached achievementvoidaddEventLine(EventLine line) Add an event line to the chat log.voidaddGameScreenText(double x, double y, String text, NotificationType type, boolean isTalking) Deprecated.voidaddGameScreenText(Entity entity, String text, NotificationType type, boolean isTalking) Deprecated.voidAdd a new window.voidInitiate outfit selection by the user.voidClear the visible channel log.static j2DClientget()Get the default UI.Get the client.Get the main window component.PerceptionListener for the game window.final SoundSystemFacadegets the sound systembooleanare debug messages enabled?voidvoidResets the clients width and height to their default values.voidsetChatLine(String text) Set the input chat line text.voidsetPosition(double x, double y) Set the user's position.voidStart the game loop thread.voidswitchToSpellState(RPObject spell) voidtoggle debug messages
-
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:UserInterfaceAdd an event line to the chat log.- Specified by:
addEventLinein interfaceUserInterface- Parameters:
line- event line
-
addGameScreenText
@Deprecated public void addGameScreenText(double x, double y, String text, NotificationType type, boolean isTalking) Deprecated.Description copied from interface:UserInterfaceadds a text box on the screen- Specified by:
addGameScreenTextin interfaceUserInterface- Parameters:
x- xy- ytext- text to displaytype- type of textisTalking- chat?
-
addGameScreenText
@Deprecated public void addGameScreenText(Entity entity, String text, NotificationType type, boolean isTalking) Deprecated.Description copied from interface:UserInterfaceAdds a text box on the screen.- Specified by:
addGameScreenTextin interfaceUserInterface- Parameters:
entity- Entity that text bubble will follow.text- Text to display.type- Type of text.isTalking- Chat?
-
addAchievementBox
Description copied from interface:UserInterfaceDisplay a box for a reached achievement- Specified by:
addAchievementBoxin 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:UserInterfacegets the sound system- Specified by:
getSoundSystemFacadein interfaceUserInterface- Returns:
- SoundSystemFacade
-
switchToSpellState
-
isDebugEnabled
public boolean isDebugEnabled()Description copied from interface:UserInterfaceare debug messages enabled?- Specified by:
isDebugEnabledin interfaceUserInterface- Returns:
- true, if debug messages are enabled; false otherwise
-
toggleDebugEnabled
public void toggleDebugEnabled()Description copied from interface:UserInterfacetoggle debug messages- Specified by:
toggleDebugEnabledin interfaceUserInterface
-