2009-08-19 23:01:37 UTC
I am trying to display a large set of data (i.e the whole contents of a disk) with JTreeMap.
Right now it is impossible as the speed is so slow for the calculation. After hacking around the code I think the following optimization could be helpful and easy to implement.
1. don't calculate if the area is too small, for example
void calculatePositionsRec(...) {
if (w0 * h0 < 20) return;
2. don't calculate if the candidates are too many to display
if (w0 * h0 < v.size())return;
3. only re-calculate if necessary. i.e don't re-calculate for mouse move events, right click, etc.