1477 |
public void drawRoundRect(int x, int y, int width, int height, |
public void drawRoundRect(int x, int y, int width, int height, |
1478 |
int arcWidth, int arcHeight) |
int arcWidth, int arcHeight) |
1479 |
{ |
{ |
1480 |
int x1 = x + arcWidth, x2 = x + width - arcWidth; |
if (arcWidth > width) |
1481 |
int y1 = y + arcHeight, y2 = y + height - arcHeight; |
arcWidth = width; |
1482 |
fillRect (x1, y, x2 - x1, height); |
if (arcHeight > height) |
1483 |
fillRect (x, y1, width, y2 - y1); |
arcHeight = height; |
1484 |
fillArc (x, y, arcWidth, arcHeight, 90, 90); |
|
1485 |
fillArc (x1, y, arcWidth, arcHeight, 0, 90); |
int xx = x + width - arcWidth; |
1486 |
fillArc (x2, y2, arcWidth, arcHeight, 270, 90); |
int yy = y + height - arcHeight; |
1487 |
fillArc (x, y2, arcWidth, arcHeight, 180, 90); |
|
1488 |
|
drawArc (x, y, arcWidth, arcHeight, 90, 90); |
1489 |
|
drawArc (xx, y, arcWidth, arcHeight, 0, 90); |
1490 |
|
drawArc (xx, yy, arcWidth, arcHeight, 270, 90); |
1491 |
|
drawArc (x, yy, arcWidth, arcHeight, 180, 90); |
1492 |
|
|
1493 |
|
int y1 = y + arcHeight / 2; |
1494 |
|
int y2 = y + height - arcHeight / 2; |
1495 |
|
drawLine (x, y1, x, y2); |
1496 |
|
drawLine (x + width, y1, x + width, y2); |
1497 |
|
|
1498 |
|
int x1 = x + arcWidth / 2; |
1499 |
|
int x2 = x + width - arcWidth / 2; |
1500 |
|
drawLine (x1, y, x2, y); |
1501 |
|
drawLine (x1, y + height, x2, y + height); |
1502 |
} |
} |
1503 |
|
|
1504 |
public void drawString (String str, int x, int y) |
public void drawString (String str, int x, int y) |
1540 |
public void fillRoundRect (int x, int y, int width, int height, |
public void fillRoundRect (int x, int y, int width, int height, |
1541 |
int arcWidth, int arcHeight) |
int arcWidth, int arcHeight) |
1542 |
{ |
{ |
1543 |
int x1 = x + arcWidth, x2 = x + width - arcWidth; |
if (arcWidth > width) |
1544 |
int y1 = y + arcHeight, y2 = y + height - arcHeight; |
arcWidth = width; |
1545 |
fillRect (x1, y, x2 - x1, height); |
if (arcHeight > height) |
1546 |
fillRect (x, y1, width, y2 - y1); |
arcHeight = height; |
1547 |
|
|
1548 |
|
int xx = x + width - arcWidth; |
1549 |
|
int yy = y + height - arcHeight; |
1550 |
|
|
1551 |
fillArc (x, y, arcWidth, arcHeight, 90, 90); |
fillArc (x, y, arcWidth, arcHeight, 90, 90); |
1552 |
fillArc (x1, y, arcWidth, arcHeight, 0, 90); |
fillArc (xx, y, arcWidth, arcHeight, 0, 90); |
1553 |
fillArc (x2, y2, arcWidth, arcHeight, 270, 90); |
fillArc (xx, yy, arcWidth, arcHeight, 270, 90); |
1554 |
fillArc (x, y2, arcWidth, arcHeight, 180, 90); |
fillArc (x, yy, arcWidth, arcHeight, 180, 90); |
1555 |
|
|
1556 |
|
fillRect (x, y + arcHeight / 2, width, height - arcHeight + 1); |
1557 |
|
fillRect (x + arcWidth / 2, y, width - arcWidth + 1, height); |
1558 |
} |
} |
1559 |
|
|
1560 |
public Font getFont () |
public Font getFont () |