AtomSymbol { List<Shape> getOutlines() { List<Shape> shapes = new ArrayList<Shape>(); shapes.add(element.getOutline()); for (TextOutline adjunct : adjuncts) shapes.add(adjunct.getOutline()); return shapes; } AtomSymbol(TextOutline element, List<TextOutline> adjuncts); private  AtomSymbol(TextOutline element, List<TextOutline> adjuncts, List<TextOutline> annotationAdjuncts,
            SymbolAlignment alignment, ConvexHull hull);   }
@Test public void testGetOutlines() throws Exception { TextOutline outline = new TextOutline("Cl", font); AtomSymbol symbol = new AtomSymbol(outline, Collections.<TextOutline> emptyList()); Rectangle outlineBounds = outline.getOutline().getBounds(); Rectangle symbolBounds = symbol.getOutlines().get(0).getBounds(); assertThat(outlineBounds.getX(), closeTo(symbolBounds.getX(), 0.01)); assertThat(outlineBounds.getY(), closeTo(symbolBounds.getY(), 0.01)); assertThat(outlineBounds.getMaxX(), closeTo(symbolBounds.getMaxX(), 0.01)); assertThat(outlineBounds.getMaxY(), closeTo(symbolBounds.getMaxY(), 0.01)); }
@Test public void testGetOutlinesWithAdjunct() throws Exception { TextOutline outline = new TextOutline("Cl", font); TextOutline adjunct = new TextOutline("H", font); AtomSymbol symbol = new AtomSymbol(outline, Arrays.asList(adjunct)); Rectangle outlineBounds = adjunct.getOutline().getBounds(); Rectangle symbolBounds = symbol.getOutlines().get(1).getBounds(); assertThat(outlineBounds.getX(), closeTo(symbolBounds.getX(), 0.01)); assertThat(outlineBounds.getY(), closeTo(symbolBounds.getY(), 0.01)); assertThat(outlineBounds.getMaxX(), closeTo(symbolBounds.getMaxX(), 0.01)); assertThat(outlineBounds.getMaxY(), closeTo(symbolBounds.getMaxY(), 0.01)); }