Exemplo n.º 1
0
  /**
   * Draws the "Round Disabled Border" which is used throughout the SIPComm L&F.
   *
   * @param g the <tt>Graphics</tt> object used for painting
   * @param x the x coordinate to start the border
   * @param y the y coordinate to start the border
   * @param w the width of the border
   * @param h the height of the border
   * @param r1 the arc width
   * @param r2 the arc height
   */
  static void drawRoundDisabledBorder(Graphics g, int x, int y, int w, int h, int r1, int r2) {
    AntialiasingManager.activateAntialiasing(g);
    Graphics2D g2 = (Graphics2D) g.create();
    try {
      g2.setColor(SIPCommLookAndFeel.getControlShadow());

      g2.drawRoundRect(0, 0, w - 1, h - 1, r1, r2);
    } finally {
      g.dispose();
    }
  }
Exemplo n.º 2
0
    /** @{inheritDoc} */
    @Override
    public void paintComponent(Graphics g) {
      super.paintComponent(g);

      g = g.create();

      try {
        AntialiasingManager.activateAntialiasing(g);

        g.setColor(Color.DARK_GRAY);
        g.fillRoundRect(0, 0, this.getWidth(), this.getHeight(), 10, 10);
      } finally {
        g.dispose();
      }
    }
Exemplo n.º 3
0
  /**
   * Draws the "Bold Round Disabled Border" which is used throughout the SIPComm L&F.
   *
   * @param g the <tt>Graphics</tt> object used for painting
   * @param x the x coordinate to start the border
   * @param y the y coordinate to start the border
   * @param w the width of the border
   * @param h the height of the border
   * @param r1 the arc width
   * @param r2 the arc height
   */
  static void drawBoldRoundBorder(Graphics g, int x, int y, int w, int h, int r1, int r2) {
    g = g.create();
    try {
      AntialiasingManager.activateAntialiasing(g);

      Graphics2D g2 = (Graphics2D) g;

      g2.setColor(Constants.BORDER_COLOR);
      g2.setStroke(new BasicStroke(1.5f));

      g2.drawRoundRect(x, y, w - 1, h - 1, r1, r2);
    } finally {
      g.dispose();
    }
  }
  /**
   * Paints a customized background.
   *
   * @param g the <tt>Graphics</tt> object through which we paint
   */
  @Override
  protected void paintComponent(Graphics g) {
    super.paintComponent(g);

    g = g.create();

    if (!(treeNode instanceof GroupNode) && !isSelected) return;

    AntialiasingManager.activateAntialiasing(g);

    Graphics2D g2 = (Graphics2D) g;

    try {
      internalPaintComponent(g2);
    } finally {
      g.dispose();
    }
  }
  /**
   * Draw the icon at the specified location. Paints this component as an icon.
   *
   * @param c the component which can be used as observer
   * @param g the <tt>Graphics</tt> object used for painting
   * @param x the position on the X coordinate
   * @param y the position on the Y coordinate
   */
  public void paintIcon(Component c, Graphics g, int x, int y) {
    g = g.create();
    try {
      Graphics2D g2 = (Graphics2D) g;
      AntialiasingManager.activateAntialiasing(g2);

      g2.setColor(Color.WHITE);
      g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.8f));
      g2.fillRoundRect(x, y, getIconWidth() - 1, getIconHeight() - 1, 10, 10);
      g2.setColor(Color.DARK_GRAY);
      g2.drawRoundRect(x, y, getIconWidth() - 1, getIconHeight() - 1, 10, 10);

      // Indent component content from the border.
      g2.translate(x + 5, y + 5);

      super.paint(g2);

      g2.translate(x, y);
    } finally {
      g.dispose();
    }
  }
    @Override
    protected void paintComponent(Graphics g) {
      super.paintComponent(g);

      g = g.create();
      try {
        AntialiasingManager.activateAntialiasing(g);

        Graphics2D g2 = (Graphics2D) g;

        if (bgImage != null) g2.drawImage(bgImage.getImage(), 30, 30, null);

        g2.drawImage(
            ImageLoader.getImage(ImageLoader.AUTH_WINDOW_BACKGROUND),
            0,
            0,
            this.getWidth(),
            this.getHeight(),
            null);
      } finally {
        g.dispose();
      }
    }
Exemplo n.º 7
0
  /**
   * Overrides the <code>paintComponent</code> method in <tt>JComponent</tt> to paint the screen
   * capture image as a background of this component.
   */
  @Override
  protected void paintComponent(Graphics g) {
    g = g.create();
    try {
      AntialiasingManager.activateAntialiasing(g);

      Graphics2D g2 = (Graphics2D) g;
      int width = getWidth();
      int height = getHeight();

      g2.drawImage(this.background, 0, 0, null);

      g2.setColor(new Color(255, 255, 255, 180));

      g2.fillRoundRect(0, 0, width, height, 10, 10);

      g2.setColor(Constants.BORDER_COLOR);

      g2.drawRoundRect(0, 0, width - 1, height - 1, 10, 10);
    } finally {
      g.dispose();
    }
  }