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 TypeMethodDescriptionvoid
deregisterSettingChangeListener(String key, SettingChangeListener listener)
Deregister a change listener.void
formatWindow(ManagedWindow window)
Apply a saved configuration to a window.static WtWindowManager
getProperty(String key, String defaultValue)
Returns a property.boolean
getPropertyBoolean(String key, boolean defaultValue)
Returns a boolean property.int
getPropertyInt(String key, int defaultValue)
Returns an integer property.void
moveTo(ManagedWindow window, int x, int y)
Notify that a window has moved.void
registerSettingChangeListener(String key, SettingChangeListener listener)
Register a change listener for a specific configuration change.void
save()
saves the current settings to a file.void
setDefaultProperties(String name, boolean minimized, int x, int y)
Sets default window properties.void
setMinimized(ManagedWindow window, boolean state)
Notify a window's minimized state has changed.void
setProperty(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
-true
if 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.true
if minimized,false
otherwise
-