public void paintBorder(Graphics g) {
   if (isActive()) {
     g.setColor(AcrylLookAndFeel.getWindowBorderColor());
   } else {
     g.setColor(AcrylLookAndFeel.getWindowInactiveBorderColor());
   }
   g.drawLine(0, getHeight() - 1, getWidth(), getHeight() - 1);
 }
Exemplo n.º 2
0
 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;
 }
 public void paintText(Graphics g, int x, int y, String title) {
   Color shadowColor = AcrylLookAndFeel.getWindowTitleColorDark();
   if (isActive()) {
     shadowColor = ColorHelper.darker(shadowColor, 30);
   }
   g.setColor(shadowColor);
   JTattooUtilities.drawString(frame, g, title, x - 1, y - 1);
   JTattooUtilities.drawString(frame, g, title, x - 1, y + 1);
   JTattooUtilities.drawString(frame, g, title, x + 1, y - 1);
   JTattooUtilities.drawString(frame, g, title, x + 1, y + 1);
   if (isActive()) {
     g.setColor(AbstractLookAndFeel.getWindowTitleForegroundColor());
   } else {
     g.setColor(AbstractLookAndFeel.getWindowInactiveTitleForegroundColor());
   }
   JTattooUtilities.drawString(frame, g, title, x, y);
 }
Exemplo n.º 4
0
  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);
      }
    }
  }