Package java.awt

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.
        String name = this.node.getName(); // + this.node.getID();
View Full Code Here


                break;

            case MULTIPLE:
                g2d.fillRect(0, 0, w/2, h/2);
                g2d.fillOval(w/2, 0, w/2, h/2);
                g2d.drawOval(0, h/2, w/2, h/2);
                g2d.drawLine(0, h/2, w/2, h);
                g2d.drawLine(0, h, w/2, h/2);
                Polygon p = new Polygon();
                p.addPoint(w/2, h);
                p.addPoint(w, h);
View Full Code Here

        for (int radius = 1; radius < sz/2; radius += sz/7) {
            if (((hash>>>=1) & 1) != 0) {
                if (radius < 3) {
                    g.fillOval(sz/2-1, sz/2-1, 3, 3);
                } else {
                    g.drawOval(sz/2-radius, sz/2-radius, radius*2, radius*2);
                }
            }
        }

        // Draw concentric Squares
View Full Code Here

    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

        BufferedImage bi = new BufferedImage(800,600,BufferedImage.TYPE_3BYTE_BGR);
        Graphics2D g2 = (Graphics2D)(bi.getGraphics());
        g2.setColor(Color.RED);
        g2.fillRect(200,100,600,500);
        g2.setColor(Color.GREEN);
        g2.drawOval(500,300,100,100);
        Image i = null;
        try{
            File f = new File("test.jpg");
            f.createNewFile();
            ImageIO.write(bi, "jpg", f);
View Full Code Here

    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

    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

              int xc = 20;
              int yc = 22;
              int r = 15;

              g.setStroke(new BasicStroke(2.5f));
              g.drawOval(xc - r, yc - r, 2 * r, 2 * r);
              g.setStroke(new BasicStroke(4.0f));
              GeneralPath handle = new GeneralPath();
              handle.moveTo((float) (xc + r / Math.sqrt(2.0)),
                  (float) (yc + r / Math.sqrt(2.0)));
              handle.lineTo(45, 47);
View Full Code Here

      gr.setColor(co);
      if (!c.isEnabled()) {
        gr.setColor(Colors.getIntermediateColor(co, c.getBackground()));
      }
      gr.setStroke(new BasicStroke(1.2f));
      gr.drawOval(x + 2, y + 2, 12, 12);
      gr.setStroke(new BasicStroke(1.5f));

      switch (getExpandingDirection()) {
      case NORTH:
      case WEST:
View Full Code Here

        Rectangle rect = frame.properRectangle();
        g.drawRect(toScreen(rect.x), toScreen(rect.y), toScreen(rect.width), toScreen(rect.height));
        g.drawString(frame.getName(), toScreen(rect.x), toScreen(rect.y)+10);
        Point pivot = frame.getPivot();
        int r = 5;
        g.drawOval(toScreen(pivot.x-r), toScreen(pivot.y-r), toScreen(2*r), toScreen(2*r));
        Point offset = frame.getOffset();
        if(!offset.equals(new Point(0,0))) {
          Point vector = toScreen(offset);
          Point base = toScreen(new Point(pivot.x-offset.x,pivot.y-offset.y));
          g.setColor(Color.YELLOW);
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.