From: Erik V. <eri...@hc...> - 2006-04-17 22:15:12
|
It's been a while, but over the Easter weekend I've finally managed to do some work on our beloved project. I had planned to start with some new functionality, but in an initial test to see where we are I found quite some bugs in the OR GUI. To name a few: - information just written to the ORPanel disappeared almost immediately; - upgrades kept being displayed after tile laying; - pressing Done only showed effect after the ORWindow was resized. It took all my time to get this all fixed (including the usual new errors caused by my own fixes) and add a few improvements. One culprit was the ORPanel custom repaint() method, which wiped out everything just written to the grid. I have renamed this method to recreate(), and it is now only called at an OR change. revalidate() now does the repainting job after each action. I have tried to streamline the interactions between the various OR components such that the whole is a bit more robust now. But no guarantees. So far it has more than once turned out that such attempts have made things worse rather than better.... The improvements include: - The most recent revenue figure is now remembered and displayed across OR's. For this, I have created a new MoneyModel class, into which I also expect to merge some other money-related granular "model" classes later. - The Stock chart squares are now separate objects (new class GUIStockSpace) which observe the model's StockSpace changes. The whole stock chart is now no longer completely recreated at each share action, as it was before. Just the affected squares are redrawn. - After the above change the overlapping part between StatusWindow and StockChart still showed the annoying flickering. This turned out to be caused by the setVisible(true) call for the Stock Chart after each action in the StatusWindow. I have changed this so that setVisible for any window is now only called at the start of a new round. It seems to me, that the GUI is now in a somewhat better shape, although still far from perfect. One thing I would like to add pretty soon is a display of coordinates (like A1, B2) on both the map and the stock chart. Erik. |