protected Color[] getContentBorderColors(int tabPlacement) { Color SEP_COLORS[] = { ColorHelper.brighter(AcrylLookAndFeel.getControlColorLight(), 20), AcrylLookAndFeel.getControlColorLight(), ColorHelper.brighter(AcrylLookAndFeel.getControlColorDark(), 20), AcrylLookAndFeel.getControlColorDark(), ColorHelper.darker(AcrylLookAndFeel.getControlColorDark(), 20), }; return SEP_COLORS; }
protected Color[] getTabColors(int tabIndex, boolean isSelected) { if ((tabIndex >= 0) && (tabIndex < tabPane.getTabCount())) { boolean isEnabled = tabPane.isEnabledAt(tabIndex); Color backColor = tabPane.getBackgroundAt(tabIndex); Color colorArr[] = AbstractLookAndFeel.getTheme().getTabColors(); if ((backColor instanceof UIResource)) { if (isSelected) { colorArr = AbstractLookAndFeel.getTheme().getDefaultColors(); } else if (tabIndex == rolloverIndex && isEnabled) { colorArr = AbstractLookAndFeel.getTheme().getRolloverColors(); } else { colorArr = AbstractLookAndFeel.getTheme().getTabColors(); } } else { if (isSelected) { if (tabPane.getTabPlacement() == BOTTOM) { colorArr = ColorHelper.createColorArr(backColor, ColorHelper.brighter(backColor, 50), 20); } else { colorArr = ColorHelper.createColorArr(ColorHelper.brighter(backColor, 50), backColor, 20); } } else { if (tabIndex == rolloverIndex && isEnabled) { colorArr = ColorHelper.createColorArr( ColorHelper.brighter(backColor, 80), ColorHelper.brighter(backColor, 20), 20); } else { colorArr = ColorHelper.createColorArr( ColorHelper.brighter(backColor, 40), ColorHelper.darker(backColor, 10), 20); } } } return colorArr; } return AbstractLookAndFeel.getTheme().getTabColors(); }
protected void paintText( Graphics g, int tabPlacement, Font font, FontMetrics metrics, int tabIndex, String title, Rectangle textRect, boolean isSelected) { g.setFont(font); View v = getTextViewForTab(tabIndex); if (v != null) { // html Graphics2D g2D = (Graphics2D) g; Object savedRenderingHint = null; if (AbstractLookAndFeel.getTheme().isTextAntiAliasingOn()) { savedRenderingHint = g2D.getRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING); g2D.setRenderingHint( RenderingHints.KEY_TEXT_ANTIALIASING, AbstractLookAndFeel.getTheme().getTextAntiAliasingHint()); } v.paint(g, textRect); if (AbstractLookAndFeel.getTheme().isTextAntiAliasingOn()) { g2D.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, savedRenderingHint); } } else { // plain text int mnemIndex = -1; if (JTattooUtilities.getJavaVersion() >= 1.4) { mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex); } if (tabPane.isEnabled() && tabPane.isEnabledAt(tabIndex)) { if (isSelected && (tabPane.getBackgroundAt(tabIndex) instanceof UIResource)) { Color shadowColor = ColorHelper.darker(AcrylLookAndFeel.getWindowTitleColorDark(), 30); g.setColor(shadowColor); JTattooUtilities.drawStringUnderlineCharAt( tabPane, g, title, mnemIndex, textRect.x - 1, textRect.y - 1 + metrics.getAscent()); JTattooUtilities.drawStringUnderlineCharAt( tabPane, g, title, mnemIndex, textRect.x - 1, textRect.y + 1 + metrics.getAscent()); JTattooUtilities.drawStringUnderlineCharAt( tabPane, g, title, mnemIndex, textRect.x + 1, textRect.y - 1 + metrics.getAscent()); JTattooUtilities.drawStringUnderlineCharAt( tabPane, g, title, mnemIndex, textRect.x + 1, textRect.y + 1 + metrics.getAscent()); g.setColor(AbstractLookAndFeel.getTheme().getWindowTitleForegroundColor()); } else { g.setColor(tabPane.getForegroundAt(tabIndex)); } JTattooUtilities.drawStringUnderlineCharAt( tabPane, g, title, mnemIndex, textRect.x, textRect.y + metrics.getAscent()); } else { // tab disabled g.setColor(tabPane.getBackgroundAt(tabIndex).brighter()); JTattooUtilities.drawStringUnderlineCharAt( tabPane, g, title, mnemIndex, textRect.x, textRect.y + metrics.getAscent()); g.setColor(tabPane.getBackgroundAt(tabIndex).darker()); JTattooUtilities.drawStringUnderlineCharAt( tabPane, g, title, mnemIndex, textRect.x - 1, textRect.y + metrics.getAscent() - 1); } } }