Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
Arvid Berg authored
View
2  plugins/net.bioclipse.cdk.business/src/net/bioclipse/cdk/business/CDKManager.java
@@ -1626,7 +1626,7 @@ public double calculateMass(IMolecule molecule) throws BioclipseException {
}
public void generate2dCoordinates(IMolecule molecule,
- IReturner returner,
+ IReturner<IMolecule> returner,
IProgressMonitor monitor)
throws Exception {
monitor.beginTask( "Creating 2d coordinates", IProgressMonitor.UNKNOWN );
View
2  plugins/net.bioclipse.cdk.business/src/net/bioclipse/cdk/business/ICDKManager.java
@@ -692,7 +692,7 @@ public void generate2dCoordinates( List<? extends IMolecule> molecules,
@Recorded
@TestMethods("testGenerate2DCoordinatesSingle")
public void generate2dCoordinates(IMolecule molecule,
- BioclipseUIJob<List<IMolecule>> uiJob)
+ BioclipseUIJob<IMolecule> uiJob)
throws Exception;
@Recorded
View
12 ...t.bioclipse.cdk.jchempaint.view/src/net/bioclipse/cdk/jchempaint/view/JChemPaintView.java
@@ -287,13 +287,13 @@ private void reactOn(ICDKMolecule mol, final IChemicalSelection chemSelection) {
}
if( GeometryTools.has2DCoordinatesNew( atomContainer )<2) {
- BioclipseUIJob<List<IMolecule>> uiJob = new BioclipseUIJob<List<IMolecule>>() {
+ BioclipseUIJob<IMolecule> uiJob = new BioclipseUIJob<IMolecule>() {
@Override
public void runInUI() {
- List<IMolecule> returnValue = getReturnValue();
- if( !returnValue.isEmpty()
- && returnValue.get(0) instanceof ICDKMolecule) {
- ICDKMolecule newMol = (ICDKMolecule) returnValue.get(0);
+ IMolecule returnValue = getReturnValue();
+ if( returnValue != null
+ && returnValue instanceof ICDKMolecule) {
+ ICDKMolecule newMol = (ICDKMolecule) returnValue;
// Don't show 'Generated' message when preference is not set
if(showGeneratedLabel() )
canvasView.add( Message.GENERATED );
@@ -379,7 +379,7 @@ private void updateHighlight(IAtomContainer ac,
}
private void generate2DFrom( IMolecule mol,
- BioclipseUIJob<List<IMolecule>> uiJob) {
+ BioclipseUIJob<IMolecule> uiJob) {
try {
ICDKManager cdk = getCDKManager();
cdk.generate2dCoordinates(mol, uiJob);
Please sign in to comment.
Something went wrong with that request. Please try again.