コード例 #1
0
 public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
   Color hiColor = ColorHelper.brighter(AbstractLookAndFeel.getTheme().getFocusFrameColor(), 60);
   Color loColor = AbstractLookAndFeel.getTheme().getFocusFrameColor();
   g.setColor(loColor);
   g.drawRect(x, y, width - 1, height - 1);
   g.setColor(hiColor);
   g.drawRect(x + 1, y + 1, width - 3, height - 3);
 }
コード例 #2
0
 public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) {
   Graphics2D g2D = (Graphics2D) g;
   Composite savedComposite = g2D.getComposite();
   AlphaComposite alpha = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.8f);
   g2D.setComposite(alpha);
   Color cHi = AbstractLookAndFeel.getTheme().getControlHighlightColor();
   Color cLo = AbstractLookAndFeel.getTheme().getControlShadowColor();
   JTattooUtilities.draw3DBorder(g, cHi, cLo, x, y, w, h);
   g2D.setComposite(savedComposite);
 }
コード例 #3
0
 /**
  * Gets the popup menu border.
  *
  * @return the popup menu border
  */
 public static Border getPopupMenuBorder() {
   if (popupMenuBorder == null) {
     if (AbstractLookAndFeel.getTheme().isMenuOpaque()) {
       popupMenuBorder = new BasePopupMenuBorder();
     } else {
       popupMenuBorder = new BasePopupMenuShadowBorder();
     }
   }
   return popupMenuBorder;
 }
コード例 #4
0
    public void paintLogo(Component c, Graphics g, int x, int y, int w, int h) {
      if (hasLogo(c)) {
        Graphics2D g2D = (Graphics2D) g;

        Font savedFont = g2D.getFont();
        g.setFont(logoFont);
        FontMetrics fm = JTattooUtilities.getFontMetrics((JComponent) c, g, c.getFont());
        String logo =
            JTattooUtilities.getClippedText(
                AbstractLookAndFeel.getTheme().getLogoString(), fm, h - 16);

        AffineTransform savedTransform = g2D.getTransform();

        Color fc = getLogoColorHi();
        Color bc = getLogoColorLo();

        if (JTattooUtilities.isLeftToRight(c)) {
          g2D.translate(fm.getAscent() + 1, h - shadowSize - 4);
          g2D.rotate(Math.toRadians(-90));
          g2D.setColor(bc);
          JTattooUtilities.drawString((JComponent) c, g, logo, 0, 1);
          g2D.setColor(fc);
          JTattooUtilities.drawString((JComponent) c, g, logo, 1, 0);
        } else {
          g2D.translate(w - shadowSize - 4, h - shadowSize - 4);
          g2D.rotate(Math.toRadians(-90));
          g2D.setColor(bc);
          JTattooUtilities.drawString((JComponent) c, g, logo, 0, 1);
          g2D.setColor(fc);
          JTattooUtilities.drawString((JComponent) c, g, logo, 1, 0);
        }

        g2D.setTransform(savedTransform);
        g2D.setFont(savedFont);
      }
    }
コード例 #5
0
    public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) {
      Graphics2D g2D = (Graphics2D) g;
      Composite savedComposite = g2D.getComposite();
      AlphaComposite alpha =
          AlphaComposite.getInstance(
              AlphaComposite.SRC_OVER, AbstractLookAndFeel.getTheme().getMenuAlpha());
      g2D.setComposite(alpha);
      Color logoColor = AbstractLookAndFeel.getTheme().getMenuSelectionBackgroundColor();
      Color borderColorLo = AbstractLookAndFeel.getFrameColor();
      Color borderColorHi =
          ColorHelper.brighter(AbstractLookAndFeel.getMenuSelectionBackgroundColor(), 40);
      g.setColor(logoColor);
      if (JTattooUtilities.isLeftToRight(c)) {
        int dx = getBorderInsets(c).left;
        g.fillRect(x, y, dx - 1, h - 1 - shadowSize);
        paintLogo(c, g, x, y, w, h);
        // - highlight
        g.setColor(ColorHelper.brighter(AbstractLookAndFeel.getMenuBackgroundColor(), 40));
        g.drawLine(x + dx, y + 1, x + w - shadowSize - 2, y + 1);
        g.setColor(borderColorHi);
        g.drawLine(x + 1, y, x + 1, y + h - shadowSize - 2);
        // - outer frame
        g.setColor(borderColorLo);
        if (isMenuBarPopup(c)) {
          // top
          g.drawLine(x + dx - 1, y, x + w - shadowSize - 1, y);
          // left
          g.drawLine(x, y, x, y + h - shadowSize - 1);
          // bottom
          g.drawLine(x, y + h - shadowSize - 1, x + w - shadowSize - 1, y + h - shadowSize - 1);
          // right
          g.drawLine(x + w - shadowSize - 1, y + 1, x + w - shadowSize - 1, y + h - shadowSize - 1);
        } else {
          g.drawRect(x, y, w - shadowSize - 1, h - shadowSize - 1);
        }
        // - logo separator
        g.drawLine(x + dx - 1, y + 1, x + dx - 1, y + h - shadowSize - 1);
      } else {
        int dx = getBorderInsets(c).right - shadowSize;
        g.fillRect(x + w - dx - shadowSize, y, dx - 1, h - 1 - shadowSize);
        paintLogo(c, g, x, y, w, h);
        // - highlight
        g.setColor(ColorHelper.brighter(AbstractLookAndFeel.getMenuBackgroundColor(), 40));
        g.drawLine(x + 1, y + 1, x + w - dx - shadowSize - 1, y + 1);
        g.drawLine(x + 1, y + 1, x + 1, y + h - shadowSize - 2);
        // - outer frame
        g.setColor(borderColorLo);
        if (isMenuBarPopup(c)) {
          // top
          g.drawLine(x, y, x + w - dx - shadowSize, y);
          // left
          g.drawLine(x, y, x, y + h - shadowSize - 1);
          // bottom
          g.drawLine(x, y + h - shadowSize - 1, x + w - shadowSize - 1, y + h - shadowSize - 1);
          // right
          g.drawLine(x + w - shadowSize - 1, y, x + w - shadowSize - 1, y + h - shadowSize - 1);
        } else {
          g.drawRect(x, y, w - shadowSize - 1, h - shadowSize - 1);
        }
        // - logo separator
        g.drawLine(x + w - dx - shadowSize, y + 1, x + w - dx - shadowSize, y + h - shadowSize - 1);
      }

      // paint the shadow
      g2D.setColor(AbstractLookAndFeel.getTheme().getShadowColor());
      float alphaValue = 0.4f;
      for (int i = 0; i < shadowSize; i++) {
        alpha = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alphaValue);
        g2D.setComposite(alpha);
        g.drawLine(
            x + w - shadowSize + i,
            y + shadowSize,
            x + w - shadowSize + i,
            y + h - shadowSize - 1 + i);
        g.drawLine(
            x + shadowSize, y + h - shadowSize + i, x + w - shadowSize + i, y + h - shadowSize + i);
        alphaValue -= (alphaValue / 2);
      }

      g2D.setComposite(savedComposite);
    }
コード例 #6
0
 /**
  * Gets the logo color lo.
  *
  * @return the logo color lo
  */
 public Color getLogoColorLo() {
   return ColorHelper.darker(
       AbstractLookAndFeel.getTheme().getMenuSelectionBackgroundColor(), 20);
 }
コード例 #7
0
 public boolean hasLogo(Component c) {
   return ((AbstractLookAndFeel.getTheme().getLogoString() != null)
       && (AbstractLookAndFeel.getTheme().getLogoString().length() > 0));
 }
コード例 #8
0
 public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) {
   g.setColor(AbstractLookAndFeel.getTheme().getFrameColor());
   g.drawRect(x, y, w - 1, h - 1);
   g.setColor(ColorHelper.brighter(AbstractLookAndFeel.getTheme().getBackgroundColor(), 50));
   g.drawRect(x + 1, y + 1, w - 3, h - 3);
 }
コード例 #9
0
 public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
   g.setColor(AbstractLookAndFeel.getTheme().getFrameColor());
   g.drawRect(x, y, width - 1, height - 1);
 }
コード例 #10
0
 public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) {
   Color frameColor = AbstractLookAndFeel.getTheme().getBackgroundColor();
   JTattooUtilities.draw3DBorder(
       g, ColorHelper.darker(frameColor, 20), ColorHelper.brighter(frameColor, 80), x, y, w, h);
 }