Class j2DClient

java.lang.Object
games.stendhal.client.gui.j2DClient
All Implemented Interfaces:
UserInterface

public class j2DClient extends Object implements UserInterface
The main class that create the screen and starts the arianne client.
  • Constructor Details

    • j2DClient

      public j2DClient(J2DClientGUI gui)
      A constructor for JUnit tests.
    • j2DClient

      public j2DClient(StendhalClient client, UserContext userContext, JFrame splash)
      Create new j2DClient.
      Parameters:
      client -
      userContext -
      splash - splash screen or null. If not null, it will be used as the main window
  • Method Details

    • get

      public static j2DClient get()
      Get the default UI.
      Returns:
      the instance
    • startGameLoop

      public void startGameLoop()
      Start the game loop thread.
    • addWindow

      public void addWindow(ManagedWindow mw)
      Add a new window.
      Parameters:
      mw - A managed window.
    • requestQuit

      public void requestQuit()
    • addEventLine

      public void addEventLine(EventLine line)
      Description copied from interface: UserInterface
      Add an event line to the chat log.
      Specified by:
      addEventLine in interface UserInterface
      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 interface UserInterface
      Parameters:
      x - x
      y - y
      text - text to display
      type - type of text
      isTalking - chat?
    • addAchievementBox

      public void addAchievementBox(String title, String description, String category)
      Description copied from interface: UserInterface
      Display a box for a reached achievement
      Specified by:
      addAchievementBox in interface UserInterface
      Parameters:
      title - the title of the achievement
      description - the description of the achievement
      category - the category of the achievement
    • chooseOutfit

      public void chooseOutfit()
      Initiate outfit selection by the user.
    • getMainFrame

      public Frame getMainFrame()
      Get the main window component.
      Returns:
      main window
    • resetClientDimensions

      public void resetClientDimensions()
      Resets the clients width and height to their default values.
    • setChatLine

      public void setChatLine(String text)
      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

      public IPerceptionListener getPerceptionListener()
      PerceptionListener for the game window.
      Returns:
      listener
    • getClient

      public StendhalClient getClient()
      Get the client.
      Returns:
      The client.
    • getSoundSystemFacade

      public final SoundSystemFacade getSoundSystemFacade()
      Description copied from interface: UserInterface
      gets the sound system
      Specified by:
      getSoundSystemFacade in interface UserInterface
      Returns:
      SoundSystemFacade
    • switchToSpellState

      public void switchToSpellState(RPObject spell)