From: Frederick W. <fre...@go...> - 2012-01-07 18:45:32
Attachments:
0001-Added-highlighting-of-private-companies-hexes-trigge.patch
0002-Added-off-screen-image-buffers-for-hexMap-layers-and.patch
0003-Added-config-option-for-highlighting-and-public-comp.patch
0004-Enabled-company-network-info-upon-click-on-company-c.patch
0005-Added-hex-highlighting-on-mouse-position-and-fixed-t.patch
0006-Added-dirty-region-handling-for-hexmap-s-routes-laye.patch
0007-Added-handling-of-concurrent-hex-map-paints.patch
|
Would you please git push this to origin/master? (patches extracted after local branch rebase on Erik's last changes) Originally, I just aimed at adding some interactivity to the hex map (highlighting for mouseovers and more - details see below). But it turned out that rails' response times would not support that (especially if no background map was used). Therefore, the attached series of patches also includes a complete refactoring of the hex map. The key point here is that each layer (tiles, routes, etc.) has its own off-screen buffer into which it exclusively draws and that paintComponent copies these buffers 1:1 except if there were really some changes on the layer (this is supported by an invalidation mechanism). As a result, the performance / responsiveness of the hex map has vastly improved. =================== commit 008edc0b9be69fcd66918d533a1a02f6fff5a63c Added highlighting of private companies' hexes triggered by mouse-over Triggers have been installed on the labels of private companies that are displayed on the start round auction, the OR panel (including the menu), and the game status. commit aa6bde64d2d0502a5aac79c11ed533dd1c06da3b Added off-screen image buffers for hexMap layers and invalidation logic Vastly improved performance of painting the hex map by the following. Defined layers according to the prior drawing order of hexmap's paintComponent (tiles, routes, markings, tokens and texts). HexMap manages these layers is no JComponent any more. Each layer: - is a JComponent and has its z order in MapPanel, - only draws its content if it has been changed, - only draws into its own permanent off-screen drawing buffer, - copies drawing buffer to MapPanel for making its contents visible. Supported this by introducing a new invalidation logic (eg., repaintTiles) that: - indicates to the affected layer which portions are to be re-drawn, - averts redraw of inaffected layers - is triggered by the hexmap or GUIHex whenever possible (no need for triggering by consumers ORPanel, ORUIManager, etc.) commit 4a74fcc8fc7dfaecd87e1644feb9945d10287ad3 Added config option for highlighting and public company highlighting Introduced highlighting for public/minor companies, displaying their home/destination hexes. Added config option for highlighting within the map tab. It applies to all triggers (ORPanel and StatusWindow) except for the menu items (for which highlighting will always take place). Fixed an issue with highlighting privates of portfolios. Now, portfolios are evaluated not during registration but during the mouse over event. commit eea148a1e256b41e66c92471e40aa628fd1fce1d Enabled company network info upon click on company captions If the caption of a company (both in ORPanel and StatusWindow) is clicked, its network info is displayed as if the corresponding network info menu item had been clicked. commit a63b9f693300fb1aa2edb66ac1f9f74832dbd048 Added hex highlighting on mouse position and fixed tooltips Added a new layer on top-most z-order for tool tips. By this means, tool tips are available again (they were not displayed any more after having introduced layered off-screen buffers). Provided for highlighting of the hex under the mouse pointer. commit 684a6125513c1e935b3cba1dd64a1b92d3c7b22c Added dirty region handling for hexmap's routes layer Changes to the train routes do not lead to a redraw of the complete layered pane any more. This has been achieved by adding logic for determining the region affected by train route changes. Apart from further performance gains, this also fixes prior issue that routes were not correctly refreshed. commit 1a5972f9c38b951a63bd333aadf328963c2b697b Added handling of concurrent hex map paints The key blocks / methods are now synchronized on the hex map (acting as the monitor). This became necessary after observing very rare paintComponent calls with invalid clip rectangles (out of JComponent bounds), leading to out-of-bounds paints of the background map. After this addition, no further occurrence of this symptom could be observed. |
From: brett l. <bre...@gm...> - 2012-01-07 19:05:49
|
Applied and pushed. This looks really great. Thanks! ---Brett. On Sat, Jan 7, 2012 at 1:45 PM, Frederick Weld <fre...@go...> wrote: > Would you please git push this to origin/master? > > (patches extracted after local branch rebase on Erik's last changes) > > Originally, I just aimed at adding some interactivity to the hex map > (highlighting for mouseovers and more - details see below). But it > turned out that rails' response times would not support that > (especially if no background map was used). > > Therefore, the attached series of patches also includes a complete > refactoring of the hex map. The key point here is that each layer > (tiles, routes, etc.) has its own off-screen buffer into which it > exclusively draws and that paintComponent copies these buffers 1:1 > except if there were really some changes on the layer (this is > supported by an invalidation mechanism). > > As a result, the performance / responsiveness of the hex map has > vastly improved. > > =================== > > commit 008edc0b9be69fcd66918d533a1a02f6fff5a63c > > Added highlighting of private companies' hexes triggered by mouse-over > > Triggers have been installed on the labels of private companies that > are displayed on the start round auction, the OR panel (including > the menu), and the game status. > > commit aa6bde64d2d0502a5aac79c11ed533dd1c06da3b > > Added off-screen image buffers for hexMap layers and invalidation logic > > Vastly improved performance of painting the hex map by the following. > > Defined layers according to the prior drawing order of hexmap's > paintComponent (tiles, routes, markings, tokens and texts). HexMap > manages these layers is no JComponent any more. > Each layer: > - is a JComponent and has its z order in MapPanel, > - only draws its content if it has been changed, > - only draws into its own permanent off-screen drawing buffer, > - copies drawing buffer to MapPanel for making its contents visible. > > Supported this by introducing a new invalidation logic > (eg., repaintTiles) that: > - indicates to the affected layer which portions are to be re-drawn, > - averts redraw of inaffected layers > - is triggered by the hexmap or GUIHex whenever possible > (no need for triggering by consumers ORPanel, ORUIManager, etc.) > > commit 4a74fcc8fc7dfaecd87e1644feb9945d10287ad3 > > Added config option for highlighting and public company highlighting > > Introduced highlighting for public/minor companies, displaying > their home/destination hexes. > > Added config option for highlighting within the map tab. It applies > to all triggers (ORPanel and StatusWindow) except for the menu items > (for which highlighting will always take place). > > Fixed an issue with highlighting privates of portfolios. Now, > portfolios are evaluated not during registration but during the mouse > over event. > > commit eea148a1e256b41e66c92471e40aa628fd1fce1d > > Enabled company network info upon click on company captions > > If the caption of a company (both in ORPanel and StatusWindow) is > clicked, its network info is displayed as if the corresponding > network info menu item had been clicked. > > commit a63b9f693300fb1aa2edb66ac1f9f74832dbd048 > > Added hex highlighting on mouse position and fixed tooltips > > Added a new layer on top-most z-order for tool tips. By this means, > tool tips are available again (they were not displayed any more after > having introduced layered off-screen buffers). > > Provided for highlighting of the hex under the mouse pointer. > > commit 684a6125513c1e935b3cba1dd64a1b92d3c7b22c > > Added dirty region handling for hexmap's routes layer > > Changes to the train routes do not lead to a redraw of the complete > layered pane any more. This has been achieved by adding logic for > determining the region affected by train route changes. > > Apart from further performance gains, this also fixes prior issue that > routes were not correctly refreshed. > > commit 1a5972f9c38b951a63bd333aadf328963c2b697b > > Added handling of concurrent hex map paints > > The key blocks / methods are now synchronized on the hex map (acting > as the monitor). This became necessary after observing very rare > paintComponent calls with invalid clip rectangles (out of JComponent > bounds), leading to out-of-bounds paints of the background map. > > After this addition, no further occurrence of this symptom could be > observed. > > ------------------------------------------------------------------------------ > Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex > infrastructure or vast IT resources to deliver seamless, secure access to > virtual desktops. With this all-in-one solution, easily deploy virtual > desktops for less than the cost of PCs and save 60% on VDI infrastructure > costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel > |
From: Stefan F. <ste...@we...> - 2012-01-09 11:19:03
|
Frederick: excellent patch that improves UI handling a lot. I hope it will not be too difficult to merge into the 2.0 branch. Stefan On Saturday, January 07, 2012 07:45:25 pm Frederick Weld wrote: > Would you please git push this to origin/master? > > (patches extracted after local branch rebase on Erik's last changes) > > Originally, I just aimed at adding some interactivity to the hex map > (highlighting for mouseovers and more - details see below). But it > turned out that rails' response times would not support that > (especially if no background map was used). > > Therefore, the attached series of patches also includes a complete > refactoring of the hex map. The key point here is that each layer > (tiles, routes, etc.) has its own off-screen buffer into which it > exclusively draws and that paintComponent copies these buffers 1:1 > except if there were really some changes on the layer (this is > supported by an invalidation mechanism). > > As a result, the performance / responsiveness of the hex map has > vastly improved. > > =================== > > commit 008edc0b9be69fcd66918d533a1a02f6fff5a63c > > Added highlighting of private companies' hexes triggered by mouse-over > > Triggers have been installed on the labels of private companies that > are displayed on the start round auction, the OR panel (including > the menu), and the game status. > > commit aa6bde64d2d0502a5aac79c11ed533dd1c06da3b > > Added off-screen image buffers for hexMap layers and invalidation logic > > Vastly improved performance of painting the hex map by the following. > > Defined layers according to the prior drawing order of hexmap's > paintComponent (tiles, routes, markings, tokens and texts). HexMap > manages these layers is no JComponent any more. > Each layer: > - is a JComponent and has its z order in MapPanel, > - only draws its content if it has been changed, > - only draws into its own permanent off-screen drawing buffer, > - copies drawing buffer to MapPanel for making its contents visible. > > Supported this by introducing a new invalidation logic > (eg., repaintTiles) that: > - indicates to the affected layer which portions are to be re-drawn, > - averts redraw of inaffected layers > - is triggered by the hexmap or GUIHex whenever possible > (no need for triggering by consumers ORPanel, ORUIManager, etc.) > > commit 4a74fcc8fc7dfaecd87e1644feb9945d10287ad3 > > Added config option for highlighting and public company highlighting > > Introduced highlighting for public/minor companies, displaying > their home/destination hexes. > > Added config option for highlighting within the map tab. It applies > to all triggers (ORPanel and StatusWindow) except for the menu items > (for which highlighting will always take place). > > Fixed an issue with highlighting privates of portfolios. Now, > portfolios are evaluated not during registration but during the mouse > over event. > > commit eea148a1e256b41e66c92471e40aa628fd1fce1d > > Enabled company network info upon click on company captions > > If the caption of a company (both in ORPanel and StatusWindow) is > clicked, its network info is displayed as if the corresponding > network info menu item had been clicked. > > commit a63b9f693300fb1aa2edb66ac1f9f74832dbd048 > > Added hex highlighting on mouse position and fixed tooltips > > Added a new layer on top-most z-order for tool tips. By this means, > tool tips are available again (they were not displayed any more after > having introduced layered off-screen buffers). > > Provided for highlighting of the hex under the mouse pointer. > > commit 684a6125513c1e935b3cba1dd64a1b92d3c7b22c > > Added dirty region handling for hexmap's routes layer > > Changes to the train routes do not lead to a redraw of the complete > layered pane any more. This has been achieved by adding logic for > determining the region affected by train route changes. > > Apart from further performance gains, this also fixes prior issue that > routes were not correctly refreshed. > > commit 1a5972f9c38b951a63bd333aadf328963c2b697b > > Added handling of concurrent hex map paints > > The key blocks / methods are now synchronized on the hex map (acting > as the monitor). This became necessary after observing very rare > paintComponent calls with invalid clip rectangles (out of JComponent > bounds), leading to out-of-bounds paints of the background map. > > After this addition, no further occurrence of this symptom could be > observed. |
From: Frederick W. <fre...@go...> - 2012-01-09 11:46:00
|
> I hope it will not be too difficult to merge into the 2.0 branch. The scope of the patches is ui/swing-only. Hence, no issue is to be expected during merge. (given the scope of rails 2.0's refactoring is restricted to the games engine - or do you plan to adjust the engine's consumers?) |
From: Stefan F. <ste...@we...> - 2012-01-09 11:56:07
|
I assume it will not be too difficult, but it might not merge automatically. As stated I refactor the Model classes, so there are a few syntactical changes in the UI classes, that are observers of the Model objects. As the UI classes themselves are not very atomic, merges can easily get difficult (especially if you did some white-space changes and/or addition of comments too). Stefan On Monday, January 09, 2012 12:45:49 pm Frederick Weld wrote: > > I hope it will not be too difficult to merge into the 2.0 branch. > > The scope of the patches is ui/swing-only. > Hence, no issue is to be expected during merge. (given the scope of > rails 2.0's refactoring is restricted to the games engine - or do you > plan to adjust the engine's consumers?) > > --------------------------------------------------------------------------- > --- Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a > complex infrastructure or vast IT resources to deliver seamless, secure > access to virtual desktops. With this all-in-one solution, easily deploy > virtual desktops for less than the cost of PCs and save 60% on VDI > infrastructure costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel |