protected void changeShapeSize( GraphicsType annType, NodeType node, BigDecimal newHeight, BigDecimal newWidth, Map<String, AnnotationData> annotations) { super.changeShapeSize(annType, node, newHeight, newWidth, annotations); BigDecimal oldH = annType.getSize().getHeight(); BigDecimal oldW = annType.getSize().getWidth(); BigDecimal oldX = annType.getPosition().get(0).getX(); BigDecimal oldY = annType.getPosition().get(0).getY(); BigDecimal newX = oldW.subtract(newWidth).divide(divisor).add(oldX); BigDecimal newY = oldH.subtract(newHeight).divide(divisor).add(oldY); SizeType size = new SizeType(); size.setHeight(newHeight); size.setWidth(newWidth); PositionType position = new PositionType(); position.setX(newX); position.setY(newY); annType.setSize(size); annType.getPosition().remove(0); annType.getPosition().add(position); annotations.put( node.getId(), new AnnotationData(oldX, oldY, newX, newY, oldH, oldW, newHeight, newWidth)); }
private void convertLayoutRectangleAttribute( final LayoutRectangleType rect, final GraphicsType graphics) throws ParseException { final PositionType position = ANF_FACTORY.createPositionType(); position.setX(convertToBigDecimal(rect.getX())); position.setY(convertToBigDecimal(rect.getY())); graphics.getPosition().add(position); final SizeType size = ANF_FACTORY.createSizeType(); size.setHeight(convertToBigDecimal(rect.getH())); size.setWidth(convertToBigDecimal(rect.getW())); graphics.setSize(size); }
private SizeType getSizeType() { SizeType size = new SizeType(); size.setHeight(new BigDecimal(1)); size.setWidth(new BigDecimal(1)); return size; }