test_class.declarator: generator
test_class.modifier: private
test_class.original_string: private ReactionBoxGenerator generator;
test_class.type: ReactionBoxGenerator
test_class.var_name: generator
test_class.file: display/renderextra/src/test/java/org/openscience/cdk/renderer/generators/ReactionBoxGeneratorTest.java
test_class.identifier: ReactionBoxGeneratorTest
test_class.superclass: extends AbstractGeneratorTest
test_case.body: @Test
      public void testEmptyReaction() {
          IReaction singleReaction = super.builder.newInstance(IReaction.class);
  
          // nothing should be made
          IRenderingElement root = generator.generate(singleReaction, model);
          List<IRenderingElement> elements = elementUtil.getAllSimpleElements(root);
          Assert.assertEquals(1, elements.size());
      }
test_case.class_method_signature: ReactionBoxGeneratorTest.testEmptyReaction()
test_case.full_signature: @Test public void testEmptyReaction()
test_case.identifier: testEmptyReaction
test_case.invocations: newInstance generate getAllSimpleElements assertEquals size
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testEmptyReaction()
focal_class.file: display/renderextra/src/main/java/org/openscience/cdk/renderer/generators/ReactionBoxGenerator.java
focal_class.identifier: ReactionBoxGenerator
focal_class.interfaces: implements IGenerator<IReaction>
focal_class.class_method_signature: ReactionBoxGenerator.generate(IReaction reaction, RendererModel model)
focal_class.full_signature: @Override public IRenderingElement generate(IReaction reaction, RendererModel model)
focal_class.identifier: generate
focal_class.modifiers: @Override public
focal_class.parameters: (IReaction reaction, RendererModel model)
focal_class.return: IRenderingElement
focal_class.signature: IRenderingElement generate(IReaction reaction, RendererModel model)
focal_class.class_method_signature: ReactionBoxGenerator.getParameters()
focal_class.full_signature: @Override public List<IGeneratorParameter<?>> getParameters()
focal_class.identifier: getParameters
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: List<IGeneratorParameter<?>>
focal_class.signature: List<IGeneratorParameter<?>> getParameters()
focal_method.body: @Override
      public IRenderingElement generate(IReaction reaction, RendererModel model) {
          if (!model.getParameter(ShowReactionBoxes.class).getValue()) return null;
          double separation = model.getParameter(BondLength.class).getValue()
                  / model.getParameter(Scale.class).getValue();
          Rectangle2D totalBounds = BoundsCalculator.calculateBounds(reaction);
          if (totalBounds == null) return null;
  
          ElementGroup diagram = new ElementGroup();
          Color foregroundColor = model.getParameter(BasicSceneGenerator.ForegroundColor.class).getValue();
          diagram.add(new RectangleElement(totalBounds.getMinX() - separation, totalBounds.getMinY() - separation,
                  totalBounds.getMaxX() + separation, totalBounds.getMaxY() + separation, foregroundColor));
          if (reaction.getID() != null) {
              diagram.add(new TextElement((totalBounds.getMinX() + totalBounds.getMaxX()) / 2, totalBounds.getMinY()
                      - separation, reaction.getID(), foregroundColor));
          }
          return diagram;
      }
focal_method.class_method_signature: ReactionBoxGenerator.generate(IReaction reaction, RendererModel model)
focal_method.full_signature: @Override public IRenderingElement generate(IReaction reaction, RendererModel model)
focal_method.identifier: generate
focal_method.invocations: getValue getParameter getValue getParameter getValue getParameter calculateBounds getValue getParameter add getMinX getMinY getMaxX getMaxY getID add getMinX getMaxX getMinY getID
focal_method.modifiers: @Override public
focal_method.parameters: (IReaction reaction, RendererModel model)
focal_method.return: IRenderingElement
focal_method.signature: IRenderingElement generate(IReaction reaction, RendererModel model)