示例#1
0
  private static void drawMenuBezel(
      Graphics g, Color background, int x, int y, int width, int height) {
    // shadowed button region
    g.setColor(background);
    g.fillRect(x, y, width, height);

    g.setColor(background.brighter().brighter());
    g.drawLine(x + 1, y + height - 1, x + width - 1, y + height - 1);
    g.drawLine(x + width - 1, y + height - 2, x + width - 1, y + 1);

    g.setColor(background.darker().darker());
    g.drawLine(x, y, x + width - 2, y);
    g.drawLine(x, y + 1, x, y + height - 2);
  }
示例#2
0
    /**
     * Draws the FrameBorder in the given Rect. Calls <b>drawTitleBar</b>, <b>drawLeftBorder</b>,
     * <b>drawRightBorder</b> and <b>drawBottomBorder</b>.
     */
    public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
      if (isActiveFrame()) {
        frameColor = UIManager.getColor("activeCaptionBorder");
      } else {
        frameColor = UIManager.getColor("inactiveCaptionBorder");
      }
      frameHighlight = frameColor.brighter();
      frameShadow = frameColor.darker().darker();

      drawTopBorder(c, g, x, y, width, height);
      drawLeftBorder(c, g, x, y, width, height);
      drawRightBorder(c, g, x, y, width, height);
      drawBottomBorder(c, g, x, y, width, height);
    }