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. |
From: brett l. <wak...@gm...> - 2006-04-18 00:05:52
|
On 4/17/06, Erik Vos <eri...@hc...> wrote: > > It's been a while, but over the Easter weekend I've finally > managed to do some work on our beloved project. > YAY! :-) > 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. Yeah, many of these are my fault and were introduced in the reorganization of the OR classes. > 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 acti= on. I'd been working on fixing this. However, my preferred solution was to store this information in model objects, and then have repaint() pull the information from the model. Right now, using observables, this data isn't stored anywhere but in the UI= . > 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.... > I've poked a little at the new code, it seems to restore everything to working order. So far, I've found no major issues. > 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. > Good, this will help in developing end-game stats. > - The Stock chart squares are now separate objects (new class GUIStockSpa= ce) > 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. Excellent. I knew this would be necessary... > > - 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. > IMO, it's looking good. I don't think we're missing any important data that the user should see. I still need to double-check the end-game code and see if we handle that correctly. If that works, I'll see about bundling up a JAR for wider consumption/testing. ----Brett. |
From: Erik V. <eri...@hc...> - 2006-04-18 20:07:37
|
> > 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'd been working on fixing this. However, my preferred solution was to > store this information in model objects, and then have repaint() pull > the information from the model. > > Right now, using observables, this data isn't stored anywhere > but in the UI. I would rather say, that it is not stored anywhere else but in the Model, and pushed from there to the UI.... In fact, you can still switch off the use of Observables by setting StatusWindow.useObservables to false... except, that the new StockChart does not (yet) support this mode. But I think that once we split the code into a server and a client part (for Internet play), we will have to resort to some kind of server push (rather than client pull) anyway. Of course, Observer then must be replaced by something that can bridge the client/server gap. To be honest, the value push by the Model is done, but the View does not yet pick it up that value. Instead, once it gets the signal that something has changed, it pulls the value as it would do on a repaint(). But using the pushed value will be a pretty minor change. Erik. |