DefaultCanvasLogicHandler implements ClassicBarcodeLogicHandler { protected double getStartY() { double res = 0.0; if (bcBean.hasQuietZone()) { res += bcBean.getVerticalQuietZone(); } if (bcBean.getMsgPosition() == HumanReadablePlacement.HRP_TOP) { res += bcBean.getHumanReadableHeight(); } return res; } DefaultCanvasLogicHandler(AbstractBarcodeBean bcBean, Canvas canvas); @Override void startBarcode(String msg, String formattedMsg); @Override void startBarGroup(BarGroup type, String submsg); @Override void addBar(boolean black, int width); @Override void endBarGroup(); @Override void endBarcode();  }
@Test public void testGetStartY() { System.out.println("getStartY"); assertEquals(0.0, instance.getStartY(), 0.0); bean.setVerticalQuietZone(20); assertEquals(20.0, instance.getStartY(), 0.0); bean.setMsgPosition(HumanReadablePlacement.HRP_TOP); assertEquals(22.82, instance.getStartY(), 0.01); }