From: SourceForge.net <no...@so...> - 2006-05-23 18:29:34
|
Bugs item #1493282, was opened at 2006-05-23 01:33 Message generated for change (Comment added) made by mtotz You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101111&aid=1493282&group_id=1111 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Code Group: None Status: Open Resolution: None Priority: 6 Submitted By: Daniel Herding (wikipedian) Assigned to: Nobody/Anonymous (nobody) Summary: Stendhal: GUI component hierarchy is strange Initial Comment: Hi, The GUI code is really strange. WtPanel is the base component class from which everything else is derived, and at the same time it also acts as a window that has a titlebar, can be minimized etc. This means that, for example, WtButton is in fact a special window without a titlebar. This makes the code very hard to understand and maintain. It would be nice if it was a little bit more like Swing's hierarchy. My suggestion: Create a hierarchy like this: WtWidget '- WtContainer '- WtWindow '- WtList '- SettingsWindow '- CharacterWindow '- BuddiesWindow '- WtBaseframe '- WtButton '- WtLabel '- WtTitlebar Rename WtPanel to WtWidget. Move everything that is window-related (closing, moving, titlebar stuff) to WtWindow. Everything that has a titlebar becomes a WtWindow. A WtWindow has two children: a WtTitlebar and a content pane (a WtContainer). Move everything that is related to managing children to an abstract class called WtContainer. Make WtWindow a subclass of WtContainer, as it has two children. I think I can do most of the required work, but moving the windowing stuff out of WtPanel seems to be too hard for me. ---------------------------------------------------------------------- >Comment By: Matthias Totz (mtotz) Date: 2006-05-23 20:29 Message: Logged In: YES user_id=1127086 The new window toolkit model should support a glass pane, so it can draw JComboBox like widgets. Another nice feature would be some kind of layouter, but only very simple ones, not these fat swing things. ---------------------------------------------------------------------- Comment By: Matthias Totz (mtotz) Date: 2006-05-23 20:00 Message: Logged In: YES user_id=1127086 Well, this hierarchy was build to replace (and consolidate) the old messy swing-gui. Well, it sure is messy too. Your approach sounds reasonable. When modifying the window toolkit we should place them in a new separate package (games.stendhal.client.gui.wt). I can assist you in sorting WtPanel out. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101111&aid=1493282&group_id=1111 |