349 if (v != null) {
350 v.paint(g2d, textRect);
351 return;
352 }
353
354 if (title == null) return;
355
356 final Color color = tabPane.getForegroundAt(tabIndex);
357 if (color instanceof UIResource) {
358 // sja fix getTheme().setThemeTextColor(g, isSelected, isPressed && tracking, tabPane.isEnabledAt(tabIndex));
359 if (tabPane.isEnabledAt(tabIndex)) {
360 g2d.setColor(Color.black);
361 } else {
362 g2d.setColor(Color.gray);
363 }
364 } else {
365 g2d.setColor(color);
366 }
367
368 g2d.setFont(font);
369 SwingUtilities2.drawString(tabPane, g2d, title, textRect.x, textRect.y + metrics.getAscent());
370 }
371
372 protected void rotateGraphics(final Graphics2D g2d, final Rectangle tabRect, final Rectangle textRect, final Rectangle iconRect, final int tabPlacement) {
373 int yDiff = 0; // textRect.y - tabRect.y;
374 int xDiff = 0; // (tabRect.x+tabRect.width) - (textRect.x+textRect.width);
375 int yIconDiff = 0; // iconRect.y - tabRect.y;
376 int xIconDiff = 0; // (tabRect.x+tabRect.width) - (iconRect.x + iconRect.width);
377
378 final double rotateAmount = (tabPlacement == LEFT ? -kNinetyDegrees : kNinetyDegrees);
379 g2d.transform(AffineTransform.getRotateInstance(rotateAmount, tabRect.x, tabRect.y));
380
381 // x and y diffs are named weirdly.
382 // I will rename them, but what they mean now is
383 // original x offset which will be used to adjust the y coordinate for the
384 // rotated context
385 if (tabPlacement == LEFT) {
386 g2d.translate(-tabRect.height - 1, 1);
387 xDiff = textRect.x - tabRect.x;
388 yDiff = tabRect.height + tabRect.y - (textRect.y + textRect.height);
389 xIconDiff = iconRect.x - tabRect.x;
|
349 if (v != null) {
350 v.paint(g2d, textRect);
351 return;
352 }
353
354 if (title == null) return;
355
356 final Color color = tabPane.getForegroundAt(tabIndex);
357 if (color instanceof UIResource) {
358 // sja fix getTheme().setThemeTextColor(g, isSelected, isPressed && tracking, tabPane.isEnabledAt(tabIndex));
359 if (tabPane.isEnabledAt(tabIndex)) {
360 g2d.setColor(Color.black);
361 } else {
362 g2d.setColor(Color.gray);
363 }
364 } else {
365 g2d.setColor(color);
366 }
367
368 g2d.setFont(font);
369 getTextUIDrawing().drawString(tabPane, g2d, title, textRect.x, textRect.y + metrics.getAscent());
370 }
371
372 protected void rotateGraphics(final Graphics2D g2d, final Rectangle tabRect, final Rectangle textRect, final Rectangle iconRect, final int tabPlacement) {
373 int yDiff = 0; // textRect.y - tabRect.y;
374 int xDiff = 0; // (tabRect.x+tabRect.width) - (textRect.x+textRect.width);
375 int yIconDiff = 0; // iconRect.y - tabRect.y;
376 int xIconDiff = 0; // (tabRect.x+tabRect.width) - (iconRect.x + iconRect.width);
377
378 final double rotateAmount = (tabPlacement == LEFT ? -kNinetyDegrees : kNinetyDegrees);
379 g2d.transform(AffineTransform.getRotateInstance(rotateAmount, tabRect.x, tabRect.y));
380
381 // x and y diffs are named weirdly.
382 // I will rename them, but what they mean now is
383 // original x offset which will be used to adjust the y coordinate for the
384 // rotated context
385 if (tabPlacement == LEFT) {
386 g2d.translate(-tabRect.height - 1, 1);
387 xDiff = textRect.x - tabRect.x;
388 yDiff = tabRect.height + tabRect.y - (textRect.y + textRect.height);
389 xIconDiff = iconRect.x - tabRect.x;
|