/** * @return minimal bounds of this element */ @Override public Rectangle2D getMinimalBounds() { return content.getMinimalBounds(); }
/** * @return minimal bounds of this element */ @Override public Rectangle2D getMinimalBounds() { Rectangle2D contentMinimalBounds = content.getMinimalBounds(); Rectangle2D selfMinimalBounds = super.getMinimalBounds(); return new Rectangle2D.Double( position.getX(), position.getY(), Math.max(selfMinimalBounds.getWidth(), contentMinimalBounds.getWidth()), Math.max(selfMinimalBounds.getHeight(), contentMinimalBounds.getHeight()) ); }
/** * @return minimal bounds of this element */ public Rectangle2D getMinimalBounds() { Rectangle2D textMinimalBounds = text.getBounds(); Rectangle2D contentMinimalBounds = super.getMinimalBounds(); return new Rectangle2D.Double( contentMinimalBounds.getX(), contentMinimalBounds.getY(), Math.max(contentMinimalBounds.getWidth(), textMinimalBounds.getWidth()), Math.max(contentMinimalBounds.getHeight(), textMinimalBounds.getHeight()) ); }
/** * @return minimal bounds of this element */ @Override public Rectangle2D getMinimalBounds() { Rectangle2D selfMinimalBounds = super.getMinimalBounds(); double maxX = selfMinimalBounds.getWidth(); double maxY = selfMinimalBounds.getHeight(); for (Content content: getContents()) { Rectangle2D rect = content.getMinimalBounds(); maxX = Math.max(maxX, rect.getMaxX()); maxY = Math.max(maxY, rect.getMaxY()); } return new Rectangle2D.Double(getX(),getY(),maxX,maxY); }
/** * @return minimal bounds of this element */ @Override public Rectangle2D getMinimalBounds() { Rectangle2D selfMinimalBounds = super.getMinimalBounds(); double width = 0; double height = 0; for (Content content: getContents()) { Rectangle2D contentMinimalBounds = content.getMinimalBounds(); width += contentMinimalBounds.getWidth(); if(height < contentMinimalBounds.getHeight()) { height = contentMinimalBounds.getHeight(); } } height = Math.max(height, selfMinimalBounds.getHeight()); width = Math.max(width, selfMinimalBounds.getWidth()); return new Rectangle2D.Double(getX(),getY(),width,height); }
/** * @return minimal bounds of this element */ @Override public Rectangle2D getMinimalBounds() { Rectangle2D selfMinimalBounds = super.getMinimalBounds(); double height = 0; double width = 0; for (Content content: getContents()) { Rectangle2D contentMinimalBounds = content.getMinimalBounds(); height += contentMinimalBounds.getHeight(); if(width < contentMinimalBounds.getWidth()) { width = contentMinimalBounds.getWidth(); } } height = Math.max(height, selfMinimalBounds.getHeight()); width = Math.max(width, selfMinimalBounds.getWidth()); return new Rectangle2D.Double(getX(),getY(),width,height); }