Package java.awt

Examples of java.awt.Graphics2D.fillRoundRect()


        }
        else {
          Graphics2D g2d = (Graphics2D)g;
          Object oldHint = g2d.getRenderingHint( RenderingHints.KEY_RENDERING );
          g2d.setRenderingHint( RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY );
          g2d.fillRoundRect( 0, 0, w, h, arc, arc );
          g2d.setRenderingHint( RenderingHints.KEY_RENDERING, oldHint );
        }
      }
    }
   
View Full Code Here


        else
          drawImage( g2d, shadow, shadowSize + distance + pad + insets.left, shadowSize + distance + pad + insets.top, d.width, d.height, null );   
      }
      else  if ( fillBorder ) {
        g2d.setColor( getBackground());
        g2d.fillRoundRect( insets.left, insets.top,
          componentSize.width - insets.left - insets.right,
          componentSize.height - insets.top - insets.bottom, arc, arc );
      }

      
View Full Code Here

   
    g2.translate( 3, 3 );
    if( (bg != null) && (bg.getAlpha() > 0) ) {
      g2.setColor( bg );
//      g2.fillRect( 0, 0, getWidth(), getHeight() );
      g2.fillRoundRect( 0, 0, w - 1, h - 1, 8, 8 ); // why -1 ?
    }
    g2.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF );
    g2.setRenderingHint( RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_SPEED );
    g2.drawImage( dragImg, 0, 0, dx1, dy1, sx1, 0, sx2, dy1, this );
    g2.drawImage( dragImg, dx1, 0, dx2, dy1, sx3, 0, sx4, dy1, this );
View Full Code Here

        }

        if (!fill.equals("transparent")) {
            graphics.setColor(ColorMapper.getColorByName(fill));
            if ((arcwidth != 0) || (archeight != 0)) {
                graphics.fillRoundRect(stroke_width, stroke_width,
                    width - (stroke_width * 2), height - (stroke_width * 2),
                    arcwidth, archeight);
            } else {
                graphics.fillRect(stroke_width, stroke_width,
                    width - (stroke_width * 2), height - (stroke_width * 2));
 
View Full Code Here

            endTest(print);
           
            // rrect-direct-fill
            startTest("rrect-direct-fill", n);
            for ( int i=0; i<n; ++i ) {
                g2.fillRoundRect(x,y,w,h,c,c);
            }
            endTest(print);
           
            // rrect-shape-fill
            rrect = new RoundRectangle2D.Float(xf,yf,wf,hf,cf,cf);
View Full Code Here

            if (infoLeft + infoWidth > width / this.scale - 100)
                infoLeft = (int) (width / this.scale) - 100 - infoWidth;

            // Render the sector info text
            g.setColor(new Color(255, 255, 255, 200));
            g.fillRoundRect(infoLeft, infoTop, infoWidth, infoHeight, 30, 30);
            textRenderer.render(g, infoLeft + borderX, infoTop + borderY);
        }

        graphics.setColor(Color.BLACK);
        graphics.fillRect(0, 0, getWidth(), getHeight());
View Full Code Here

                    offs1,Position.Bias.Backward,
                    bounds);
        Rectangle r = (shape instanceof Rectangle) ?
                (Rectangle)shape : shape.getBounds();
        if (roundedEdges) {
          g2d.fillRoundRect(r.x,r.y, r.width,r.height, ARCWIDTH,
                          ARCHEIGHT);
        }
        else {
          g2d.fillRect(r.x, r.y, r.width, r.height);
        }
View Full Code Here

            this.setOpaque(false);
            if(temp) {
              Graphics2D g2d = (Graphics2D)g;
              g2d.setColor(this.getBackground());
              g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
              g2d.fillRoundRect(0, 0, this.getWidth(), this.getHeight(), 10, 10);
            }
            super.paintComponent(g);
            this.setOpaque(temp);
          }
        };
View Full Code Here

            if (isEnlarged) {
                g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
                int radioButtonSize = 10;

                g.setColor(new Color(0, 0, 139, 179));
                g.fillRoundRect(0, 0, barWidth + shrinkImage.getIconWidth(), sources.length * LAYER_HEIGHT + TOP_PADDING + BOTTOM_PADDING, 10, 10);
                for (int i=0; i<sources.length; i++) {
                    g.setColor(Color.WHITE);
                    g.fillOval(LEFT_PADDING, TOP_PADDING + i * LAYER_HEIGHT + 6, radioButtonSize, radioButtonSize);
                    g.drawString(sources[i].getName(), LEFT_PADDING + radioButtonSize + LEFT_PADDING, TOP_PADDING + i * LAYER_HEIGHT + g.getFontMetrics().getHeight());
                    if (currentMap == i) {
View Full Code Here

        percent = (used * 100) / total;
      }
        g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
//        g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.6f));
        g2d.setColor(mouseOver ? new Color(freeSpaceUpperSelected.getRed() - 10, freeSpaceUpperSelected.getGreen() - 10, freeSpaceUpperSelected.getBlue() - 10) : freeSpaceUpperSelected);
      g2d.fillRoundRect(0, 0, getWidth(), getHeight()/2, arcHeight, arcHeight);
      g2d.fillRect(0, getHeight()/4, getWidth(), getHeight()/4);
      g2d.setColor(mouseOver ? new Color(freeSpaceLowerSelected.getRed() - 10, freeSpaceLowerSelected.getGreen() - 10, freeSpaceLowerSelected.getBlue() - 10) : freeSpaceLowerSelected);
      g2d.fillRoundRect(0, getHeight()/2, getWidth(), getHeight()/2, arcHeight, arcHeight);
      g2d.fillRect(0, getHeight() / 2, getWidth(), getHeight()/4);
      g2d.setColor(mouseOver ? new Color(occSpaceUpperSelected.getRed() - 10, occSpaceUpperSelected.getGreen() - 10, occSpaceUpperSelected.getBlue() - 10) : occSpaceUpperSelected);
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.