Skip to content

Commit

Permalink
Adds generator from extension in jcpeditorwidget and jcpview
Browse files Browse the repository at this point in the history
This is necessary to be able to add all extension generators
to the extensionGenerator field in JChemPaintView and
allows for toggle the visibility of these.
  • Loading branch information
goglepox committed Mar 10, 2015
1 parent a7a2fd3 commit a385ade
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
Expand Up @@ -258,6 +258,7 @@ public void selectionChanged( IWorkbenchPart part, final ISelection selection )
if(ac!=null) {
canvasView.remove( Message.GENERATED );
setAtomContainer( ac );
showExternalGenerators( false );
return;
}
}
Expand All @@ -281,6 +282,7 @@ public void selectionChanged( IWorkbenchPart part, final ISelection selection )

public void run() {
reactOnSelection( selection );
showExternalGenerators( false );
}
});
}
Expand Down
Expand Up @@ -178,7 +178,8 @@ protected List<IGenerator<IAtomContainer>> createGenerators() {
List<IGenerator<IAtomContainer>> generatorList =
new ArrayList<IGenerator<IAtomContainer>>();

generatorList.addAll(ChoiceGenerator.getGeneratorsFromExtension());
// generatorList.addAll(ChoiceGenerator.getGeneratorsFromExtension());

if(extensionGenerator!=null) extensionGenerator.setUse( true );
// This generator can be used for debugging partitioning problems
//generatorList.add( new AtomContainerBoundsGenerator() );
Expand Down
Expand Up @@ -34,6 +34,7 @@
import net.bioclipse.cdk.jchempaint.preferences.GenerateLabelPrefChangedLisener;
import net.bioclipse.cdk.jchempaint.preferences.PreferenceConstants;
import net.bioclipse.cdk.jchempaint.undoredo.SWTUndoRedoFactory;
import net.bioclipse.cdk.jchempaint.view.ChoiceGenerator;
import net.bioclipse.cdk.jchempaint.view.JChemPaintWidget;
import net.bioclipse.core.business.BioclipseException;
import net.bioclipse.core.util.LogUtils;
Expand Down Expand Up @@ -585,6 +586,7 @@ protected List<IGenerator<IAtomContainer>> createGenerators() {
new ArrayList<IGenerator<IAtomContainer>>();
generatorList.add(new BasicSceneGenerator());
generatorList.add(new ExternalHighlightGenerator());
generatorList.addAll( ChoiceGenerator.getGeneratorsFromExtension() );// Fix for ds generators showing up in jcp view
generatorList.addAll( super.createGenerators() );
generatorList.add( phantomGenerator = new PhantomBondGenerator());
generatorList.add(new SelectAtomGenerator());
Expand Down

0 comments on commit a385ade

Please sign in to comment.