(Graphics g)
| 384 | } |
| 385 | |
| 386 | void draw(Graphics g) { |
| 387 | int state = isCurrent() ? SELECTED : UNSELECTED; |
| 388 | g.setColor(tabColor[state]); |
| 389 | // if (notification) { |
| 390 | // g.setColor(errorColor); |
| 391 | // } |
| 392 | |
| 393 | Graphics2D g2 = (Graphics2D) g; |
| 394 | g2.fill(Toolkit.createRoundRect(left, TAB_TOP, right, TAB_BOTTOM, 0, 0, |
| 395 | isLast() ? CURVE_RADIUS : 0, |
| 396 | isFirst() ? CURVE_RADIUS : 0)); |
| 397 | |
| 398 | if (hasIcon()) { |
| 399 | Image icon = (isCurrent() || notification) ? selectedIcon : enabledIcon; |
| 400 | g.drawImage(icon, left + MARGIN, ICON_TOP, ICON_WIDTH, ICON_HEIGHT, null); |
| 401 | } |
| 402 | |
| 403 | int textLeft = getTextLeft(); |
| 404 | if (notification && state == UNSELECTED) { |
| 405 | g.setColor(textColor[SELECTED]); |
| 406 | } else { |
| 407 | g.setColor(textColor[state]); |
| 408 | } |
| 409 | int tabHeight = TAB_BOTTOM - TAB_TOP; |
| 410 | int baseline = TAB_TOP + (tabHeight + fontAscent) / 2; |
| 411 | g.drawString(name, textLeft, baseline); |
| 412 | } |
| 413 | } |
| 414 | } |
no test coverage detected