Kodi Community Forum
About: creating rows in a render.... - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Supplementary Tools for Kodi (https://forum.kodi.tv/forumdisplay.php?fid=116)
+---- Forum: TinyMediaManager (https://forum.kodi.tv/forumdisplay.php?fid=204)
+---- Thread: About: creating rows in a render.... (/showthread.php?tid=255487)



About: creating rows in a render.... - takkun324 - 2016-01-07

I need to go to my real job soon so I might as well just ask...

It seems, looking at the renderers, that every element in the row is instanced and values applied later. It seems a bit ridiculous to be instancing both a MovieSet row & Movie row every time any row is created within MovieSetTreeCellRenderer. Are these instances being copied somewhere in getTreeCellRendererComponent() before values are applied?

(Note: I'm not looking to rewrite the backend, lol. Wink Just like to understand what my code will do before writing it. )

THX Big Grin


RE: About: creating rows in a render.... - mlaggner - 2016-01-08

no, the MovieSetTreeCellRenderer is only created once and is being used for every Movie/MovieSet in the JTree. For the JTree the components used in the getTreeCellRendererComponent can be re-used; just filled with the new content

hth


RE: About: creating rows in a render.... - takkun324 - 2016-01-08

No, it's just "JTrees" are vary helper-object heavy...

Ok, so the components (or more accurately their "state") do not persist after they are drawn to the panel -because-, once they are drawn, the components are no longer needed for the UI.

If true, then I've been working in PHP/HTM for too long Tongue. ...Gosh, then how can the listeners work? (Or can't listeners work on these re-usable components?)