Menu

#108 Show subset comments in Table

any future version
needs-review
None
5
2018-05-25
2018-03-27
No

The user can create comments for subsets, but there seems to be no way to have an overview on the comment distribution for the molecules. Adding a column in the table with all associated (probably abbreviated) comments might improve the use of the commenting a lot.

Discussion

  • Philipp Mewes

    Philipp Mewes - 2018-04-13
    • status: open --> in-progress
     
  • Philipp Mewes

    Philipp Mewes - 2018-04-13

    A first implementation can be found on this branch ([6a3706]). Abbreviation is not applied yet, and tests have still to be run.

     

    Related

    Commit: [6a3706]


    Last edit: Philipp Mewes 2018-04-16
  • Philipp Mewes

    Philipp Mewes - 2018-04-17

    This feature does not break session compatibility. However the new column is not displayed if an old session is loaded. For the table view this is not a problem since the new column can be made visible with the column filter. For the dendogram view this is not possible. The only way is to close the view and re open it again.
    I think this is caused by the view state. The order of all columns is saved there. Columns which are not part of this order are hidden by default. Added a new bug which describes this problem.

     
  • Philipp Mewes

    Philipp Mewes - 2018-04-17
    • status: in-progress --> on-hold
    • Depends On: --> bug #301
     
  • Philipp Mewes

    Philipp Mewes - 2018-04-26
    • Depends On: bug #301 --> BR 301
     
  • Philipp Mewes

    Philipp Mewes - 2018-04-27
    • status: on-hold --> in-progress
    • Depends On: BR 301 -->
     
  • Philipp Mewes

    Philipp Mewes - 2018-05-08

    Works good so far, but i think it would also be nice if the cell zoom always shows the entire comments regardless they are shortened in the table or not. I'm currently looking for a solution for that.

     
    • Philipp Mewes

      Philipp Mewes - 2018-05-09

      Unfortunately that will not work. The cell zoom displays the same component that is used to render the cell itself. The component had to differ between this two cases in any way to adapt the text representation. Currently i see no appropriate way to do this.

       
  • Philipp Mewes

    Philipp Mewes - 2018-05-11

    Ran final tests. Seems to work good.

     
  • Philipp Mewes

    Philipp Mewes - 2018-05-11
    • status: in-progress --> needs-review
     
  • Nils Kriege

    Nils Kriege - 2018-05-17
    • status: needs-review --> re-opened
     
  • Nils Kriege

    Nils Kriege - 2018-05-17
    • Only some of the comments are displayed. I think the comments for all subsets that contain the molecule should be displayed. Which comments are shown in the current implementation?
    • At the end of each entry of 'Subset Comments' the 3 dots indicating abbreviation are shown, even when increasing the size.
    • Using a session saved with v2.6.3 a pop-up window informs me that the session could not be completely restored. This message is confusing, but this is not critical.
    • The following Exception is thrown when trying to sort the table according to the Comments column:
    Uncaught Exception in thread AWT-EventQueue-0 (Thread[AWT-EventQueue-0,6,main])
    java.lang.IllegalArgumentException: Comparison method violates its general contract!
        at java.util.ComparableTimSort.mergeHi(ComparableTimSort.java:866)
        at java.util.ComparableTimSort.mergeAt(ComparableTimSort.java:483)
        at java.util.ComparableTimSort.mergeCollapse(ComparableTimSort.java:404)
        at java.util.ComparableTimSort.sort(ComparableTimSort.java:213)
        at java.util.Arrays.sort(Arrays.java:1246)
        at javax.swing.DefaultRowSorter.sort(DefaultRowSorter.java:607)
        at javax.swing.DefaultRowSorter.setSortKeys(DefaultRowSorter.java:319)
        at javax.swing.DefaultRowSorter.toggleSortOrder(DefaultRowSorter.java:480)
        at javax.swing.plaf.basic.BasicTableHeaderUI$MouseInputHandler.mouseClicked(BasicTableHeaderUI.java:112)
        at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:270)
        at java.awt.Component.processMouseEvent(Component.java:6536)
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
        at java.awt.Component.processEvent(Component.java:6298)
        at java.awt.Container.processEvent(Container.java:2238)
        at java.awt.Component.dispatchEventImpl(Component.java:4889)
        at java.awt.Container.dispatchEventImpl(Container.java:2296)
        at java.awt.Component.dispatchEvent(Component.java:4711)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4897)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4543)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4475)
        at java.awt.Container.dispatchEventImpl(Container.java:2282)
        at java.awt.Window.dispatchEventImpl(Window.java:2746)
        at java.awt.Component.dispatchEvent(Component.java:4711)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760)
        at java.awt.EventQueue.access$500(EventQueue.java:97)
        at java.awt.EventQueue$3.run(EventQueue.java:709)
        at java.awt.EventQueue$3.run(EventQueue.java:703)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
        at java.awt.EventQueue$4.run(EventQueue.java:733)
        at java.awt.EventQueue$4.run(EventQueue.java:731)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:730)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
    
    • Moreover, I the following exception has been thrown often, but I am not sure how to reproduce this:
    WARNING: Executing worker failed: 
    java.util.concurrent.ExecutionException: edu.udo.scaffoldhunter.model.db.UnlockException: Trying to remove lock where no lock is set
        at java.util.concurrent.FutureTask.report(FutureTask.java:122)
        at java.util.concurrent.FutureTask.get(FutureTask.java:192)
        at edu.udo.scaffoldhunter.gui.util.SwingWorker.get(SwingWorker.java:576)
        at edu.udo.scaffoldhunter.gui.util.ProgressWorker.done(ProgressWorker.java:159)
        at edu.udo.scaffoldhunter.gui.util.SwingWorker$4.run(SwingWorker.java:713)
        at edu.udo.scaffoldhunter.gui.util.SwingWorker$DoSubmitAccumulativeRunnable.run(SwingWorker.java:858)
        at edu.udo.scaffoldhunter.gui.util.AccumulativeRunnable.run(AccumulativeRunnable.java:113)
        at edu.udo.scaffoldhunter.gui.util.SwingWorker$DoSubmitAccumulativeRunnable.actionPerformed(SwingWorker.java:880)
        at javax.swing.Timer.fireActionPerformed(Timer.java:313)
        at javax.swing.Timer$DoPostEvent.run(Timer.java:245)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
        at java.awt.EventQueue.access$500(EventQueue.java:97)
        at java.awt.EventQueue$3.run(EventQueue.java:709)
        at java.awt.EventQueue$3.run(EventQueue.java:703)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
    
     
  • Philipp Mewes

    Philipp Mewes - 2018-05-17
    • status: re-opened --> in-progress
     
  • Philipp Mewes

    Philipp Mewes - 2018-05-18

    (1) The comments for the current selected subset and all its descendants are currently displayed. Shall the root-subset be used always instead?
    (2) The comments are separated by a line break. Increasing the row height shows the hidden comments. But maybe another delimiter is more suitable.
    (3) A session saved on the master can be opened without errors, so i think that is not related to this bug. Furthermore i did not touch any state. The only thing is the new column which is not part of the state (see bug #301)
    (4) Could reproduce this, but it seems to appear a bit randomly. Not every click on the table header causes this exception. However it happens frequently. I'm not pretty sure, but this might has something to do with the type of the column, which is an array of subsets.
    Added this to perform the comment merging in a separate renderer, but this can also be done in the model. In this case the type of the column would be string and shouldn't cause any errors.
    (5) The fixes are not related to the database. The subset-molecule relationship is calculated by the model. Maybe a different bug?

     

    Last edit: Philipp Mewes 2018-05-18
  • Philipp Mewes

    Philipp Mewes - 2018-05-18

    Updates:
    (2) Changed the delimiter ([bfc41f])
    (4) The model is responsible for the comments again and the type of the column is String. Could not observe the exception again. Seems to fix this ([f3f834]).

     

    Related

    Commit: [bfc41f]
    Commit: [f3f834]

  • Nils Kriege

    Nils Kriege - 2018-05-18

    (1) Yes.
    (2) Line break is fine. The problem was that an empty line has been added at the end. This caused the depiction of the three dots although no content was hidden. Please use line break and avoid adding an unnecessary break at the end.
    (3) Ok.
    (4) This exception typically is thrown when sorting objects that do not implement Comparable in a consistent way. Please check this and open a bug report if necessary that blocks this feature.
    (5) Ok, I have not seen this exception again.

     
  • Philipp Mewes

    Philipp Mewes - 2018-05-23

    (1) Changed this ([c70eee]).
    (2) Fixed this ([184560]).
    (4) According to this the JTable has a strategy for objects that does not implement Comparable (like an array of subsets). It uses a Collator to sort the values according to their string values. Since no string converter is specified, toString() is called on each object. This results in something like [Ledu.udo.scaffoldhunter.model.db.Subset;@4e5cd174 So the values are actually sorted by their memory addresses as strings. Since the array was created everytime getValueAt() was called, the adresses may differ from sort action to sort action and caused the exception.
    However this is not a problem any longer, since the type of the column is String again now and therefore the column can be sorted like expected.

     

    Related

    Commit: [184560]
    Commit: [c70eee]

    • Nils Kriege

      Nils Kriege - 2018-05-24

      Thanks for fixing this! Is there anything else you want to change before the next review? Otherwise, please set the bug to needs-review.

       
  • Philipp Mewes

    Philipp Mewes - 2018-05-25

    Checked two things:
    - Was not sure. whether sorting makes sense for the comment column, since each cell at least contains the comment for the root subset, which is identical for all cells in this column. But it can be used to group molecues that belong to the same subsets
    - It seemed that the order of comments in a cell changed when the subset was changed, but this was caused by the fact that molecules that belong to this subset where displayed below in the table and were moved to the top by selecting this subset

    Encountered two new bugs: Bug #305 and bug #306, which are not related to this feature. They also occur at the master.

     
  • Philipp Mewes

    Philipp Mewes - 2018-05-25
    • status: in-progress --> needs-review
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.