@Test public void testAppendBounds() throws Exception { assertXpath("number(/Document/Page[1]/Zone[1]/ZoneCorners/Vertex[1]/@x)", 10); assertXpath("number(/Document/Page[1]/Zone[1]/ZoneCorners/Vertex[1]/@y)", 20); assertXpath("number(/Document/Page[1]/Zone[1]/ZoneCorners/Vertex[2]/@x)", 40); assertXpath("number(/Document/Page[1]/Zone[1]/ZoneCorners/Vertex[2]/@y)", 20); assertXpath("number(/Document/Page[1]/Zone[1]/ZoneCorners/Vertex[3]/@x)", 40); assertXpath("number(/Document/Page[1]/Zone[1]/ZoneCorners/Vertex[3]/@y)", 65); assertXpath("number(/Document/Page[1]/Zone[1]/ZoneCorners/Vertex[4]/@x)", 10); assertXpath("number(/Document/Page[1]/Zone[1]/ZoneCorners/Vertex[4]/@y)", 65); assertXpath("count(/Document/Page[2]/Zone[1]/ZoneCorners)", 1); }
private void appendBounds(Document doc, Element parent, String name, BxBounds bounds, Object... hints) { if (bounds == null) { bounds = new BxBounds(); } Element node = doc.createElement(name); appendVertex(doc, node, bounds.getX(), bounds.getY(), hints); if (!Arrays.asList(hints).contains(MINIMAL_OUTPUT_SIZE)) { appendVertex(doc, node, bounds.getX() + bounds.getWidth(), bounds.getY(), hints); } appendVertex(doc, node, bounds.getX() + bounds.getWidth(), bounds.getY() + bounds.getHeight(), hints); if (!Arrays.asList(hints).contains(MINIMAL_OUTPUT_SIZE)) { appendVertex(doc, node, bounds.getX(), bounds.getY() + bounds.getHeight(), hints); } parent.appendChild(node); }
BxDocumentToTrueVizWriter { private void appendBounds(Document doc, Element parent, String name, BxBounds bounds, Object... hints) { if (bounds == null) { bounds = new BxBounds(); } Element node = doc.createElement(name); appendVertex(doc, node, bounds.getX(), bounds.getY(), hints); if (!Arrays.asList(hints).contains(MINIMAL_OUTPUT_SIZE)) { appendVertex(doc, node, bounds.getX() + bounds.getWidth(), bounds.getY(), hints); } appendVertex(doc, node, bounds.getX() + bounds.getWidth(), bounds.getY() + bounds.getHeight(), hints); if (!Arrays.asList(hints).contains(MINIMAL_OUTPUT_SIZE)) { appendVertex(doc, node, bounds.getX(), bounds.getY() + bounds.getHeight(), hints); } parent.appendChild(node); } }
BxDocumentToTrueVizWriter { private void appendBounds(Document doc, Element parent, String name, BxBounds bounds, Object... hints) { if (bounds == null) { bounds = new BxBounds(); } Element node = doc.createElement(name); appendVertex(doc, node, bounds.getX(), bounds.getY(), hints); if (!Arrays.asList(hints).contains(MINIMAL_OUTPUT_SIZE)) { appendVertex(doc, node, bounds.getX() + bounds.getWidth(), bounds.getY(), hints); } appendVertex(doc, node, bounds.getX() + bounds.getWidth(), bounds.getY() + bounds.getHeight(), hints); if (!Arrays.asList(hints).contains(MINIMAL_OUTPUT_SIZE)) { appendVertex(doc, node, bounds.getX(), bounds.getY() + bounds.getHeight(), hints); } parent.appendChild(node); }  }
BxDocumentToTrueVizWriter { private void appendBounds(Document doc, Element parent, String name, BxBounds bounds, Object... hints) { if (bounds == null) { bounds = new BxBounds(); } Element node = doc.createElement(name); appendVertex(doc, node, bounds.getX(), bounds.getY(), hints); if (!Arrays.asList(hints).contains(MINIMAL_OUTPUT_SIZE)) { appendVertex(doc, node, bounds.getX() + bounds.getWidth(), bounds.getY(), hints); } appendVertex(doc, node, bounds.getX() + bounds.getWidth(), bounds.getY() + bounds.getHeight(), hints); if (!Arrays.asList(hints).contains(MINIMAL_OUTPUT_SIZE)) { appendVertex(doc, node, bounds.getX(), bounds.getY() + bounds.getHeight(), hints); } parent.appendChild(node); }  String write(List<BxPage> objects, Object... hints); void write(Writer writer, List<BxPage> objects, Object... hints); }
BxDocumentToTrueVizWriter { private void appendBounds(Document doc, Element parent, String name, BxBounds bounds, Object... hints) { if (bounds == null) { bounds = new BxBounds(); } Element node = doc.createElement(name); appendVertex(doc, node, bounds.getX(), bounds.getY(), hints); if (!Arrays.asList(hints).contains(MINIMAL_OUTPUT_SIZE)) { appendVertex(doc, node, bounds.getX() + bounds.getWidth(), bounds.getY(), hints); } appendVertex(doc, node, bounds.getX() + bounds.getWidth(), bounds.getY() + bounds.getHeight(), hints); if (!Arrays.asList(hints).contains(MINIMAL_OUTPUT_SIZE)) { appendVertex(doc, node, bounds.getX(), bounds.getY() + bounds.getHeight(), hints); } parent.appendChild(node); }  String write(List<BxPage> objects, Object... hints); void write(Writer writer, List<BxPage> objects, Object... hints); static final String MINIMAL_OUTPUT_SIZE; static final Map<BxZoneLabel, String> ZONE_LABEL_MAP; }