/** * A protected method used by subclasses to calculate the final position of the * content. This will position the content using the fillHorizontal, fillVertical * horizontalAlignment, and verticalAlignment properties. This method * is typically called by subclasses in their doPaint() methods. * * @param contentWidth The width of the content to be painted * @param contentHeight The height of the content to be painted * @param width the width of the area that the content will be positioned in * @param height the height of the area that the content will be positioned in * @return the rectangle for the content to be painted in */ protected final Rectangle calculateLayout(final int contentWidth, final int contentHeight, final int width, final int height) { Rectangle rect = new Rectangle(); rect.width = contentWidth; rect.height = contentHeight; if(isFillHorizontal()) { rect.width = width - insets.left - insets.right; } if(isFillVertical()) { rect.height = height - insets.top - insets.bottom; } rect.x = calculateX(rect.width, width); rect.y = calculateY(rect.height, height); return rect; }
/** * A protected method used by subclasses to calculate the final position of the * content. This will position the content using the fillHorizontal, fillVertical * horizontalAlignment, and verticalAlignment properties. This method * is typically called by subclasses in their doPaint() methods. * * @param contentWidth The width of the content to be painted * @param contentHeight The height of the content to be painted * @param width the width of the area that the content will be positioned in * @param height the height of the area that the content will be positioned in * @return the rectangle for the content to be painted in */ protected Rectangle calculateLayout(final int contentWidth, final int contentHeight, final int width, final int height) { Rectangle rect = new Rectangle(); rect.width = contentWidth; rect.height = contentHeight; if (isFillHorizontal()) { rect.width = width - insets.left - insets.right; } if (isFillVertical()) { rect.height = height - insets.top - insets.bottom; } rect.x = calculateX(rect.width, width); rect.y = calculateY(rect.height, height); return rect; }
/** * A protected method used by subclasses to calculate the final position of the * content. This will position the content using the fillHorizontal, fillVertical * horizontalAlignment, and verticalAlignment properties. This method * is typically called by subclasses in their doPaint() methods. * * @param contentWidth The width of the content to be painted * @param contentHeight The height of the content to be painted * @param width the width of the area that the content will be positioned in * @param height the height of the area that the content will be positioned in * @return the rectangle for the content to be painted in */ protected final Rectangle calculateLayout(final int contentWidth, final int contentHeight, final int width, final int height) { Rectangle rect = new Rectangle(); rect.width = contentWidth; rect.height = contentHeight; if(isFillHorizontal()) { rect.width = width - insets.left - insets.right; } if(isFillVertical()) { rect.height = height - insets.top - insets.bottom; } rect.x = calculateX(rect.width, width); rect.y = calculateY(rect.height, height); return rect; }
/** * A protected method used by subclasses to calculate the final position of the * content. This will position the content using the fillHorizontal, fillVertical * horizontalAlignment, and verticalAlignment properties. This method * is typically called by subclasses in their doPaint() methods. * * @param contentWidth The width of the content to be painted * @param contentHeight The height of the content to be painted * @param width the width of the area that the content will be positioned in * @param height the height of the area that the content will be positioned in * @return the rectangle for the content to be painted in */ protected final Rectangle calculateLayout(final int contentWidth, final int contentHeight, final int width, final int height) { Rectangle rect = new Rectangle(); rect.width = contentWidth; rect.height = contentHeight; if(isFillHorizontal()) { rect.width = width - insets.left - insets.right; } if(isFillVertical()) { rect.height = height - insets.top - insets.bottom; } rect.x = calculateX(rect.width, width); rect.y = calculateY(rect.height, height); return rect; }
/** * A protected method used by subclasses to calculate the final position of the * content. This will position the content using the fillHorizontal, fillVertical * horizontalAlignment, and verticalAlignment properties. This method * is typically called by subclasses in their doPaint() methods. * * @param contentWidth The width of the content to be painted * @param contentHeight The height of the content to be painted * @param width the width of the area that the content will be positioned in * @param height the height of the area that the content will be positioned in * @return the rectangle for the content to be painted in */ protected final Rectangle calculateLayout(final int contentWidth, final int contentHeight, final int width, final int height) { Rectangle rect = new Rectangle(); rect.width = contentWidth; rect.height = contentHeight; if(isFillHorizontal()) { rect.width = width - insets.left - insets.right; } if(isFillVertical()) { rect.height = height - insets.top - insets.bottom; } rect.x = calculateX(rect.width, width); rect.y = calculateY(rect.height, height); return rect; }