From: Freek D. <sf_...@ma...> - 2010-01-18 20:27:40
|
Freek Dijkstra wrote: > I prefer to keep the stock window open, even in the operating > rounds. Erik Vos replied: > AFAIK the status (stock) window always keep open, and always has done that. > WHat makes you think that it doesn't? The "Game Status" window remains open. I meant the "Stock Chart" window, which closes as soon as the first operating round begins. Do you experience other behaviour? Here is a (manually determined) stack trace where this happens: (starting with the click on the "Pass" button in the status window, marking the end of the stock round): DefaultButtonModel.setPressed() DefaultButtonModel.fireActionPerformed() ActionButton(AbstractButton).fireActionPerformed() StatusWindow_1856(StatusWindow).actionPerformed() StatusWindow_1856(StatusWindow).process() GameUIManager.processOnServer() GameUIManager.updateUI() In this routine is the code: > for (GuiHints.VisibilityHint hint : uiHints.getVisibilityHints()) { > switch (hint.getType()) { > case STOCK_MARKET: > boolean stockChartVisibilityHint = hint.getVisibility(); > if (stockChartVisibilityHint != previousStockChartVisibilityHint) { > stockChart.setVisible(stockChartVisibilityHint); > previousStockChartVisibilityHint = stockChartVisibilityHint; > } > if (stockChartVisibilityHint) stockChart.toFront(); > break; [...] Since stockChartVisibilityHint is always false, the line > stockChart.setVisible(stockChartVisibilityHint); always makes sure that the stock window is closed. Therefor, I propose to add a preference setting that changes this behaviour (for the exact diff, see my previous mail): > for (GuiHints.VisibilityHint hint : uiHints.getVisibilityHints()) { > switch (hint.getType()) { > case STOCK_MARKET: > boolean stockChartVisibilityHint = hint.getVisibility() || > "yes".equalsIgnoreCase(Config.get("stock.window.open")); > if (stockChartVisibilityHint != previousStockChartVisibilityHint) { > stockChart.setVisible(stockChartVisibilityHint); > previousStockChartVisibilityHint = stockChartVisibilityHint; > } > if (stockChartVisibilityHint) stockChart.toFront(); > break; Regards, Freek Dijkstra |