Package games.stendhal.client.gui
Class WindowUtils
java.lang.Object
games.stendhal.client.gui.WindowUtils
Utilities for system level windows.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidcloseOnEscape(JDialog dialog) Make the dialog close when the used presses escape.static voidrestoreSize(Window window) Restore the size of a tracked window.static voidtrackLocation(Window window, String windowId, boolean followSize) Track the windows location so that it can be restored at next client start.static voidwatchFontSize(Component component) Register a component that should watch for default font size changes.
-
Method Details
-
closeOnEscape
Make the dialog close when the used presses escape. The event will be the same as when the user closes the window using the window manager.- Parameters:
dialog- dialog to make obey the escape key
-
trackLocation
Track the windows location so that it can be restored at next client start.- Parameters:
window- tracked windowwindowId- identifier for the window. This should be unique for each window type. The restored location is looked up by the identifier.followSize- track the size of the window too
-
restoreSize
Restore the size of a tracked window.- Parameters:
window- window whose size should be restored- Throws:
IllegalArgumentException- in case restoring a window that is not tracked is tried
-
watchFontSize
Register a component that should watch for default font size changes. Typically the component should be the top level window.- Parameters:
component- root component for the tree whose font size shall be changed at default font size changes
-