Great work Tomas! It seems to work perfectly now for me :-)

Have a nice weekend,

Thomas

From: Tomas Pluskal [mailto:plus...@oist.jp]
Sent: 7. november 2014 03:28
To: Developer discussion
Subject: Re: [Mzmine-devel] Error with adding a new peak to the peak list table

Hi Thomas,

I found this bug was a bit deeper - the items in the tree were generated only 
when peak list was added to the tree, but were not regenerated when the peak 
list was modified. I just committed a fix to the SVN, please check if it works 
for you.

Best,

Tomas


On Oct 31, 2014, at 16:20, TFRD (Thomas Franck Dyrlund) 
<t...@steno.dk<mailto:t...@steno.dk>> wrote:


It doesn't work for me - the new peak is still not added. I tried the following:

Index: 
src/main/java/net/sf/mzmine/modules/rawdatamethods/peakpicking/manual/ManualPickerTask.java
===================================================================
--- 
src/main/java/net/sf/mzmine/modules/rawdatamethods/peakpicking/manual/ManualPickerTask.java
          (revision 3423)
+++ 
src/main/java/net/sf/mzmine/modules/rawdatamethods/peakpicking/manual/ManualPickerTask.java
          (working copy)
@@ -30,8 +30,10 @@
import net.sf.mzmine.datamodel.RawDataFile;
import net.sf.mzmine.datamodel.Scan;
import net.sf.mzmine.datamodel.impl.SimpleDataPoint;
+import net.sf.mzmine.desktop.impl.projecttree.PeakListTreeModel;
import net.sf.mzmine.main.MZmineCore;
import net.sf.mzmine.modules.visualization.peaklist.table.PeakListTable;
+import net.sf.mzmine.project.impl.MZmineProjectImpl;
import net.sf.mzmine.taskcontrol.AbstractTask;
import net.sf.mzmine.taskcontrol.TaskStatus;
import net.sf.mzmine.util.Range;
@@ -129,7 +131,13 @@
                  }
                   // Notify the GUI that peaklist contents have changed
-                  if (peakList != null) { 
MZmineCore.getCurrentProject().notifyObjectChanged(peakList, true); }
+                 if (peakList != null) {
+                           
MZmineCore.getCurrentProject().notifyObjectChanged(peakList, true);
+                          MZmineProjectImpl project = (MZmineProjectImpl) 
MZmineCore.getCurrentProject();
+                           PeakListTreeModel treeModel = 
project.getPeakListTreeModel();
+                           treeModel.notifyObjectChanged(peakList, true);
+                 }
         if (table != null) { ((AbstractTableModel) 
table.getModel()).fireTableDataChanged(); }
                   logger.finest("Finished manual peak picker" + processedScans


Also, if I call treeModel.reload(); after 
treeModel.notifyObjectChanged(peakList, true); I can see that the peak list 
view is reloaded but when I expand the peak list again the new peak is still 
not there.

/Thomas


From: Tomas Pluskal [mailto:plus...@oist.jp]
Sent: 31. oktober 2014 01:42
To: Developer discussion
Subject: Re: [Mzmine-devel] Error with adding a new peak to the peak list table

Hi Thomas,

I think instead of adding the row manually to the tree model, you should just 
let the tree model know that the peak list structure has changed, by calling

treeModel.notifyObjectChanged(peakList, true);

That should result in updating the peak list rows in the tree.

Cheers,

Tomas


On Oct 30, 2014, at 19:05, TFRD (Thomas Franck Dyrlund) 
<t...@steno.dk<mailto:t...@steno.dk>> wrote:



Hi everyone

I need your help to fix a bug in MZmine. The problem is that after adding a new 
peak to the peak list table, it is not shown in the tree if the peak list is 
expanded in the main window. When a user then deletes this row, an error is 
returned in SimplePeakList.java l. 246.

Based on what I can see, the problem is that the project tree model is not 
updated after adding the row in SimplePeakList.java:
public void addRow(PeakListRow row) {
       List<RawDataFile> myFiles = Arrays.asList(this.getRawDataFiles());
       for (RawDataFile testFile : row.getRawDataFiles()) {
              if (!myFiles.contains(testFile))
                     throw (new IllegalArgumentException("Data file " + 
testFile+ " is not in this peak list"));
       }
       peakListRows.add(row);

       ...

}

Deleting a non-user added row works fine and I have therefore tried adding the 
following to addRow():
// We have to update the project tree model
MZmineProjectImpl project = (MZmineProjectImpl) MZmineCore.getCurrentProject();
PeakListTreeModel treeModel = project.getPeakListTreeModel();
treeModel.addObject(row);

However, I get the following error when loading a project and also a new row is 
not added to the peak list tree:
java.lang.IllegalStateException: This method must be called from Swing thread

Can anyone please help solve this bug?

Best regards,

Thomas
------------------------------------------------------------------------------
_______________________________________________
Mzmine-devel mailing list
Mzmine-devel@lists.sourceforge.net<mailto:Mzmine-devel@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/mzmine-devel

===============================================
Tomas Pluskal
G0 Cell Unit, Okinawa Institute of Science and Technology Graduate University
1919-1 Tancha, Onna-son, Okinawa 904-0495, Japan
WWW: https://groups.oist.jp/g0
TEL: +81-98-966-8684
Fax: +81-98-966-2890

------------------------------------------------------------------------------
_______________________________________________
Mzmine-devel mailing list
Mzmine-devel@lists.sourceforge.net<mailto:Mzmine-devel@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/mzmine-devel

===============================================
Tomas Pluskal
G0 Cell Unit, Okinawa Institute of Science and Technology Graduate University
1919-1 Tancha, Onna-son, Okinawa 904-0495, Japan
WWW: https://groups.oist.jp/g0
TEL: +81-98-966-8684
Fax: +81-98-966-2890

------------------------------------------------------------------------------
_______________________________________________
Mzmine-devel mailing list
Mzmine-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mzmine-devel

Reply via email to