Package java.awt

Examples of java.awt.Graphics2D.fillRoundRect()


            }
            else {
                GradientPaint gp = new GradientPaint(new Point(0, 0), new Color(0, 0, 0, 42), new Point(0, bh), new Color(0, 0, 0, 0));
                g2.setPaint(gp);
                g2.fillRoundRect(0, 0, bw - 1, bh + roundDiameter, roundDiameter, roundDiameter);
                g2.drawRoundRect(0, 1, bw - 2, bh + roundDiameter, roundDiameter, roundDiameter);
                GradientPaint gp1 = new GradientPaint(new Point(0, 0), new Color(96, 96, 96), new Point(0, bh), new Color(0, 0, 0, 0));
                g2.setPaint(gp1);
                g2.drawRoundRect(0, 0, bw - 2, bh + roundDiameter, roundDiameter, roundDiameter);
            }
View Full Code Here


    Graphics2D g2 = (Graphics2D) g;

    if(halloAlpha==32){
      g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
      g2.setPaint(hallo32);
      g2.fillRoundRect(0, 0, this.getWidth(), this.getHeight(), roundDiameter, roundDiameter);
    }
    super.paintComponent(g);
  }

  private void jbInit() throws Exception {
View Full Code Here

    g.setColor(Color.GREEN);
    Graphics2D g2d = (Graphics2D) g;
    AlphaComposite myAlpha = AlphaComposite.getInstance(
        AlphaComposite.SRC_OVER, 0.22f);
    g2d.setComposite(myAlpha);
    g2d.fillRoundRect(30, 100, Core.WIDTH - 60, 100, 20, 20);
    AlphaComposite noAlpha = AlphaComposite.getInstance(
        AlphaComposite.SRC_OVER, 1.0f);
    g2d.setComposite(noAlpha);
   
   
View Full Code Here

        // draw shadow shape
        Graphics2D g2 = (Graphics2D)img1.getGraphics();
        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                RenderingHints.VALUE_ANTIALIAS_ON);
        g2.setColor(color);
        g2.fillRoundRect(2,0,26,26,RADIUS,RADIUS);
        g2.dispose();
        // draw shadow
        InnerShadowEffect effect = new InnerShadowEffect();
        effect.setDistance(1);
        effect.setSize(3);
View Full Code Here

      Graphics g = image[i].getGraphics();
      Graphics2D g2d = (Graphics2D) g;
      g2d.setBackground(Color.WHITE);
      g2d.fillRect(0, 0, 16, 16);
      g2d.setColor(Color.LIGHT_GRAY);
      g2d.fillRoundRect(2, 2, 11, 11, 5, 5);
      g2d.setColor(Color.DARK_GRAY);
      g2d.drawRoundRect(2, 2, 11, 11, 5, 5);
      int count = 0;
      for (int y = 4; y < 12; y += 3) {
        for (int x = 4; x < 12; x += 3) {
View Full Code Here

      Graphics g = image[i].getGraphics();
      Graphics2D g2d = (Graphics2D) g;
      g2d.setBackground(Color.WHITE);
      g2d.fillRect(0, 0, 16, 16);
      g2d.setColor(Color.LIGHT_GRAY);
      g2d.fillRoundRect(2, 2, 11, 11, 5, 5);
      g2d.setColor(Color.DARK_GRAY);
      g2d.drawRoundRect(2, 2, 11, 11, 5, 5);
      int count = 0;
      for (int y = 4; y < 12; y += 3) {
        for (int x = 4; x < 12; x += 3) {
View Full Code Here

    }
   
    //for debug repainting
    //g2d.setColor(new Color(MyRandom.random.nextInt(255),MyRandom.random.nextInt(255),MyRandom.random.nextInt(255),150));
    int cornerSize = Math.max(4, Math.round(cardWidth * ROUNDED_CORNER_SIZE));
    g2d.fillRoundRect(cardXOffset, cardYOffset, cardWidth, cardHeight, cornerSize, cornerSize);
    if (isSelected) {
      //g2d.setColor(new Color(0,250,0,200));
      g2d.setColor(new Color(200,120,40,200));
      g2d.fillRoundRect(cardXOffset+1, cardYOffset+1, cardWidth-2, cardHeight-2, cornerSize, cornerSize);
    }
View Full Code Here

    int cornerSize = Math.max(4, Math.round(cardWidth * ROUNDED_CORNER_SIZE));
    g2d.fillRoundRect(cardXOffset, cardYOffset, cardWidth, cardHeight, cornerSize, cornerSize);
    if (isSelected) {
      //g2d.setColor(new Color(0,250,0,200));
      g2d.setColor(new Color(200,120,40,200));
      g2d.fillRoundRect(cardXOffset+1, cardYOffset+1, cardWidth-2, cardHeight-2, cornerSize, cornerSize);
    }
   
    //TODO:uncomment
    /*
    if (gameCard.isAttacking()) {
View Full Code Here

        g2D.setColor(color);
        g2D.fill(new Ellipse2D.Double(ball.getxPos() * xE, ball.getyPos() * yE, xE, yE));

        if(laser){
            g2D.setColor(Color.ORANGE);
          g2D.fillRoundRect(
              (int) (ball.getxPos() * xE + xE / 2 - 5 ),
              0,
              10,
              (int) (yE * (mechanics.getHeight() - 1)), 5, 40);
          laser = false;
View Full Code Here

          laser = false;
        }
       
        if (!showString.equals("")) {
            g2D.setColor(Color.WHITE);
            g2D.fillRoundRect(7, (getHeight() / 2)-20, getWidth() - 17, 25, 10, 10);
           
            g2D.setColor(Color.BLACK);
            g2D.setFont(new Font("Arial", Font.BOLD, 20));
            g2D.drawString(showString, 12, getHeight() / 2);
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.