/** * Draws the border around the perimeter of the specified area. * * @param g2 the graphics device. * @param area the area. */ protected void drawBorder(Graphics2D g2, Rectangle2D area) { this.frame.draw(g2, area); }
/** * Reduces the specified area by the amount of space consumed * by the border. * * @param area the area ({@code null} not permitted). * * @return The trimmed area. */ protected Rectangle2D trimBorder(Rectangle2D area) { // defer argument checking... this.frame.getInsets().trim(area); return area; }
/** * Reduces the specified area by the amount of space consumed * by the border. * * @param area the area (<code>null</code> not permitted). * * @return The trimmed area. */ protected Rectangle2D trimBorder(Rectangle2D area) { // defer argument checking... this.frame.getInsets().trim(area); return area; }
/** * Draws the border around the perimeter of the specified area. * * @param g2 the graphics device. * @param area the area. */ protected void drawBorder(Graphics2D g2, Rectangle2D area) { this.frame.draw(g2, area); }
/** * Calculate the width available for content after subtracting * the margin, border and padding space from the specified fixed * width. * * @param fixedWidth the fixed width. * * @return The available space. * * @see #trimToContentHeight(double) */ protected double trimToContentWidth(double fixedWidth) { double result = this.margin.trimWidth(fixedWidth); result = this.frame.getInsets().trimWidth(result); result = this.padding.trimWidth(result); return Math.max(result, 0.0); }
/** * Calculate the height available for content after subtracting * the margin, border and padding space from the specified fixed * height. * * @param fixedHeight the fixed height. * * @return The available space. * * @see #trimToContentWidth(double) */ protected double trimToContentHeight(double fixedHeight) { double result = this.margin.trimHeight(fixedHeight); result = this.frame.getInsets().trimHeight(result); result = this.padding.trimHeight(result); return Math.max(result, 0.0); }
/** * Calculate the height available for content after subtracting * the margin, border and padding space from the specified fixed * height. * * @param fixedHeight the fixed height. * * @return The available space. * * @see #trimToContentWidth(double) */ protected double trimToContentHeight(double fixedHeight) { double result = this.margin.trimHeight(fixedHeight); result = this.frame.getInsets().trimHeight(result); result = this.padding.trimHeight(result); return Math.max(result, 0.0); }
/** * Returns the y-offset for the content within the block. * * @return The y-offset. * * @see #getContentXOffset() */ public double getContentYOffset() { return this.margin.getTop() + this.frame.getInsets().getTop() + this.padding.getTop(); }
/** * Returns the y-offset for the content within the block. * * @return The y-offset. * * @see #getContentXOffset() */ public double getContentYOffset() { return this.margin.getTop() + this.frame.getInsets().getTop() + this.padding.getTop(); }
/** * Adds the margin, border and padding to the specified content height. * * @param contentHeight the content height. * * @return The adjusted height. */ protected double calculateTotalHeight(double contentHeight) { double result = contentHeight; result = this.padding.extendHeight(result); result = this.frame.getInsets().extendHeight(result); result = this.margin.extendHeight(result); return result; }
/** * Returns the x-offset for the content within the block. * * @return The x-offset. * * @see #getContentYOffset() */ public double getContentXOffset() { return this.margin.getLeft() + this.frame.getInsets().getLeft() + this.padding.getLeft(); }
/** * Calculate the width available for content after subtracting * the margin, border and padding space from the specified fixed * width. * * @param fixedWidth the fixed width. * * @return The available space. * * @see #trimToContentHeight(double) */ protected double trimToContentWidth(double fixedWidth) { double result = this.margin.trimWidth(fixedWidth); result = this.frame.getInsets().trimWidth(result); result = this.padding.trimWidth(result); return Math.max(result, 0.0); }
/** * Returns the x-offset for the content within the block. * * @return The x-offset. * * @see #getContentYOffset() */ public double getContentXOffset() { return this.margin.getLeft() + this.frame.getInsets().getLeft() + this.padding.getLeft(); }
/** * Adds the margin, border and padding to the specified content width. * * @param contentWidth the content width. * * @return The adjusted width. */ protected double calculateTotalWidth(double contentWidth) { double result = contentWidth; result = this.padding.extendWidth(result); result = this.frame.getInsets().extendWidth(result); result = this.margin.extendWidth(result); return result; }
/** * Adds the margin, border and padding to the specified content height. * * @param contentHeight the content height. * * @return The adjusted height. */ protected double calculateTotalHeight(double contentHeight) { double result = contentHeight; result = this.padding.extendHeight(result); result = this.frame.getInsets().extendHeight(result); result = this.margin.extendHeight(result); return result; }
/** * Adds the margin, border and padding to the specified content width. * * @param contentWidth the content width. * * @return The adjusted width. */ protected double calculateTotalWidth(double contentWidth) { double result = contentWidth; result = this.padding.extendWidth(result); result = this.frame.getInsets().extendWidth(result); result = this.margin.extendWidth(result); return result; }