From: Till S. <til...@tu...> - 2014-04-07 14:37:51
|
Hi Shamshad, first of all i have to say sorry for the mess in the table view. I have looked through the code and many things are implemented in a non-standard way. Therefore, it is not easy to add the new functionality here. I did not expect this bug to be so messy, otherwise we would not have proposed to fix it on the mailing list. Normally one should just use the TableRowSorter and add a comparator that handles the sorting. The TableView is using a custom TableViewRowSorter, instead. To apply a sorting, that is not based on the values of the model (they are lazy loaded and therefore not available all the time) it creates a wrapper around the model that replaces the values with the sorting values (which are calculated by the database). Regarding your patch: Although it might work, there are some things that need to be fixed before we can apply it. 1. Usage: There should be an option to toggle the behavior between "selection first" and "selection has no influence" 2. Code Structure: - It is a no go to re-implement the TableRowSorter and DefaultRowSorter and apply a different ordering there. The best practice would be to overload a comparator (see above). and fix the current ugly implementation in the TableRowSorter, which replaces the sort values. Since we do not expect this depth of changes from you, it would also be fine if you just add a comparator, that only handles the selection case, and keep the value replacing code for the normal sorting. - System.out.println should be removed (there is some debug output) Greetings Till Am Montag, 7. April 2014, 12:07:30 schrieb Shamshad Alam: > Hi Sir, > > "Feature Request #41 : Table View Sort by Selection" has been implemented. > Find patches attached with mail. > > I have tested it on small dataset which consists of just 602 molecules and > I found no any performance issue. > > There might be performance issue because two lists, one for selected rows > and other for unselected rows, are sorted separately and thereafter both > are merged together. > > Could you provide a database which have relatively large number of > molecules? It will help me to assess the performance of whatever I > implement. > > > Thanks > Shamshad > > -- Dipl.-Inf. Till Schäfer TU Dortmund University Chair 11 - Algorithm Engineering Otto-Hahn-Str. 14 / Room 237 44227 Dortmund, Germany e-mail: til...@cs... phone: +49(231)755-7706 fax: +49(231)755-7740 web: http://ls11-www.cs.uni-dortmund.de/staff/schaefer pgp: https://keyserver2.pgp.com/vkd/SubmitSearch.event?&&SearchCriteria=0xD84DED79 |