Examples of drawOval()


Examples of java.awt.Graphics2D.drawOval()

            g.setColor(circleColor);
            for (int i = 0; i < circlesToDraw; i++) {
                int circleRadius = (int) (Math.random() * height / 2.0);
                int circleX = (int) (Math.random() * width - circleRadius);
                int circleY = (int) (Math.random() * height - circleRadius);
                g.drawOval(circleX, circleY, circleRadius * 2, circleRadius * 2);
            }
            g.setColor(textColor);
            g.setFont(textFont);

            FontMetrics fontMetrics = g.getFontMetrics();
View Full Code Here

Examples of java.awt.Graphics2D.drawOval()

                        Graphics2D g2 = (Graphics2D) g;
                        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
                        g2.setColor(c);
                        g2.fillOval(2, 2, 12, 12);
                        g2.setColor(Color.BLACK);
                        g2.drawOval(2, 2, 12, 12);
                    }

                    @Override
                    public int getIconWidth() {
                        return 16;
View Full Code Here

Examples of java.awt.Graphics2D.drawOval()

      g2.translate( x + 0.5f, y + 0.5f )// +0.5 = "smoother"
      g2.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON );
            g2.setRenderingHint( RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE);
                    g2.setColor( color );
      g2.setStroke( strkOutside );
      g2.drawOval( 0, 0, 29, 29 );
      g2.setStroke( strkInside );
      g2.drawOval( 3, 3, 23, 23 );
      g2.draw( shpLine );

//      g2.translate( ctrlPt.getX(), ctrlPt.getY() );
View Full Code Here

Examples of java.awt.Graphics2D.drawOval()

            g2.setRenderingHint( RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE);
                    g2.setColor( color );
      g2.setStroke( strkOutside );
      g2.drawOval( 0, 0, 29, 29 );
      g2.setStroke( strkInside );
      g2.drawOval( 3, 3, 23, 23 );
      g2.draw( shpLine );

//      g2.translate( ctrlPt.getX(), ctrlPt.getY() );
      g2.translate( ctrlPt.getX() - 0.5f, ctrlPt.getY() - 0.5f );
      g2.setPaint( pntCtrl );
View Full Code Here

Examples of java.awt.Graphics2D.drawOval()

    // Now draw pure blue text and a pure red oval
    ig.setColor(Color.yellow);
    ig.drawString("CPE22", 9, 22);
    ig.setColor(Color.red);
    ig.drawOval(1, 1, 62, 32);

    // Finally, scale the image by a factor of 10 and display it
    // in the window. This will allow us to see the anti-aliased pixels
    g.drawImage(image, AffineTransform.getScaleInstance(10, 10), this);
View Full Code Here

Examples of java.awt.Graphics2D.drawOval()

    g.setColor(p.getRealColor());
    g.fillOval(20, 20, 8, 8);

    g.setColor(Color.BLACK);
    g.drawOval(20, 20, 8, 8);

    g.dispose();

    return new ImageIcon(img);
  }
View Full Code Here

Examples of java.awt.Graphics2D.drawOval()

      int x = randomInt(0, width / 2);
      int y = randomInt(0, height / 2);

      gfx.setXORMode(Color.BLACK);
      gfx.setStroke(new BasicStroke(randomInt(fontSize / 8, fontSize / 2)));
      gfx.drawOval(x, y, dx, dy);

      WritableRaster rstr = image.getRaster();
      int[] vColor = new int[3];
      int[] oldColor = new int[3];
      Random vRandom = new Random(System.currentTimeMillis());
View Full Code Here

Examples of java.awt.Graphics2D.drawOval()

      Vector2D middle = this.getPositionInVisualization(0);
      double radius = DomPhysAgent.MAX_ORBIT_ABSTAND + DomPhysMond.RADIUS;
      double imgAbstand = radius * this.globalScale();
      Graphics2D g = img.createGraphics();
      g.setColor(Color.red);
      g.drawOval(
              (int) (middle.x - imgAbstand),
              (int) (middle.y - imgAbstand),
              (int) (imgAbstand * 2),
              (int) (imgAbstand * 2));
     
View Full Code Here

Examples of java.awt.Graphics2D.drawOval()

    g.setPaint(gp);
    g.fillOval(position.x+2, position.y, this.dimension.height,
        this.dimension.height);
    g.setColor(Color.black);
        g.setStroke(new BasicStroke(1.2f));
        g.drawOval(position.x+2, position.y, this.dimension.height,
        this.dimension.height );
    // Text
    g.setColor(TEXT_COLOR);

    // XXX it's debatable if we should show the ID or the name.
View Full Code Here

Examples of java.awt.Graphics2D.drawOval()

                            (int) (kreis.holeRadius() * 2),
                            (int) (kreis.holeRadius() * 2));
                }
                if (rahmenDrucken) {
                    g2.setColor(rahmenFarbe);
                    g2.drawOval(
                            (int) (kreis.holeMitte().x - kreis.holeRadius()),
                            (int) (kreis.holeMitte().y - kreis.holeRadius()),
                            (int) (kreis.holeRadius() * 2),
                            (int) (kreis.holeRadius() * 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.