(Graphics2D g2)
| 397 | } |
| 398 | |
| 399 | void draw(Graphics2D g2) { |
| 400 | int state = isCurrent() ? SELECTED : ENABLED; |
| 401 | g2.setColor(tabColor[state]); |
| 402 | g2.fill(Toolkit.createRoundRect(left, TAB_TOP, right, TAB_BOTTOM, 0, 0, |
| 403 | CURVE_RADIUS, CURVE_RADIUS)); |
| 404 | // isLast() ? CURVE_RADIUS : 0, |
| 405 | // isFirst() ? CURVE_RADIUS : 0)); |
| 406 | |
| 407 | if (hasIcon()) { |
| 408 | Image icon = (isCurrent() || notification) ? selectedIcon : enabledIcon; |
| 409 | g2.drawImage(icon, left + MARGIN, ICON_TOP, ICON_WIDTH, ICON_HEIGHT, null); |
| 410 | } |
| 411 | |
| 412 | int textLeft = getTextLeft(); |
| 413 | if (notification && state == ENABLED) { |
| 414 | g2.setColor(textColor[SELECTED]); |
| 415 | } else { |
| 416 | g2.setColor(textColor[state]); |
| 417 | } |
| 418 | int tabHeight = TAB_BOTTOM - TAB_TOP; |
| 419 | int baseline = TAB_TOP + (tabHeight + fontAscent) / 2; |
| 420 | g2.drawString(title, textLeft, baseline); |
| 421 | } |
| 422 | } |
| 423 | } |
no test coverage detected