Class JXCConnection


  • public class JXCConnection
    extends java.lang.Object
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      @Nullable java.lang.String getHostname()
      Returns the currently connected server.
      int getPort()
      Returns the currently connected port.
      void setCharacter​(@Nullable java.lang.String character)
      Updates the active character name.
      void setFrame​(@Nullable java.awt.Frame frame)
      Sets the Frame for updating the title.
      void setHost​(@Nullable java.lang.String serverInfo)
      Updates information about the connected host.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JXCConnection

        public JXCConnection​(@NotNull
                             @NotNull KeybindingsManager keybindingsManager,
                             @NotNull
                             @NotNull Shortcuts shortcuts,
                             @NotNull
                             @NotNull Settings settings,
                             @NotNull
                             @NotNull Pickup characterPickup,
                             @NotNull
                             @NotNull CrossfireServerConnection server,
                             @NotNull
                             @NotNull GuiStateManager guiStateManager,
                             @NotNull
                             @NotNull Logger logger)
        Creates a new instance.
        Parameters:
        keybindingsManager - the keybindings manager to update
        shortcuts - the shortcuts to update
        settings - the settings instance to use
        characterPickup - the character pickup instance to update
        server - the crossfire server connection instance used to connect
        guiStateManager - the gui state manager to watch
        logger - the logger to notify about changed server names
    • Method Detail

      • setFrame

        public void setFrame​(@Nullable
                             @Nullable java.awt.Frame frame)
        Sets the Frame for updating the title.
        Parameters:
        frame - the frame or null
      • getHostname

        @Nullable
        public @Nullable java.lang.String getHostname()
        Returns the currently connected server.
        Returns:
        the server or null if unconnected
      • getPort

        public int getPort()
        Returns the currently connected port.
        Returns:
        the port or 0 if unconnected
      • setCharacter

        public void setCharacter​(@Nullable
                                 @Nullable java.lang.String character)
        Updates the active character name.
        Parameters:
        character - the active character; null if not logged in
      • setHost

        public void setHost​(@Nullable
                            @Nullable java.lang.String serverInfo)
        Updates information about the connected host.
        Parameters:
        serverInfo - the hostname; null if not connected