Here you can find the source of drawRoundRect(Graphics g, int left, int top, int width, int height, int arcWidth, int arcHeight, int lineWidth)
Parameter | Description |
---|---|
g | _more_ |
left | _more_ |
top | _more_ |
width | _more_ |
height | _more_ |
arcWidth | _more_ |
arcHeight | _more_ |
lineWidth | _more_ |
public static void drawRoundRect(Graphics g, int left, int top, int width, int height, int arcWidth, int arcHeight, int lineWidth)
//package com.java2s; /**/* w w w. ja va 2 s . c o m*/ * Copyright (c) 2008-2015 Geode Systems LLC * This Software is licensed under the Geode Systems RAMADDA License available in the source distribution in the file * ramadda_license.txt. The above copyright notice shall be included in all copies or substantial portions of the Software. */ import java.awt.*; public class Main { /** * _more_ * * @param g _more_ * @param left _more_ * @param top _more_ * @param width _more_ * @param height _more_ * @param arcWidth _more_ * @param arcHeight _more_ * @param lineWidth _more_ */ public static void drawRoundRect(Graphics g, int left, int top, int width, int height, int arcWidth, int arcHeight, int lineWidth) { left = left - lineWidth / 2; top = top - lineWidth / 2; width = width + lineWidth; height = height + lineWidth; for (int i = 0; i < lineWidth; i++) { g.drawRoundRect(left, top, width, height, arcWidth, arcHeight); if ((i + 1) < lineWidth) { g.drawRoundRect(left, top, width - 1, height - 1, arcWidth, arcHeight); g.drawRoundRect(left + 1, top, width - 1, height - 1, arcWidth, arcHeight); g.drawRoundRect(left, top + 1, width - 1, height - 1, arcWidth, arcHeight); g.drawRoundRect(left + 1, top + 1, width - 1, height - 1, arcWidth, arcHeight); left = left + 1; top = top + 1; width = width - 2; height = height - 2; } } } }