AbstractVariableHeightLogicHandler implements ClassicBarcodeLogicHandler { protected double getTextY() { final double res; switch (bcBean.getMsgPosition()) { case HRP_TOP: res = bcBean.getHumanReadableHeight(); break; case HRP_BOTTOM: res = bcBean.getHeight() + (bcBean.hasQuietZone() ? bcBean.getVerticalQuietZone() : 0.0); break; case HRP_NONE: default: res = 0.0; } return res; } AbstractVariableHeightLogicHandler(HeightVariableBarcodeBean bcBean, Canvas canvas); void setTextAlignment(TextAlignment align); @Override void startBarcode(String msg, String formattedMsg); @Override void endBarcode(); @Override void startBarGroup(BarGroup barGroup, String string); @Override void endBarGroup();  }
@Test public void testGetTextY() { System.out.println("getTextY"); bean.setMsgPosition(HumanReadablePlacement.HRP_NONE); assertEquals(0.0, instance.getTextY(), 0.0); bean.setMsgPosition(HumanReadablePlacement.HRP_BOTTOM); assertEquals(7.34, instance.getTextY(), 0.01); bean.setMsgPosition(HumanReadablePlacement.HRP_TOP); assertEquals(2.82, instance.getTextY(), 0.01); }