protected RectangularShape calculateShape(int width, int height) { Insets insets = getInsets(); int x = insets.left; int y = insets.top; // use the position calcs from the super class Rectangle bounds = calculateLayout(this.width, this.height, width, height); if(this.width != -1 && !isFillHorizontal()) { width = this.width; x = bounds.x; } if(this.height != -1 && !isFillVertical()) { height = this.height; y = bounds.y; } if(isFillHorizontal()) { width = width - insets.left - insets.right; } if(isFillVertical()) { height = height - insets.top - insets.bottom; } RectangularShape shape = new Rectangle2D.Double(x, y, width, height); if(rounded) { shape = new RoundRectangle2D.Double(x, y, width, height, roundWidth, roundHeight); } return shape; }
protected RectangularShape calculateShape(int width, int height) { Insets insets = getInsets(); int x = insets.left; int y = insets.top; // use the position calcs from the super class Rectangle bounds = calculateLayout(this.width, this.height, width, height); if(this.width != -1 && !isFillHorizontal()) { width = this.width; x = bounds.x; } if(this.height != -1 && !isFillVertical()) { height = this.height; y = bounds.y; } if(isFillHorizontal()) { width = width - insets.left - insets.right; } if(isFillVertical()) { height = height - insets.top - insets.bottom; } RectangularShape shape = new Rectangle2D.Double(x, y, width, height); if(rounded) { shape = new RoundRectangle2D.Double(x, y, width, height, roundWidth, roundHeight); } return shape; }
protected RectangularShape calculateShape(int width, int height) { Insets insets = getInsets(); int x = insets.left; int y = insets.top; // use the position calcs from the super class Rectangle bounds = calculateLayout(this.width, this.height, width, height); if(this.width != -1 && !isFillHorizontal()) { width = this.width; x = bounds.x; } if(this.height != -1 && !isFillVertical()) { height = this.height; y = bounds.y; } if(isFillHorizontal()) { width = width - insets.left - insets.right; } if(isFillVertical()) { height = height - insets.top - insets.bottom; } RectangularShape shape = new Rectangle2D.Double(x, y, width, height); if(rounded) { shape = new RoundRectangle2D.Double(x, y, width, height, roundWidth, roundHeight); } return shape; }
protected RectangularShape calculateShape(int width, int height) { Insets insets = getInsets(); int x = insets.left; int y = insets.top; // use the position calcs from the super class Rectangle bounds = calculateLayout(this.width, this.height, width, height); if(this.width != -1 && !isFillHorizontal()) { width = this.width; x = bounds.x; } if(this.height != -1 && !isFillVertical()) { height = this.height; y = bounds.y; } if(isFillHorizontal()) { width = width - insets.left - insets.right; } if(isFillVertical()) { height = height - insets.top - insets.bottom; } RectangularShape shape = new Rectangle2D.Double(x, y, width, height); if(rounded) { shape = new RoundRectangle2D.Double(x, y, width, height, roundWidth, roundHeight); } return shape; }