Package java.awt

Examples of java.awt.Graphics2D.drawPolygon()


            pol.add(new Vector2D(c.getTargetLocation()).add(new Vector2D(-0.5, 0.5)));
            pol.add(new Vector2D(c.getTargetLocation()).add(new Vector2D(-0.5, -0.5)));
            pol.add(new Vector2D(c.getTargetLocation()).add(new Vector2D(0.5, -0.5)));
            g.setStroke(new BasicStroke(5));
           
            g.drawPolygon(this.getPolygonInVisualization(pol).toPol());
           
            g.setStroke(new BasicStroke(2));
            g.setColor(Color.red);
            c.getTrace().forEach(v ->
                {Vector2D a = this.getPointInVisualization(v);
View Full Code Here


                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);
            } catch (Exception e) {
                try {
                    g.drawOval(
                            (int) env.getPositionInVisualization(bester.id()).x - radius / 2,
                            (int) env.getPositionInVisualization(bester.id()).y - radius / 2,
View Full Code Here

            try {
                Polygon pol = ((AbstractEnvironment2D) this.currentEnv).getAgentShapeInVisualization(this.markedAgentId).toPol();
                g.setColor(this.selectedColor);
                g.fillPolygon(pol);
                g.setColor(Color.red);
                g.drawPolygon(pol);
            } catch (Exception e) {
                g.drawOval(
                        xMitte,
                        yMitte,
                        radius,
View Full Code Here

    GraphicsUtil.switchToWidth(g, 1);
    if (!isGhost && painter.shouldDrawColor()) {
      BitWidth width = painter.getAttributeValue(StdAttr.WIDTH);
      g.setColor(Value.repeat(Value.TRUE, width.getWidth()).getColor());
    }
    g.drawPolygon(new int[] { 6, 14, 6 }, new int[] { -8, 0, 8 }, 3);

    g.dispose();
  }
}
View Full Code Here

        //external border of perimetral wall
        final BasicStroke stroke4 =
                new BasicStroke(PERIMETRAL_WALLS_TICKNESS, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_MITER);
        g2.setStroke(stroke4);
        getContext().setColor(PERIMETRAL_WALLS_COLOR_LIGHT);
        g2.drawPolygon(poly);

        //center of perimetral wall
        final BasicStroke stroke =
                new BasicStroke(PERIMETRAL_WALLS_TICKNESS / 10, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_MITER);
        g2.setStroke(stroke);
View Full Code Here

                new BasicStroke(PERIMETRAL_WALLS_TICKNESS / 10, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_MITER);
        g2.setStroke(stroke);

        //internal of perimetral wall
        getContext().setColor(PERIMETRAL_WALLS_COLOR);
        g2.drawPolygon(poly);

        final BasicStroke stroke2 =
                new BasicStroke(PERIMETRAL_WALLS_TICKNESS / 4, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_MITER);
        g2.setStroke(stroke2);
        getContext().setColor(PERIMETRAL_WALLS_COLOR_DARK);
View Full Code Here

        final BasicStroke stroke2 =
                new BasicStroke(PERIMETRAL_WALLS_TICKNESS / 4, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_MITER);
        g2.setStroke(stroke2);
        getContext().setColor(PERIMETRAL_WALLS_COLOR_DARK);
        g2.drawPolygon(poly);

        g2.setStroke(new BasicStroke()); //reset to default stroke
    }

    @Override
View Full Code Here

        g2.draw(poly);

        Color walls = INTERNAL_WALLS_COLOR;
        getContext().setColor(walls);

        g2.drawPolygon(poly);

        final BasicStroke stroke2 =
                new BasicStroke(INTERNAL_WALLS_TICKNESS, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_MITER);
        g2.setStroke(stroke2);
View Full Code Here

                new BasicStroke(INTERNAL_WALLS_TICKNESS, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_MITER);
        g2.setStroke(stroke2);

        Color walls2 = INTERNAL_WALLS_COLOR_DARK;
        getContext().setColor(walls2);
        g2.drawPolygon(poly);

        g2.setStroke(new BasicStroke()); //reset to default stroke
    }

    protected void drawPlainObject(EnvObjectLogic obj) {
View Full Code Here

                for (int index = 0; index < wcopy.npoints; index++) {

                    wcopy.xpoints[index] = (int) (r.xpoints[index] * scale + tx);
                    wcopy.ypoints[index] = (int) (r.ypoints[index] * scale + ty);
                }
                g2.drawPolygon(wcopy);
                g2.setColor(riverborder);
                g2.fillPolygon(wcopy);
            }

            Graphics2D g3 = (Graphics2D) g;
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.