test_class.file: display/renderawt/src/test/java/org/openscience/cdk/renderer/visitor/AbstractAWTDrawVisitorTest.java
test_class.identifier: AbstractAWTDrawVisitorTest
test_case.body: @Test
      public void testGetTextBounds() {
          AbstractAWTDrawVisitor visitor = new NestedAWTDrawVisitor();
          visitor.setTransform(new AffineTransform());
          Image image = new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB);
          Graphics2D g2d = (Graphics2D) image.getGraphics();
          Rectangle2D rectangle = visitor.getTextBounds("Foo", 3, 5, g2d);
          Assert.assertNotNull(rectangle);
      }
test_case.class_method_signature: AbstractAWTDrawVisitorTest.testGetTextBounds()
test_case.full_signature: @Test public void testGetTextBounds()
test_case.identifier: testGetTextBounds
test_case.invocations: setTransform getGraphics getTextBounds assertNotNull
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetTextBounds()
focal_class.declarator: transform = null
focal_class.modifier: protected
focal_class.original_string: protected AffineTransform transform = null;
focal_class.type: AffineTransform
focal_class.var_name: transform
focal_class.file: display/renderawt/src/main/java/org/openscience/cdk/renderer/visitor/AbstractAWTDrawVisitor.java
focal_class.identifier: AbstractAWTDrawVisitor
focal_class.interfaces: implements IDrawVisitor
focal_class.class_method_signature: AbstractAWTDrawVisitor.transformPoint(double xCoord, double yCoord)
focal_class.full_signature: public int[] transformPoint(double xCoord, double yCoord)
focal_class.identifier: transformPoint
focal_class.modifiers: public
focal_class.parameters: (double xCoord, double yCoord)
focal_class.return: int[]
focal_class.signature: int[] transformPoint(double xCoord, double yCoord)
focal_class.class_method_signature: AbstractAWTDrawVisitor.transformPoint(double[] xy)
focal_class.full_signature: public void transformPoint(double[] xy)
focal_class.identifier: transformPoint
focal_class.modifiers: public
focal_class.parameters: (double[] xy)
focal_class.return: void
focal_class.signature: void transformPoint(double[] xy)
focal_class.class_method_signature: AbstractAWTDrawVisitor.getTextBounds(String text, double xCoord, double yCoord, Graphics2D graphics)
focal_class.full_signature: protected Rectangle2D getTextBounds(String text, double xCoord, double yCoord, Graphics2D graphics)
focal_class.identifier: getTextBounds
focal_class.modifiers: protected
focal_class.parameters: (String text, double xCoord, double yCoord, Graphics2D graphics)
focal_class.return: Rectangle2D
focal_class.signature: Rectangle2D getTextBounds(String text, double xCoord, double yCoord, Graphics2D graphics)
focal_class.class_method_signature: AbstractAWTDrawVisitor.getTextBasePoint(String text, double xCoord, double yCoord, Graphics2D graphics)
focal_class.full_signature: protected Point getTextBasePoint(String text, double xCoord, double yCoord, Graphics2D graphics)
focal_class.identifier: getTextBasePoint
focal_class.modifiers: protected
focal_class.parameters: (String text, double xCoord, double yCoord, Graphics2D graphics)
focal_class.return: Point
focal_class.signature: Point getTextBasePoint(String text, double xCoord, double yCoord, Graphics2D graphics)
focal_class.class_method_signature: AbstractAWTDrawVisitor.getTextBounds(String text, Graphics2D g2)
focal_class.full_signature: protected Rectangle2D getTextBounds(String text, Graphics2D g2)
focal_class.identifier: getTextBounds
focal_class.modifiers: protected
focal_class.parameters: (String text, Graphics2D g2)
focal_class.return: Rectangle2D
focal_class.signature: Rectangle2D getTextBounds(String text, Graphics2D g2)
focal_class.class_method_signature: AbstractAWTDrawVisitor.setTransform(AffineTransform transform)
focal_class.full_signature: @Override public void setTransform(AffineTransform transform)
focal_class.identifier: setTransform
focal_class.modifiers: @Override public
focal_class.parameters: (AffineTransform transform)
focal_class.return: void
focal_class.signature: void setTransform(AffineTransform transform)
focal_method.body: protected Rectangle2D getTextBounds(String text, double xCoord, double yCoord, Graphics2D graphics) {
          FontMetrics fontMetrics = graphics.getFontMetrics();
          Rectangle2D bounds = fontMetrics.getStringBounds(text, graphics);
  
          double widthPad = 3;
          double heightPad = 1;
  
          double width = bounds.getWidth() + widthPad;
          double height = bounds.getHeight() + heightPad;
          int[] point = this.transformPoint(xCoord, yCoord);
          return new Rectangle2D.Double(point[0] - width / 2, point[1] - height / 2, width, height);
      }
focal_method.class_method_signature: AbstractAWTDrawVisitor.getTextBounds(String text, double xCoord, double yCoord, Graphics2D graphics)
focal_method.full_signature: protected Rectangle2D getTextBounds(String text, double xCoord, double yCoord, Graphics2D graphics)
focal_method.identifier: getTextBounds
focal_method.invocations: getFontMetrics getStringBounds getWidth getHeight transformPoint
focal_method.modifiers: protected
focal_method.parameters: (String text, double xCoord, double yCoord, Graphics2D graphics)
focal_method.return: Rectangle2D
focal_method.signature: Rectangle2D getTextBounds(String text, double xCoord, double yCoord, Graphics2D graphics)