Ejemplo n.º 1
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;
 }
Ejemplo n.º 2
0
 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();
 }
Ejemplo n.º 3
0
 protected void paintRoundedBottomTabBorder(
     int tabIndex, Graphics g, int x1, int y1, int x2, int y2, boolean isSelected) {
   Graphics2D g2D = (Graphics2D) g;
   Object savedRederingHint = g2D.getRenderingHint(RenderingHints.KEY_ANTIALIASING);
   g2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
   int d = 2 * GAP;
   if (isSelected) {
     g.setColor(AbstractLookAndFeel.getTheme().getFrameColor());
   } else {
     g.setColor(ColorHelper.brighter(AbstractLookAndFeel.getTheme().getFrameColor(), 40));
   }
   g.drawLine(x1 + GAP, y2, x2 - GAP, y2);
   g.drawArc(x1, y2 - d, d, d, 180, 90);
   g.drawArc(x2 - d, y2 - d, d, d, -90, 90);
   g.drawLine(x1, y1, x1, y2 - GAP - 1);
   g.drawLine(x2, y1, x2, y2 - GAP - 1);
   g2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, savedRederingHint);
 }
Ejemplo n.º 4
0
 protected Color getContentBorderColor(int tabPlacement) {
   return ColorHelper.brighter(AbstractLookAndFeel.getTheme().getFrameColor(), 50);
 }
Ejemplo n.º 5
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);
      }
    }
  }