Package java.awt

Examples of java.awt.Graphics2D.drawOval()


        g.drawRect(width / 2 - 3, width / 2 - 3, width / 2 + 6, 3 * width / 2 + 6);

        g.setColor(top);
        g.fillOval(width / 2, 1 * width / 2, radius, radius);
        g.setColor(Color.black);
        g.drawOval(width / 2, 1 * width / 2, radius, radius);

        g.setColor(middle);
        g.fillOval(width / 2, 2 * width / 2, radius, radius);
        g.setColor(Color.black);
        g.drawOval(width / 2, 2 * width / 2, radius, radius);
View Full Code Here


        g.drawOval(width / 2, 1 * width / 2, radius, radius);

        g.setColor(middle);
        g.fillOval(width / 2, 2 * width / 2, radius, radius);
        g.setColor(Color.black);
        g.drawOval(width / 2, 2 * width / 2, radius, radius);

        g.setColor(bottom);
        g.fillOval(width / 2, 3 * width / 2, radius, radius);
        g.setColor(Color.black);
        g.drawOval(width / 2, 3 * width / 2, radius, radius);
View Full Code Here

        g.drawOval(width / 2, 2 * width / 2, radius, radius);

        g.setColor(bottom);
        g.fillOval(width / 2, 3 * width / 2, radius, radius);
        g.setColor(Color.black);
        g.drawOval(width / 2, 3 * width / 2, radius, radius);
       
        return img;
    }

    @Override
View Full Code Here

           
            g.setStroke(new BasicStroke(2));
            g.setColor(Color.red);
            c.getTrace().forEach(v ->
                {Vector2D a = this.getPointInVisualization(v);
                g.drawOval((int) a.x - 3, (int) a.y - 3, 6, 6);});
        } catch (Exception e) {}
       
        return img;
    }
   
View Full Code Here

                g.setColor(Color.red);
                double height = 25;
                double width = 25;
                Vector2D agPos = ((AbstractEnvironment2D) this.currentEnv).getPointInVisualization(((AbstractEnvironment2D) this.currentEnv).getAgentPosition(this.markedAgentId));
                agPos.sub(new Vector2D(width / 2, height / 2));
                g.drawOval((int) agPos.x, (int) agPos.y, (int) (width), (int) (height));
               
                Polygon2D pol2D = ((AbstractEnvironment2D) this.currentEnv).getAgentShapeInVisualization(this.markedAgentId);
                Polygon pol = pol2D.toPol();
                g.setColor(Color.red);
                g.drawPolygon(pol);
View Full Code Here

                Polygon pol = pol2D.toPol();
                g.setColor(Color.red);
                g.drawPolygon(pol);
            } catch (Exception e) {
                try {
                    g.drawOval(
                            (int) env.getPositionInVisualization(bester.id()).x - radius / 2,
                            (int) env.getPositionInVisualization(bester.id()).y - radius / 2,
                            radius,
                            radius);
                } catch (Exception e1) {}
View Full Code Here

                g.setColor(this.selectedColor);
                g.fillPolygon(pol);
                g.setColor(Color.red);
                g.drawPolygon(pol);
            } catch (Exception e) {
                g.drawOval(
                        xMitte,
                        yMitte,
                        radius,
                        radius);
            }
View Full Code Here

            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

    // gate line
    g.setColor(gate);
    if (type == TYPE_P) {
      g.drawLine(-20, m * 20, -20, m * 15);
      GraphicsUtil.switchToWidth(g, 1);
      g.drawOval(-22, m * 12 - 2, 4, 4);
    } else {
      g.drawLine(-20, m * 20, -20, m * 11);
      GraphicsUtil.switchToWidth(g, 1);
    }
   
View Full Code Here

    g.drawLine(29, 13, 29, 27);
   
    g.setColor(gate0);
    g.drawLine(20, 35, 20, 40);
    GraphicsUtil.switchToWidth(g, 1);
    g.drawOval(18, 30, 4, 4);
    g.drawLine(10, 30, 30, 30);
    GraphicsUtil.switchToWidth(g, Wire.WIDTH);

    g.setColor(gate1);
    g.drawLine(20, 9, 20, 0);
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.