Hi.
I need some advice on how to implement some things with Swing. I'll use three examples:
I've implemented a file tree. I get the directory contents in the model when getChildCount is called. getChildCount starts a thread to not freeze de interface and get the minimum data needed to sort the children putting the directories first. Then I start a new thread in the model to get more data about the files like the content type to be use in the renderer to show the associated icon (this improves the perceived load speed of the directory).In a similar way I add items to a custom table model for audio items and then I start a thread in the model to get the files metadata (author, title, length, ...)I'm going to develop a YouTube player and I'll use a JList to show a list of results when you make a search. I want to add a thumbnail for every list item obtained from the url provided in the search result page.
What I wanted to know is if it is sane doing things like these in the model or if it would be better to take another approach like getting the data in external to the model threads and then invoking the methods (add, remove, value changed, etc.) in the model. As done right now is very comfortable, but I read frequently that the model only should store the data and nothing more.
Thanks in advance.
Greetings.