Package java.awt

Examples of java.awt.Graphics2D.clearRect()


    // Todo ocurre si el circuito existe
    if (circuit != null) {

      // Limpiamos el fondo
      gr.setBackground(colorBackground);
      gr.clearRect(0, 0, d.width, d.height);

      // Dibujamos la grilla
      if (showGrid)
        drawGrid(gr);
View Full Code Here


    } else {

      // Limpiamos el fondo con otro color

      gr.setBackground(colorNullCircuit);
      gr.clearRect(0, 0, d.width, d.height);
    }
  }

  /**
   * Cambia el color de fondo del canvas Creation date: (15/10/01 13:16:05)
View Full Code Here

  public void paint(java.awt.Graphics gr1d) {
    Graphics2D gr = (Graphics2D) gr1d;

    // Limpio el fondo
    gr.setBackground(Color.gray);
    gr.clearRect(0, 0, getSize().width, getSize().height);

    // Dibujo la regla
    gr.setColor(new Color(180, 180, 180));
    gr.drawLine(20, 5, getSize().width, 5);
    for (int i = 20; i < getSize().width; i += 5)
View Full Code Here

            setRenderingHintsForBufferedImage(g2d);
           
            g2d.setBackground(Color.white);
            g2d.setColor(Color.black);
            if (!withAlpha) {
                g2d.clearRect(0, 0, bmw, bmh);
            }
            /* debug code
            int off = 2;
            g2d.drawLine(off, 0, off, bmh);
            g2d.drawLine(bmw - off, 0, bmw - off, bmh);
View Full Code Here

        gfx.setStroke(new BasicStroke(size / 40f, BasicStroke.CAP_ROUND,
                BasicStroke.JOIN_ROUND));

        gfx.setColor(Color.BLACK);
        gfx.setBackground(Color.WHITE);
        gfx.clearRect(0, 0, size, size);

        int b = size / 30;
        gfx.drawOval(b, b, size - 1 - 2 * b, size - 1 - 2 * b);

        int esz = size / 7;
View Full Code Here

            setRenderingHintsForBufferedImage(g2d);
           
            g2d.setBackground(Color.white);
            g2d.setColor(Color.black);
            if (!withAlpha) {
                g2d.clearRect(0, 0, bmw, bmh);
            }
            /* debug code
            int off = 2;
            g2d.drawLine(off, 0, off, bmh);
            g2d.drawLine(bmw - off, 0, bmw - off, bmh);
View Full Code Here

                        RenderingHints.VALUE_TEXT_ANTIALIAS_ON );

        graphics2D.setBackground( new Color( 233, 233, 166 ) );

        graphics2D.setColor( Color.BLACK );
        graphics2D.clearRect( 0, 0, bufferedImage.getWidth(), bufferedImage.getHeight() );
        graphics2D.setStroke( new BasicStroke( 2.0f ) );
        graphics2D.drawRect( 0, 0, bufferedImage.getWidth(), bufferedImage.getHeight() );

        Font font = new Font( "Arial Unicode MS", Font.BOLD, 40 );
        FontRenderContext fontRenderContext = graphics2D.getFontRenderContext();
View Full Code Here

        gfx.setStroke(new BasicStroke(size / 40f, BasicStroke.CAP_ROUND,
                BasicStroke.JOIN_ROUND));

        gfx.setColor(Color.BLACK);
        gfx.setBackground(Color.WHITE);
        gfx.clearRect(0, 0, size, size);

        int b = size / 30;
        gfx.drawOval(b, b, size - 1 - 2 * b, size - 1 - 2 * b);

        int esz = size / 7;
View Full Code Here

        Graphics2D graphics = image.createGraphics();

        // Background
        final Color background = new Color(226, 226, 222);
        graphics.setBackground(background);
        graphics.clearRect(0, 0, bounds.width, bounds.height);

        paintComponent(graphics);

        return image;
    }
View Full Code Here

    public TilingPatternExample() {
        //Created TexturePaint instance
        this.tile = new BufferedImage(40, 20, BufferedImage.TYPE_INT_RGB);
        Graphics2D tileg2d = tile.createGraphics();
        tileg2d.setBackground(Color.WHITE);
        tileg2d.clearRect(0, 0, tile.getWidth(), tile.getHeight());
        tileg2d.setColor(Color.BLUE);
        tileg2d.fillOval(2, 2, tile.getWidth() - 2, tile.getHeight() - 2);
        tileg2d.dispose();
        Rectangle2D rect = new Rectangle2D.Double(
                2, 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.