Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Changed getneraate2dCoords for single molecule to use a ui-job taht r…

…eturns a molecule and not a list
  • Loading branch information...
commit 0498ccda39fadafcb70cee9b4818551bbf58c668 1 parent 0dc48c4
authored June 30, 2010
2  plugins/net.bioclipse.cdk.business/src/net/bioclipse/cdk/business/CDKManager.java
@@ -1626,7 +1626,7 @@ public double calculateMass(IMolecule molecule) throws BioclipseException {
1626 1626
     }
1627 1627
 
1628 1628
       public void generate2dCoordinates(IMolecule molecule,
1629  
-                                        IReturner returner,
  1629
+                                        IReturner<IMolecule> returner,
1630 1630
                                         IProgressMonitor monitor)
1631 1631
                        throws Exception {
1632 1632
           monitor.beginTask( "Creating 2d coordinates", IProgressMonitor.UNKNOWN );
2  plugins/net.bioclipse.cdk.business/src/net/bioclipse/cdk/business/ICDKManager.java
@@ -692,7 +692,7 @@ public void generate2dCoordinates( List<? extends IMolecule> molecules,
692 692
     @Recorded
693 693
     @TestMethods("testGenerate2DCoordinatesSingle")
694 694
     public void generate2dCoordinates(IMolecule molecule,
695  
-                                      BioclipseUIJob<List<IMolecule>> uiJob) 
  695
+                                      BioclipseUIJob<IMolecule> uiJob)
696 696
                         throws Exception;
697 697
 
698 698
     @Recorded
12  plugins/net.bioclipse.cdk.jchempaint.view/src/net/bioclipse/cdk/jchempaint/view/JChemPaintView.java
@@ -287,13 +287,13 @@ private void reactOn(ICDKMolecule mol, final IChemicalSelection chemSelection) {
287 287
         }
288 288
 
289 289
         if( GeometryTools.has2DCoordinatesNew( atomContainer )<2) {
290  
-            BioclipseUIJob<List<IMolecule>> uiJob = new BioclipseUIJob<List<IMolecule>>() {
  290
+            BioclipseUIJob<IMolecule> uiJob = new BioclipseUIJob<IMolecule>() {
291 291
                 @Override
292 292
                 public void runInUI() {
293  
-                    List<IMolecule> returnValue = getReturnValue();
294  
-                    if( !returnValue.isEmpty()
295  
-                        && returnValue.get(0) instanceof ICDKMolecule) {
296  
-                    ICDKMolecule newMol = (ICDKMolecule) returnValue.get(0);
  293
+                    IMolecule returnValue = getReturnValue();
  294
+                    if( returnValue != null 
  295
+                        && returnValue instanceof ICDKMolecule) {
  296
+                    ICDKMolecule newMol = (ICDKMolecule) returnValue;
297 297
                     // Don't show 'Generated' message when preference is not set
298 298
                     if(showGeneratedLabel() )
299 299
                         canvasView.add( Message.GENERATED );
@@ -379,7 +379,7 @@ private void updateHighlight(IAtomContainer ac,
379 379
     }
380 380
 
381 381
     private void generate2DFrom( IMolecule mol,
382  
-            BioclipseUIJob<List<IMolecule>> uiJob)  {
  382
+            BioclipseUIJob<IMolecule> uiJob)  {
383 383
         try {
384 384
             ICDKManager cdk = getCDKManager();
385 385
             cdk.generate2dCoordinates(mol, uiJob);

0 notes on commit 0498ccd

Please sign in to comment.
Something went wrong with that request. Please try again.