From: Freek D. <sf_...@ma...> - 2010-01-17 21:05:23
Attachments:
stockwindow.diff
|
Hi, I prefer to keep the stock window open, even in the operating rounds. Attached is a small patch that does that, using a setting in my.properties. While adding this, I found a small bug. If 18xx loads a game, it apparently somehow replays the game so far, because the stock, map (OR), and status windows are called to the front multiple times. I have a game in round 5.2, and when I load it, the following calls are made (from lines 250 - 290 in rails/ui/swing/GameUIManager.java) statusWindow.toFront() stockChart.toFront(); orWindow.toFront(); orWindow.toFront(); stockChart.toFront(); stockChart.toFront(); statusWindow.toFront() orWindow.toFront(); stockChart.toFront(); stockChart.toFront(); statusWindow.toFront() orWindow.toFront(); stockChart.toFront(); stockChart.toFront(); statusWindow.toFront() orWindow.toFront(); stockChart.toFront(); stockChart.toFront(); statusWindow.toFront() orWindow.toFront(); stockChart.toFront(); stockChart.toFront(); statusWindow.toFront() stockChart.toFront(); statusWindow.toFront() I have not created a patch for this second bug. Regards, Freek |
From: Erik V. <eri...@xs...> - 2010-01-17 22:52:42
|
I prefer to keep the stock window open, even in the operating rounds. AFAIK the status (stock) window always keep open, and always has done that. WHat makes you think that it doesn't? While adding this, I found a small bug. If 18xx loads a game, it apparently somehow replays the game so far, because the stock, map (OR), and status windows are called to the front multiple times. I have a game in round 5.2, and when I load it, the following calls are made (from lines 250 - 290 in rails/ui/swing/GameUIManager.java) Thanks for reporting this. The newly created "visibility hints" are stacked up during loading and should have been after that. They now are. Erik. |
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 |
From: Erik V. <eri...@xs...> - 2010-01-18 21:33:39
|
Apologies, I had misread your previous email. Having such an option looks reasonable to me. Or shall we leave the Stock Chart always open (at the bottom of the window stack)? Brett does not seem to like that, as he implemented it closure at the end of the stock round (long ago). Erik. -----Original Message----- From: Freek Dijkstra [mailto:sf_...@ma...] Sent: Monday 18 January 2010 21:28 To: Development list for Rails: an 18xx game Subject: Re: [Rails-devel] Feature: keep stock window open 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 ---------------------------------------------------------------------------- -- Throughout its 18-year history, RSA Conference consistently attracts the world's best and brightest in the field, creating opportunities for Conference attendees to learn about information security's most important issues through interactions with peers, luminaries and emerging and established companies. http://p.sf.net/sfu/rsaconf-dev2dev _______________________________________________ Rails-devel mailing list Rai...@li... https://lists.sourceforge.net/lists/listinfo/rails-devel |
From: brett l. <wak...@gm...> - 2010-01-18 22:49:27
|
This should really be a configurable preference. I implemented it mostly to avoid multiple window clutter, and showing users irrelevant information. Most of the time, the stock chart doesn't influence an operating round (at least, in my experience). ---Brett. On Mon, Jan 18, 2010 at 1:33 PM, Erik Vos <eri...@xs...> wrote: > Apologies, I had misread your previous email. > Having such an option looks reasonable to me. > > Or shall we leave the Stock Chart always open > (at the bottom of the window stack)? > > Brett does not seem to like that, as he implemented > it closure at the end of the stock round (long ago). > > Erik. > > -----Original Message----- > From: Freek Dijkstra [mailto:sf_...@ma...] > Sent: Monday 18 January 2010 21:28 > To: Development list for Rails: an 18xx game > Subject: Re: [Rails-devel] Feature: keep stock window open > > 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 > > > ---------------------------------------------------------------------------- > -- > Throughout its 18-year history, RSA Conference consistently attracts the > world's best and brightest in the field, creating opportunities for > Conference > attendees to learn about information security's most important issues > through > interactions with peers, luminaries and emerging and established companies. > http://p.sf.net/sfu/rsaconf-dev2dev > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel > > > ------------------------------------------------------------------------------ > Throughout its 18-year history, RSA Conference consistently attracts the > world's best and brightest in the field, creating opportunities for Conference > attendees to learn about information security's most important issues through > interactions with peers, luminaries and emerging and established companies. > http://p.sf.net/sfu/rsaconf-dev2dev > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel > |
From: Freek D. <sf_...@ma...> - 2010-01-19 09:01:30
|
On 18 jan 2010, brett lentz wrote: > This should really be a configurable preference. I fully agree. To be precise, it should be configurable per (GUI) client. I only turn it on on a computer with two monitors, but off on a laptop. The my.properties is ideal, as per my patch. If someone could check the patch [1] and apply it, I appreciate it. Is the name of the option "stock.window.open" well chosen? Regards, Freek [1] http://sourceforge.net/mailarchive/attachment.php?list_name=rails-devel&message_id=4B537B89.4090408%40macfreek.nl&counter=1 |
From: Erik V. <eri...@xs...> - 2010-01-19 18:43:13
|
Today I have implemented it in a very similar way (I didn't have your patch handy). I'll upload it later with other changes. Erik. -----Original Message----- From: Freek Dijkstra [mailto:sf_...@ma...] Sent: Tuesday 19 January 2010 10:01 To: Development list for Rails: an 18xx game Subject: Re: [Rails-devel] Feature: keep stock window open On 18 jan 2010, brett lentz wrote: > This should really be a configurable preference. I fully agree. To be precise, it should be configurable per (GUI) client. I only turn it on on a computer with two monitors, but off on a laptop. The my.properties is ideal, as per my patch. If someone could check the patch [1] and apply it, I appreciate it. Is the name of the option "stock.window.open" well chosen? Regards, Freek [1] http://sourceforge.net/mailarchive/attachment.php?list_name=rails-devel&mess age_id=4B537B89.4090408%40macfreek.nl&counter=1 ---------------------------------------------------------------------------- -- Throughout its 18-year history, RSA Conference consistently attracts the world's best and brightest in the field, creating opportunities for Conference attendees to learn about information security's most important issues through interactions with peers, luminaries and emerging and established companies. http://p.sf.net/sfu/rsaconf-dev2dev _______________________________________________ Rails-devel mailing list Rai...@li... https://lists.sourceforge.net/lists/listinfo/rails-devel |