Class WtWindowManager

java.lang.Object
games.stendhal.client.gui.wt.core.WtWindowManager

public final class WtWindowManager extends Object
This manager keeps track of all the windows and their positions/ minimized state.
Author:
mtotz
  • Method Details

    • getInstance

      public static WtWindowManager getInstance()
      Returns:
      the windowmanagers instance.
    • setDefaultProperties

      public void setDefaultProperties(String name, boolean minimized, int x, int y)
      Sets default window properties. These are used only when there are no properties known for this panel.
      Parameters:
      name - window identifier
      minimized - true if the window is minimized
      x - window x coordinate
      y - window y coordinate
    • save

      public void save()
      saves the current settings to a file.
    • getProperty

      public String getProperty(String key, String defaultValue)
      Returns a property.
      Parameters:
      key - Key to look up
      defaultValue - default value which is returned if the key is not in the configuration file
      Returns:
      value
    • getPropertyInt

      public int getPropertyInt(String key, int defaultValue)
      Returns an integer property.
      Parameters:
      key - Key to look up
      defaultValue - default value which is returned if the key is not in the configuration file or not a valid integer
      Returns:
      value
    • getPropertyBoolean

      public boolean getPropertyBoolean(String key, boolean defaultValue)
      Returns a boolean property.
      Parameters:
      key - Key to look up
      defaultValue - default value which is returned if the key is not in the configuration file or not a valid boolean
      Returns:
      value
    • registerSettingChangeListener

      public void registerSettingChangeListener(String key, SettingChangeListener listener)
      Register a change listener for a specific configuration change.
      Parameters:
      key - configuration key to be watched
      listener - listener for the changes
    • deregisterSettingChangeListener

      public void deregisterSettingChangeListener(String key, SettingChangeListener listener)
      Deregister a change listener.
      Parameters:
      key - the key the listener was registered for
      listener - listener to be removed
    • setProperty

      public void setProperty(String key, String value)
      Sets a property.
      Parameters:
      key - key
      value - value
    • formatWindow

      public void formatWindow(ManagedWindow window)
      Apply a saved configuration to a window. Nothing happens when this windows configuration is not known.
      Parameters:
      window - the window
    • moveTo

      public void moveTo(ManagedWindow window, int x, int y)
      Notify that a window has moved.
      Parameters:
      window - the window that moved
      x - new x coordinate
      y - new y coordinate
    • setMinimized

      public void setMinimized(ManagedWindow window, boolean state)
      Notify a window's minimized state has changed.
      Parameters:
      window - changed window
      state - new minimization state. true if minimized, false otherwise