From: Brett L. <wak...@ea...> - 2005-12-08 23:23:35
|
> In fact, we call refreshStockPanel(), which completely > rebuilds the stock chart. I thought we had used repaint(), but after checking CVS, it looks like I was mistaken. However, refreshStockPanel() is doing the job of repaint(). We should probably even rename the method. My main point was that the process of changing the model, then redrawing the affected UI components ought to be just fine for the ORWindow. If the game-specific logic is getting in the way of the drawing code, that could be moved into a separate controller class, so that the drawing code just reflects decisions made in the controller class. Enabling and disabling panels and buttons automatically calls the objects' repaint() method. I don't see why redrawing the window is a thing to be avoided. > But I wonder how this all would work out in a distributed environment. > If the server would only send a message to all clients to have them all > completely rebuild themselves, that will cause a lot of calls to the server! > It seems to me that atomic update messages from server to client > would do a more efficient job. See, now you're getting into a completely different issue. In a client/server setting, I would expect that we want to pass around only updated information about the model and then have clients call their local repaint() to update the UI to reflect the changes. However, I really hope you're not proposing to start refactoring our code into client and server before the game code is complete. ---Brett. |