test_class.declarator: generator
test_class.modifier: private
test_class.original_string: private LonePairGenerator generator;
test_class.type: LonePairGenerator
test_class.var_name: generator
test_class.file: display/renderextra/src/test/java/org/openscience/cdk/renderer/generators/LonePairGeneratorTest.java
test_class.identifier: LonePairGeneratorTest
test_class.superclass: extends AbstractGeneratorTest
test_case.body: @Test
      public void testEmptyContainer() {
          IAtomContainer emptyContainer = super.builder.newInstance(IAtomContainer.class);
  
          // nothing should be made
          IRenderingElement root = generator.generate(emptyContainer, model);
          List<IRenderingElement> elements = elementUtil.getAllSimpleElements(root);
          Assert.assertEquals(0, elements.size());
      }
test_case.class_method_signature: LonePairGeneratorTest.testEmptyContainer()
test_case.full_signature: @Test public void testEmptyContainer()
test_case.identifier: testEmptyContainer
test_case.invocations: newInstance generate getAllSimpleElements assertEquals size
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testEmptyContainer()
focal_class.file: display/renderextra/src/main/java/org/openscience/cdk/renderer/generators/LonePairGenerator.java
focal_class.identifier: LonePairGenerator
focal_class.interfaces: implements IGenerator<IAtomContainer>
focal_class.class_method_signature: LonePairGenerator.LonePairGenerator()
focal_class.full_signature: public  LonePairGenerator()
focal_class.identifier: LonePairGenerator
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  LonePairGenerator()
focal_class.class_method_signature: LonePairGenerator.generate(IAtomContainer container, RendererModel model)
focal_class.full_signature: @Override public IRenderingElement generate(IAtomContainer container, RendererModel model)
focal_class.identifier: generate
focal_class.modifiers: @Override public
focal_class.parameters: (IAtomContainer container, RendererModel model)
focal_class.return: IRenderingElement
focal_class.signature: IRenderingElement generate(IAtomContainer container, RendererModel model)
focal_class.class_method_signature: LonePairGenerator.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(IAtomContainer container, RendererModel model) {
          ElementGroup group = new ElementGroup();
  
          // TODO : put into RendererModel
          final double SCREEN_RADIUS = 1.0;
          // separation between centers
          final double SCREEN_SEPARATION = 2.5;
          final Color RADICAL_COLOR = Color.BLACK;
  
          // XXX : is this the best option?
          final double ATOM_RADIUS = ((AtomRadius) model.getParameter(AtomRadius.class)).getValue();
  
          double scale = model.getParameter(Scale.class).getValue();
          double modelAtomRadius = ATOM_RADIUS / scale;
          double modelPointRadius = SCREEN_RADIUS / scale;
          double modelSeparation = SCREEN_SEPARATION / scale;
          for (ILonePair lonePair : container.lonePairs()) {
              IAtom atom = lonePair.getAtom();
              Point2d point = atom.getPoint2d();
              int align = GeometryUtil.getBestAlignmentForLabelXY(container, atom);
              double xRadius = point.x;
              double yRadius = point.y;
              double diffx = 0;
              double diffy = 0;
              if (align == 1) {
                  xRadius += modelAtomRadius;
                  diffy += modelSeparation;
              } else if (align == -1) {
                  xRadius -= modelAtomRadius;
                  diffy += modelSeparation;
              } else if (align == 2) {
                  yRadius -= modelAtomRadius;
                  diffx += modelSeparation;
              } else if (align == -2) {
                  yRadius += modelAtomRadius;
                  diffx += modelSeparation;
              }
              group.add(new OvalElement(xRadius + diffx, yRadius + diffy, modelPointRadius, true, RADICAL_COLOR));
              group.add(new OvalElement(xRadius - diffx, yRadius - diffy, modelPointRadius, true, RADICAL_COLOR));
          }
          return group;
      }
focal_method.class_method_signature: LonePairGenerator.generate(IAtomContainer container, RendererModel model)
focal_method.full_signature: @Override public IRenderingElement generate(IAtomContainer container, RendererModel model)
focal_method.identifier: generate
focal_method.invocations: getValue getParameter getValue getParameter lonePairs getAtom getPoint2d getBestAlignmentForLabelXY add add
focal_method.modifiers: @Override public
focal_method.parameters: (IAtomContainer container, RendererModel model)
focal_method.return: IRenderingElement
focal_method.signature: IRenderingElement generate(IAtomContainer container, RendererModel model)