Skip to content

Commit

Permalink
Only reset parameters that are registered in the renderer model
Browse files Browse the repository at this point in the history
solves bug 3418
  • Loading branch information
goglepox committed Nov 15, 2012
1 parent c9faf4a commit 87b309f
Showing 1 changed file with 8 additions and 6 deletions.
Expand Up @@ -156,18 +156,20 @@ public static Image createImage( net.bioclipse.core.domain.IMolecule bcmol,
private static void enableSelectedExternalGenerators(ITestResult match,
RendererModel model) {

//Get all external generators
//Get all external generators and filter the ones registered in the model
List<IGeneratorParameter<?>> parameters = model.getRenderingParameters();
List<IGenerator<IAtomContainer>> generators = ChoiceGenerator.getGeneratorsFromExtension();
for(IGenerator gen : generators) {
for(IGenerator<IAtomContainer> gen:generators) {
List<IGeneratorParameter<?>> params = gen.getParameters();
if(params.isEmpty()) continue;
for (IGeneratorParameter param : params){
parameters.removeAll(params);
}

for(IGeneratorParameter<?> param : parameters) {
if (param.getDefault() instanceof Boolean) {
IGeneratorParameter<Boolean> bp= (IGeneratorParameter<Boolean>)param;
model.set(bp.getClass(), false);
}
}
}

//Now, turn on the generator for this match
Expand Down

0 comments on commit 87b309f

Please sign in to comment.