Skip to content
Browse files

Because the renderers are now typed itself, we can use this.generator…

…s instead, fixign a NullPointerException while rendering reactions
  • Loading branch information...
1 parent 2ffc5a1 commit 965c6514bab6c90bbbace8057f7f547b7ed09969 @egonw egonw committed with egonw Jan 26, 2011
Showing with 3 additions and 8 deletions.
  1. +3 −8 src/main/org/openscience/cdk/renderer/ReactionRenderer.java
View
11 src/main/org/openscience/cdk/renderer/ReactionRenderer.java
@@ -107,11 +107,6 @@
private IRenderer<IMoleculeSet> moleculeSetRenderer;
- /**
- * Generators specific to reactions
- */
- private List<IGenerator<IReaction>> reactionGenerators;
-
/**
* A renderer that generates diagrams using the specified
* generators and manages fonts with the supplied font manager.
@@ -136,7 +131,7 @@ public ReactionRenderer(List<IGenerator<IAtomContainer>> generators,
for (IGenerator<IReaction> generator : reactionGenerators) {
rendererModel.registerParameters(generator);
}
- this.reactionGenerators = reactionGenerators;
+ this.generators = reactionGenerators;
this.setup();
}
@@ -231,7 +226,7 @@ public double calculateScaleForBondLength(double modelBondLength) {
public IRenderingElement generateDiagram(IReaction reaction) {
ElementGroup diagram = new ElementGroup();
- for (IGenerator<IReaction> generator : this.reactionGenerators) {
+ for (IGenerator<IReaction> generator : this.generators) {
diagram.add(generator.generate(reaction, rendererModel));
}
@@ -242,7 +237,7 @@ public IRenderingElement generateDiagram(IReaction reaction) {
}
public List<IGenerator<IReaction>> getGenerators(){
- return new ArrayList<IGenerator<IReaction>>(reactionGenerators);
+ return new ArrayList<IGenerator<IReaction>>(generators);
}
}

0 comments on commit 965c651

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