/** * @see Layout#getNextOffset(Point2D, Content) */ @Override protected Point2D getNextOffset(Point2D beforeOffset, Content content) { return new Point2D.Double(beforeOffset.getX(),beforeOffset.getY() + content.getHeight()); }
/** * Calculates the offset of content to make it in the center of the shape * @return offset */ protected Point2D getShapeOffset() { Rectangle2D shapeBounds = getShape().getBounds(); return new Point2D.Double( (shapeBounds.getWidth() - content.getWidth()) / 2, (shapeBounds.getHeight() - content.getHeight()) / 2 ); }
/** * @see ContentInsideShape#getShapeOffset() */ protected Point2D getShapeOffset() { Rectangle2D shapeBounds = getShape().getBounds(); return new Point2D.Double( (shapeBounds.getWidth() - getContent().getWidth()) / 2, (shapeBounds.getHeight() - getContent().getHeight()) / 2 ); }
/** * @return bounds of this element */ public final Rectangle2D getBounds() { return new Rectangle2D.Double(getX(),getY(),getWidth(),getHeight()); }
/** * @return rectangle described on content */ private Rectangle2D createRectangle() { return new Rectangle2D.Double(0,0,getContent().getWidth(), getContent().getHeight()); } }
/** * @return round rectangle described on content */ private RoundRectangle2D createRoundRectangle() { return new RoundRectangle2D.Double(0,0, getContent().getWidth() + (arcWidth - arcWidth /Math.sqrt(2)), getContent().getHeight() + (arcHeight - arcHeight /Math.sqrt(2)), arcWidth, arcHeight); }
/** * @return custom shape described on content */ private Shape createCustomShape() { return customShapeCreator.createShape(getContent().getWidth(), getContent().getHeight()); }