protected void drawArrow(Graphics g) {
    this.dimension = getSize();

    if (getModel().isEnabled()) {
      g.setColor(RapidLookTools.getColors().getSpinnerColors()[9]);
    } else {
      g.setColor(RapidLookTools.getColors().getSpinnerColors()[10]);
    }

    int baseY = (int) ((this.dimension.getHeight() / 2) - 2);
    if (!this.up) {
      baseY++;
    }

    g.translate(5, baseY);
    if (this.up) {
      g.drawLine(2, 0, 3, 0);
      g.drawLine(1, 1, 4, 1);
      g.drawLine(0, 2, 1, 2);
      g.drawLine(4, 2, 5, 2);
    } else {
      g.drawLine(2, 2, 3, 2);
      g.drawLine(1, 1, 4, 1);
      g.drawLine(0, 0, 1, 0);
      g.drawLine(4, 0, 5, 0);
    }
    g.translate(-6, -baseY);
  }
  @Override
  public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) {
    g.setColor(RapidLookTools.getColors().getBorderColors()[0][1]);
    g.drawLine(1, 23, 1, h - 2);
    g.drawLine(w - 2, 23, w - 2, h - 2);
    g.drawLine(1, h - 2, w - 2, h - 2);

    g.setColor(RapidLookTools.getColors().getBorderColors()[0][0]);
    g.drawLine(0, 23, 0, h - 1);
    g.drawLine(2, 23, 2, h - 3);
    g.drawLine(w - 1, 23, w - 1, h - 1);
    g.drawLine(w - 3, 23, w - 3, h - 3);
    g.drawLine(0, h - 1, w - 1, h - 1);
  }
示例#3
0
  @Override
  protected void paintContentBorder(Graphics g, int tabPlacement, int selectedIndex) {
    int width = this.tabPane.getWidth();
    int height = this.tabPane.getHeight();
    Insets insets = this.tabPane.getInsets();

    int x = insets.left;
    int y = insets.top;
    int w = width - insets.right - insets.left;
    int h = height - insets.top - insets.bottom;

    switch (tabPlacement) {
      case LEFT:
        x += calculateTabAreaWidth(tabPlacement, this.runCount, this.maxTabWidth);
        w -= (x - insets.left);
        break;
      case RIGHT:
        w -= calculateTabAreaWidth(tabPlacement, this.runCount, this.maxTabWidth);
        break;
      case BOTTOM:
        h -= calculateTabAreaHeight(tabPlacement, this.runCount, this.maxTabHeight);
        break;
      case TOP:
      default:
        y += calculateTabAreaHeight(tabPlacement, this.runCount, this.maxTabHeight);
        h -= (y - insets.top);
    }

    g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[0]);
    g.fillRect(x, y, w, h);
  }
示例#4
0
  private static void paintSelectedBottom(Graphics g, int x, int y, int w, int h) {
    g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[1]);
    g.drawLine(x + 11, y + h - 1, x + w - 12, y + h - 1);
    g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[2]);
    g.drawLine(x + 10, y + h - 2, x + w - 11, y + h - 2);

    g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[3]);
    g.drawLine(x + 13, y + h - 1, x + w - 14, y + h - 1);

    ColorUIResource c1 = RapidLookTools.getColors().getTabbedPaneColors()[4];
    g.setColor(c1);

    // left
    g.drawLine(x + 9, y + h - 2, x + 9, y + h - 3);
    g.drawLine(x + 8, y + h - 3, x + 8, y + h - 3);
    g.drawLine(x + 7, y + h - 3, x + 7, y + h - 4);
    g.drawLine(x + 6, y + h - 4, x + 6, y + h - 5);
    g.drawLine(x + 5, y + h - 5, x + 5, y + h - 6);

    // right
    g.drawLine(w + x - 10, y + h - 2, w + x - 10, y + h - 3);
    g.drawLine(w + x - 9, y + h - 3, w + x - 9, y + h - 3);
    g.drawLine(w + x - 8, y + h - 3, w + x - 8, y + h - 4);
    g.drawLine(w + x - 7, y + h - 4, w + x - 7, y + h - 5);
    g.drawLine(w + x - 6, y + h - 5, w + x - 6, y + h - 6);

    // inner section
    g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[5]);

    g.drawLine(x + 10, y + h - 3, x + w - 11, y + h - 3);
    g.drawLine(x + 8, y + h - 4, x + w - 9, y + h - 4);
    g.drawLine(x + 7, y + h - 5, x + w - 8, y + h - 5);
    g.drawLine(x + 6, y + h - 6, x + w - 7, y + h - 6);

    Graphics2D g2 = (Graphics2D) g;
    g2.setPaint(
        new GradientPaint(
            1,
            y,
            RapidLookTools.getColors().getTabbedPaneColors()[7],
            1,
            y + h - 6,
            RapidLookTools.getColors().getTabbedPaneColors()[6]));

    int[] xArr = new int[] {x + 4, w + x - 5, x + w - 1, x};
    int[] yArr = new int[] {y + h - 6, y + h - 6, y, y};
    Polygon p1 = new Polygon(xArr, yArr, 4);
    g2.fillPolygon(p1);

    g2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
    g2.setColor(c1);
    g2.drawLine(x, y, x + 4, y + h - 6);
    g2.drawLine(w + x - 1, y, x + w - 5, y + h - 6);
    g2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_DEFAULT);
  }
示例#5
0
    @Override
    public void mousePressed(MouseEvent e) {
      super.mousePressed(e);
      if (!this.toolBar.isEnabled()) {
        return;
      }
      this.pressedToolbarHandler = false;
      Rectangle bumpRect = new Rectangle();

      if (this.toolBar.getOrientation() == SwingConstants.HORIZONTAL) {
        int x = RapidLookTools.isLeftToRight(this.toolBar) ? 0 : this.toolBar.getSize().width - 14;
        bumpRect.setBounds(x, 0, 14, this.toolBar.getSize().height);
      } else { // vertical
        bumpRect.setBounds(0, 0, this.toolBar.getSize().width, 14);
      }
      if (bumpRect.contains(e.getPoint())) {
        this.pressedToolbarHandler = true;
        Point dragOffset = e.getPoint();
        if (!RapidLookTools.isLeftToRight(this.toolBar)) {
          dragOffset.x -= (this.toolBar.getSize().width - this.toolBar.getPreferredSize().width);
        }
        setDragOffset(dragOffset);
      }
    }
示例#6
0
  private static void paintSelectedLeft(Graphics g, int x, int y, int w, int h) {

    g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[2]);
    g.drawLine(x + 10, y + 1, x + w - 1, y + 1);

    g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[3]);
    g.drawLine(x + 11, y, x + w - 1, y);

    ColorUIResource c1 = RapidLookTools.getColors().getTabbedPaneColors()[4];
    g.setColor(c1);

    g.drawLine(x + 9, y + 1, x + 9, y + 2);
    g.drawLine(x + 8, y + 2, x + 8, y + 2);
    g.drawLine(x + 7, y + 2, x + 7, y + 3);
    g.drawLine(x + 6, y + 3, x + 6, y + 4);
    g.drawLine(x + 5, y + 4, x + 5, y + 5);

    g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[5]);

    g.drawLine(x + 10, y + 2, x + w - 5, y + 2);
    g.drawLine(x + 8, y + 3, x + w - 5, y + 3);
    g.drawLine(x + 7, y + 4, x + w - 5, y + 4);
    g.drawLine(x + 6, y + 5, x + w - 5, y + 5);

    Graphics2D g2 = (Graphics2D) g;
    g2.setPaint(
        new GradientPaint(
            1,
            y + 6,
            RapidLookTools.getColors().getTabbedPaneColors()[6],
            1,
            y + h,
            RapidLookTools.getColors().getTabbedPaneColors()[7]));

    int[] xArr = new int[] {x + 4, w + x - 5, w + x - 5, x + 4};
    int[] yArr = new int[] {y + 6, y + 6, y + h, y + h};
    Polygon p1 = new Polygon(xArr, yArr, 4);

    g2.fillPolygon(p1);

    g.setColor(c1);
    g.drawLine(x + 4, y + 6, x + 4, y + h - 1);

    g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[1]);
    g.drawLine(x + 11, y, x + 13, y);
    g.drawLine(x + 5, y + 6, x + 5, y + 6);
  }
  private void paintDownButton(Graphics g) {
    int w = (int) getSize().getWidth();
    int h = (int) getSize().getHeight();

    if (getModel().isEnabled()) {
      if (getModel().isPressed()) {
        g.setColor(RapidLookTools.getColors().getSpinnerColors()[0]);
        g.drawLine(1, 0, w - 1, 0);
        g.fillRect(1, 1, w - 1, h - 3);
        g.drawLine(1, h - 4, w - 1, h - 4);
        g.drawLine(1, h - 3, w - 2, h - 3);
        g.drawLine(1, h - 2, w - 3, h - 2);
        g.drawLine(1, h - 1, w - 5, h - 1);
        g.drawLine(1, 0, w - 1, 0);
        g.drawLine(w - 1, 1, w - 1, h - 3);
        g.drawLine(w - 2, 1, w - 2, h - 4);
        g.drawLine(w - 3, 1, w - 3, h - 4);

        g.setColor(RapidLookTools.getColors().getSpinnerColors()[1]);
        g.drawLine(0, 0, 0, h);
      } else {
        g.setColor(RapidLookTools.getColors().getSpinnerColors()[2]);
        g.drawLine(1, 0, w - 1, 0);
        g.fillRect(1, 1, w - 1, h - 3);

        g.setColor(RapidLookTools.getColors().getSpinnerColors()[3]);
        g.drawLine(1, h - 4, w - 1, h - 4);

        g.setColor(RapidLookTools.getColors().getSpinnerColors()[4]);
        g.drawLine(1, h - 3, w - 2, h - 3);

        g.setColor(RapidLookTools.getColors().getSpinnerColors()[5]);
        g.drawLine(1, h - 2, w - 3, h - 2);

        g.setColor(RapidLookTools.getColors().getSpinnerColors()[6]);
        g.drawLine(1, h - 1, w - 5, h - 1);

        g.setColor(RapidLookTools.getColors().getSpinnerColors()[3]);
        g.drawLine(1, 0, w - 1, 0);

        g.setColor(RapidLookTools.getColors().getSpinnerColors()[7]);
        g.drawLine(0, 0, 0, h);

        g.setColor(RapidLookTools.getColors().getSpinnerColors()[4]);
        g.drawLine(w - 1, 1, w - 1, h - 3);

        g.setColor(RapidLookTools.getColors().getSpinnerColors()[8]);
        g.drawLine(w - 2, 1, w - 2, h - 4);

        g.setColor(RapidLookTools.getColors().getSpinnerColors()[3]);
        g.drawLine(w - 3, 1, w - 3, h - 4);
      }
    } else {
      g.setColor(RapidLookTools.getColors().getSpinnerColors()[8]);
      g.drawLine(1, 0, w - 1, 0);
      g.fillRect(1, 1, w - 1, h - 3);
      g.drawLine(1, h - 4, w - 1, h - 4);
      g.drawLine(1, h - 3, w - 2, h - 3);
      g.drawLine(1, h - 2, w - 3, h - 2);
      g.drawLine(1, h - 1, w - 5, h - 1);
      g.drawLine(1, 0, w - 1, 0);
      g.drawLine(w - 1, 1, w - 1, h - 3);
      g.drawLine(w - 2, 1, w - 2, h - 4);
      g.drawLine(w - 3, 1, w - 3, h - 4);

      g.setColor(RapidLookTools.getColors().getSpinnerColors()[7]);
      g.drawLine(0, 0, 0, h);
    }
  }
示例#8
0
  protected void paintTabBorderFree(
      Graphics g,
      int tabPlacement,
      int tabIndex,
      int xp,
      int yp,
      int mw,
      int h,
      boolean isSelected) {
    int x = xp + 2;
    int y = yp;
    int w = mw - 4;

    if (tabPlacement == SwingConstants.BOTTOM) {
      g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[8]);
      g.drawLine(x + 4, y + h - 1, x + w - 5, y + h - 1);
      g.drawLine(x, y, x, y + h - 5);
      g.drawLine(x + w - 1, y, x + w - 1, y + h - 4);

      ColorUIResource c1 = RapidLookTools.getColors().getTabbedPaneColors()[9];
      ColorUIResource c2 = RapidLookTools.getColors().getTabbedPaneColors()[20];
      ColorUIResource c3 = RapidLookTools.getColors().getTabbedPaneColors()[10];

      // left
      g.setColor(c3);
      g.drawLine(x + 2, y + h - 1, x, y + h - 3);
      g.setColor(c1);
      g.drawLine(x, y + h - 4, x + 3, y + h - 1);
      g.drawLine(x + 1, y + h - 2, x + 1, y + h - 2);
      g.setColor(c2);
      g.drawLine(x + 3, y + h - 2, x + 1, y + h - 4);

      // right
      g.setColor(c3);
      g.drawLine(x + w - 1, y + h - 3, x + w - 3, y + h - 1);
      g.setColor(c1);
      g.drawLine(x + w - 4, y + h - 1, x + w - 1, y + h - 4);
      g.drawLine(x + w - 2, y + h - 2, x + w - 2, y + h - 2);
      g.setColor(c2);
      g.drawLine(x + w - 4, y + h - 2, x + w - 2, y + h - 4);

      if (tabIndex != this.rolloveredTabIndex) {
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[11]);
        g.drawLine(x + 1, y, x + w - 2, y);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[12]);
        g.drawLine(x + 1, y + 1, x + w - 2, y + 1);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[13]);
        g.drawLine(x + 1, y + 2, x + w - 2, y + 2);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[14]);
        g.drawLine(x + 1, y + 3, x + w - 2, y + 3);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[15]);
        g.drawLine(x + 1, y + 4, x + w - 2, y + 4);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[16]);
        g.drawLine(x + 1, y + 5, x + w - 2, y + 5);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[17]);
        g.drawLine(x + 1, y + 6, x + w - 2, y + 6);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[18]);
        g.fillRect(x + 1, y + 7, w - 2, h - 11);
        g.drawLine(x + 2, y + h - 4, x + w - 3, y + h - 4);
        g.drawLine(x + 3, y + h - 3, x + w - 4, y + h - 3);
        g.drawLine(x + 4, y + h - 2, x + w - 5, y + h - 2);
      } else {
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[18]);
        g.drawLine(x + 1, y, x + w - 2, y);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[17]);
        g.drawLine(x + 1, y + 1, x + w - 2, y + 1);
        g.drawLine(x + 1, y + 2, x + w - 2, y + 2);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[16]);
        g.drawLine(x + 1, y + 3, x + w - 2, y + 3);
        g.drawLine(x + 1, y + 4, x + w - 2, y + 4);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[15]);
        g.drawLine(x + 1, y + 5, x + w - 2, y + 5);
        g.drawLine(x + 1, y + 6, x + w - 2, y + 6);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[14]);
        g.fillRect(x + 1, y + 7, w - 2, h - 11);
        g.drawLine(x + 2, y + h - 4, x + w - 3, y + h - 4);
        g.drawLine(x + 3, y + h - 3, x + w - 4, y + h - 3);
        g.drawLine(x + 4, y + h - 2, x + w - 5, y + h - 2);
      }
    } else if (tabPlacement == SwingConstants.RIGHT) {
      x -= 2;
      g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[8]);
      g.drawLine(x, y, x + w - 5, y);
      g.drawLine(x + w - 1, y + 4, x + w - 1, y + h - 1);

      ColorUIResource c1 = RapidLookTools.getColors().getTabbedPaneColors()[9];
      ColorUIResource c2 = RapidLookTools.getColors().getTabbedPaneColors()[19];
      ColorUIResource c3 = RapidLookTools.getColors().getTabbedPaneColors()[10];

      // right
      g.setColor(c3);
      g.drawLine(x + w - 1, y + 2, x + w - 3, y);
      g.setColor(c1);
      g.drawLine(x + w - 4, y, x + w - 1, y + 3);
      g.drawLine(x + w - 2, y + 1, x + w - 2, y + 1);
      g.setColor(c2);
      g.drawLine(x + w - 4, y + 1, x + w - 2, y + 3);

      if (tabIndex != this.rolloveredTabIndex) {
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[11]);
        g.drawLine(x, y + 1, x + w - 5, y + 1);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[12]);
        g.drawLine(x, y + 2, x + w - 4, y + 2);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[13]);
        g.drawLine(x, y + 3, x + w - 3, y + 3);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[14]);
        g.drawLine(x, y + 4, x + w - 2, y + 4);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[15]);
        g.drawLine(x, y + 5, x + w - 2, y + 5);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[16]);
        g.drawLine(x, y + 6, x + w - 2, y + 6);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[17]);
        g.drawLine(x, y + 7, x + w - 2, y + 7);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[18]);
        g.fillRect(x, y + 8, w - 1, h - 8);
      } else {
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[14]);
        g.drawLine(x, y + 1, x + w - 5, y + 1);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[18]);
        g.drawLine(x, y + 2, x + w - 4, y + 2);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[18]);
        g.drawLine(x, y + 3, x + w - 3, y + 3);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[17]);
        g.drawLine(x, y + 4, x + w - 2, y + 4);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[17]);
        g.drawLine(x, y + 5, x + w - 2, y + 5);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[16]);
        g.drawLine(x, y + 6, x + w - 2, y + 6);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[16]);
        g.drawLine(x, y + 7, x + w - 2, y + 7);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[15]);
        g.fillRect(x, y + 8, w - 1, h - 8);
      }
    } else if (tabPlacement == SwingConstants.LEFT) {
      x += 2;
      g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[8]);
      g.drawLine(x + 4, y, x + w - 1, y);
      g.drawLine(x, y + 4, x, y + h - 1);

      ColorUIResource c1 = RapidLookTools.getColors().getTabbedPaneColors()[9];
      ColorUIResource c2 = RapidLookTools.getColors().getTabbedPaneColors()[19];
      ColorUIResource c3 = RapidLookTools.getColors().getTabbedPaneColors()[10];

      // left
      g.setColor(c3);
      g.drawLine(x + 2, y, x, y + 2);
      g.setColor(c1);
      g.drawLine(x, y + 3, x + 3, y);
      g.drawLine(x + 1, y + 1, x + 1, y + 1);
      g.setColor(c2);
      g.drawLine(x + 3, y + 1, x + 1, y + 3);

      if (tabIndex != this.rolloveredTabIndex) {
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[11]);
        g.drawLine(x + 4, y + 1, x + w - 1, y + 1);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[12]);
        g.drawLine(x + 3, y + 2, x + w - 1, y + 2);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[13]);
        g.drawLine(x + 2, y + 3, x + w - 1, y + 3);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[14]);
        g.drawLine(x + 1, y + 4, x + w - 1, y + 4);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[15]);
        g.drawLine(x + 1, y + 5, x + w - 1, y + 5);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[16]);
        g.drawLine(x + 1, y + 6, x + w - 1, y + 6);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[17]);
        g.drawLine(x + 1, y + 7, x + w - 1, y + 7);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[18]);
        g.fillRect(x + 1, y + 8, w - 1, h - 8);
      } else {
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[14]);
        g.drawLine(x + 4, y + 1, x + w - 1, y + 1);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[18]);
        g.drawLine(x + 3, y + 2, x + w - 1, y + 2);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[18]);
        g.drawLine(x + 2, y + 3, x + w - 1, y + 3);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[17]);
        g.drawLine(x + 1, y + 4, x + w - 1, y + 4);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[17]);
        g.drawLine(x + 1, y + 5, x + w - 1, y + 5);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[16]);
        g.drawLine(x + 1, y + 6, x + w - 1, y + 6);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[16]);
        g.drawLine(x + 1, y + 7, x + w - 1, y + 7);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[15]);
        g.fillRect(x + 1, y + 8, w - 1, h - 8);
      }
    } else { // top
      g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[8]);

      g.drawLine(x + 4, y, x + w - 5, y);
      g.drawLine(x, y + 4, x, y + h - 1);
      g.drawLine(x + w - 1, y + 4, x + w - 1, y + h - 1);

      ColorUIResource c1 = RapidLookTools.getColors().getTabbedPaneColors()[9];
      ColorUIResource c2 = RapidLookTools.getColors().getTabbedPaneColors()[19];
      ColorUIResource c3 = RapidLookTools.getColors().getTabbedPaneColors()[10];

      // left
      g.setColor(c3);
      g.drawLine(x + 2, y, x, y + 2);
      g.setColor(c1);
      g.drawLine(x, y + 3, x + 3, y);
      g.drawLine(x + 1, y + 1, x + 1, y + 1);
      g.setColor(c2);
      g.drawLine(x + 3, y + 1, x + 1, y + 3);

      // right
      g.setColor(c3);
      g.drawLine(x + w - 1, y + 2, x + w - 3, y);
      g.setColor(c1);
      g.drawLine(x + w - 4, y, x + w - 1, y + 3);
      g.drawLine(x + w - 2, y + 1, x + w - 2, y + 1);
      g.setColor(c2);
      g.drawLine(x + w - 4, y + 1, x + w - 2, y + 3);

      if (tabIndex != this.rolloveredTabIndex) {
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[11]);
        g.drawLine(x + 4, y + 1, x + w - 5, y + 1);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[12]);
        g.drawLine(x + 3, y + 2, x + w - 4, y + 2);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[13]);
        g.drawLine(x + 2, y + 3, x + w - 3, y + 3);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[14]);
        g.drawLine(x + 1, y + 4, x + w - 2, y + 4);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[15]);
        g.drawLine(x + 1, y + 5, x + w - 2, y + 5);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[16]);
        g.drawLine(x + 1, y + 6, x + w - 2, y + 6);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[17]);
        g.drawLine(x + 1, y + 7, x + w - 2, y + 7);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[18]);
        g.fillRect(x + 1, y + 8, w - 2, h - 8);
      } else {
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[14]);
        g.drawLine(x + 4, y + 1, x + w - 5, y + 1);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[18]);
        g.drawLine(x + 3, y + 2, x + w - 4, y + 2);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[18]);
        g.drawLine(x + 2, y + 3, x + w - 3, y + 3);

        // highlight
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[21]);
        g.drawLine(x + 3, y + 1, x + w - 4, y + 1);

        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[17]);
        g.drawLine(x + 1, y + 4, x + w - 2, y + 4);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[17]);
        g.drawLine(x + 1, y + 5, x + w - 2, y + 5);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[16]);
        g.drawLine(x + 1, y + 6, x + w - 2, y + 6);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[16]);
        g.drawLine(x + 1, y + 7, x + w - 2, y + 7);
        g.setColor(RapidLookTools.getColors().getTabbedPaneColors()[15]);
        g.fillRect(x + 1, y + 8, w - 2, h - 8);
      }
    }
  }
示例#9
0
 @Override
 protected void paintBackground(Graphics g, JMenuItem menuItem, Color bgColor) {
   JMenu menu = (JMenu) menuItem;
   ButtonModel buttonmodel = menu.getModel();
   if (menu.isTopLevelMenu()) {
     this.selectionForeground = Colors.getBlack();
   } else {
     this.selectionForeground = Colors.getWhite();
   }
   int w = menu.getWidth();
   int h = menu.getHeight();
   Color oldColor = g.getColor();
   if (!menu.isContentAreaFilled() || !menu.isOpaque()) {
     // do nothing
   } else {
     if (menu.isTopLevelMenu()) {
       if (buttonmodel.isSelected()) {
         CashedPainter.drawMenuBackground(menuItem, g, 0, 0, w, h);
       } else if (buttonmodel.isRollover() && buttonmodel.isEnabled()) {
         g.setColor(new ColorUIResource(252, 252, 252));
         g.fillRect(1, 1, w - 2, h - 2);
         g.setColor(RapidLookTools.getColors().getToolbarButtonColors()[0]);
         g.drawLine(2, 0, w - 3, 0);
         g.drawLine(2, h - 1, w - 3, h - 1);
         g.drawLine(0, 2, 0, h - 3);
         g.drawLine(w - 1, 2, w - 1, h - 3);
         g.drawLine(1, 1, 1, 1);
         g.drawLine(w - 2, 1, w - 2, 1);
         g.drawLine(1, h - 2, 1, h - 2);
         g.drawLine(w - 2, h - 2, w - 2, h - 2);
         g.setColor(RapidLookTools.getColors().getToolbarButtonColors()[8]);
         g.drawLine(0, 1, 1, 0);
         g.drawLine(w - 1, 1, w - 2, 0);
         g.drawLine(1, h - 1, 0, h - 2);
         g.drawLine(w - 1, h - 2, w - 2, h - 1);
         g.setColor(RapidLookTools.getColors().getToolbarButtonColors()[7]);
         g.drawLine(1, 2, 2, 1);
         g.drawLine(w - 2, 2, w - 3, 1);
         g.setColor(RapidLookTools.getColors().getToolbarButtonColors()[6]);
         g.drawLine(2, h - 2, 1, h - 3);
         g.drawLine(w - 2, h - 3, w - 3, h - 2);
         g.setColor(new ColorUIResource(252, 252, 252));
         g.drawLine(0, 0, 0, 0);
         g.drawLine(w - 1, 0, w - 1, 0);
         g.setColor(new ColorUIResource(232, 232, 232));
         g.drawLine(0, h - 1, 0, h - 1);
         g.drawLine(w - 1, h - 1, w - 1, h - 1);
       } else {
         if (menuItem.getParent() instanceof JMenuBar) {
           ((MenuBarUI) ((JMenuBar) menuItem.getParent()).getUI()).update(g, menuItem);
         }
       }
     } else {
       if (!menuItem.getModel().isSelected()) {
         CashedPainter.drawMenuItemFading(menuItem, g);
       } else {
         RapidLookTools.drawMenuItemBackground(g, menuItem);
       }
     }
   }
   g.setColor(oldColor);
 }