Class WtWindowManager
java.lang.Object
games.stendhal.client.gui.wt.core.WtWindowManager
This manager keeps track of all the windows and their positions/ minimized
state.
- Author:
- mtotz
-
Method Summary
Modifier and TypeMethodDescriptionvoidderegisterSettingChangeListener(String key, SettingChangeListener listener)Deregister a change listener.voidformatWindow(ManagedWindow window)Apply a saved configuration to a window.static WtWindowManagergetProperty(String key, String defaultValue)Returns a property.booleangetPropertyBoolean(String key, boolean defaultValue)Returns a boolean property.intgetPropertyInt(String key, int defaultValue)Returns an integer property.voidmoveTo(ManagedWindow window, int x, int y)Notify that a window has moved.voidregisterSettingChangeListener(String key, SettingChangeListener listener)Register a change listener for a specific configuration change.voidsave()saves the current settings to a file.voidsetDefaultProperties(String name, boolean minimized, int x, int y)Sets default window properties.voidsetMinimized(ManagedWindow window, boolean state)Notify a window's minimized state has changed.voidsetProperty(String key, String value)Sets a property.
-
Method Details
-
getInstance
- Returns:
- the windowmanagers instance.
-
setDefaultProperties
Sets default window properties. These are used only when there are no properties known for this panel.- Parameters:
name- window identifierminimized-trueif the window is minimizedx- window x coordinatey- window y coordinate
-
save
public void save()saves the current settings to a file. -
getProperty
Returns a property.- Parameters:
key- Key to look updefaultValue- default value which is returned if the key is not in the configuration file- Returns:
- value
-
getPropertyInt
Returns an integer property.- Parameters:
key- Key to look updefaultValue- default value which is returned if the key is not in the configuration file or not a valid integer- Returns:
- value
-
getPropertyBoolean
Returns a boolean property.- Parameters:
key- Key to look updefaultValue- default value which is returned if the key is not in the configuration file or not a valid boolean- Returns:
- value
-
registerSettingChangeListener
Register a change listener for a specific configuration change.- Parameters:
key- configuration key to be watchedlistener- listener for the changes
-
deregisterSettingChangeListener
Deregister a change listener.- Parameters:
key- the key the listener was registered forlistener- listener to be removed
-
setProperty
Sets a property.- Parameters:
key- keyvalue- value
-
formatWindow
Apply a saved configuration to a window. Nothing happens when this windows configuration is not known.- Parameters:
window- the window
-
moveTo
Notify that a window has moved.- Parameters:
window- the window that movedx- new x coordinatey- new y coordinate
-
setMinimized
Notify a window's minimized state has changed.- Parameters:
window- changed windowstate- new minimization state.trueif minimized,falseotherwise
-