I've integrated the image search into PhyloWidget. The images for each node are stored in the class PhyloNode as a LinkedList
. Currently, when loading a tree, a search is conducted as each new node is created. This means that the loading process is quite slow, when really it should be possible to conduct the search after drawing the initial text-only display, or in a separate thread while the file continues to be parsed. Not quite sure how to do that, but I know they're options.
Next step is to display the images within the program as opposed to outside it in tiny little JFrame windows. That'll require some UI manipulation, which I was holding off on until the rest of the code was working. I'm also hoping to search some other databases, because Morphbank has very few images available for some categories of organisms -- at least that's true for the ones in the tree files I've been testing with.
Also, the search I'm conducting returns thumbnail size images. This is useful for quick downloading, but I'd also like to download the full size image so that when a user clicks on the image next to a node, they can see it full-size. I'll need to determine how best to access the full size images from the website and then how/when to download it and store it in the node.
Finally, one of the more amusing issues is the "Image Not Available" image. The Morphbank search only displays results with images, but unfortunately some of those images look like this:
Obviously that isn't too useful, but I don't know how I'd filter those out. I don't know if Image objects are comparable, because I could save one of these "Not Available" ones and test whether the returned image is equal to it before displaying it. I'll save that to work on later, though, since it's not crucial to the general functioning of my code.