(Graphics g)
| 360 | } |
| 361 | |
| 362 | void draw(Graphics g) { |
| 363 | int state = isCurrent() ? SELECTED : UNSELECTED; |
| 364 | g.setColor(tabColor[state]); |
| 365 | |
| 366 | Graphics2D g2 = (Graphics2D) g; |
| 367 | // g2.fill(Toolkit.createRoundRect(left, TAB_TOP, right, TAB_BOTTOM, 0, 0, |
| 368 | // isLast() ? CURVE_RADIUS : 0, |
| 369 | // hastLeftCurve() ? CURVE_RADIUS : 0)); |
| 370 | g2.fill(Toolkit.createRoundRect(left, TAB_TOP, |
| 371 | right, TAB_BOTTOM, |
| 372 | hasLeftNotch() ? CURVE_RADIUS : 0, |
| 373 | hasRightNotch() ? CURVE_RADIUS : 0, |
| 374 | 0, 0)); |
| 375 | |
| 376 | if (hasIcon()) { |
| 377 | Image icon = (isCurrent() || notification) ? selectedIcon : enabledIcon; |
| 378 | g.drawImage(icon, left + MARGIN, ICON_TOP, ICON_WIDTH, ICON_HEIGHT, null); |
| 379 | } |
| 380 | |
| 381 | int textLeft = getTextLeft(); |
| 382 | if (notification && state == UNSELECTED) { |
| 383 | g.setColor(textColor[SELECTED]); |
| 384 | } else { |
| 385 | g.setColor(textColor[state]); |
| 386 | } |
| 387 | int tabHeight = TAB_BOTTOM - TAB_TOP; |
| 388 | int baseline = TAB_TOP + (tabHeight + fontAscent) / 2; |
| 389 | g.drawString(name, textLeft, baseline); |
| 390 | } |
| 391 | } |
| 392 | } |
no test coverage detected