Examples of PPath


Examples of edu.umd.cs.piccolo.nodes.PPath

    BufferedImage img = loggedScreenRegion.capture();
    ImageRenderer ir = new LogImageRenderer(img){

      @Override
      protected void addContent(PLayer layer) {
        PPath c = PPath.createEllipse(0, 0, 10,10);
        c.setPaint(Color.red);
        c.setOffset(location.getX() - loggedScreenRegion.getBounds().getX() - 5, location.getY() - loggedScreenRegion.getBounds().getY() - 5);
        layer.addChild(c);
       
        addTextLabel(layer, actionName,location.getX() - loggedScreenRegion.getBounds().x - 20, location.getY() - loggedScreenRegion.getBounds().y - 40);
        addNodeWithShadow(layer, c);
      }     
View Full Code Here

Examples of edu.umd.cs.piccolo.nodes.PPath

      t.setOffset(x,y);
      addNodeWithShadow(parent, t);   
    }

    void addRectangle(PNode parent, int x, int y, int width, int height, Color color){
      PPath r = PPath.createRectangle(x, y, width, height);
      r.setStrokePaint(color);
      r.setStroke(new BasicStroke(2f));
      r.setPaint(null)
     
      addNodeWithShadow(parent, r);
    }
View Full Code Here

Examples of org.piccolo2d.nodes.PPath

            ConvexHullGenerator2D generator = new MonotoneChain(true, 1e-6);
            ConvexHull2D hull = generator.generate(points); //AklToussaintHeuristic.reducePoints(points));

            PNode hullNode = new PNode();
            for (Vector2D vertex : hull.getVertices()) {
                final PPath node = PPath.createEllipse(vertex.getX() - 1, vertex.getY() - 1, 2, 2);
                node.addAttribute("tooltip", vertex);
                node.setPaint(Color.red);
                node.setStrokePaint(Color.red);
                hullNode.addChild(node);
            }

            for (Segment line : hull.getLineSegments()) {
                final PPath node = PPath.createLine(line.getStart().getX(), line.getStart().getY(),
                                                    line.getEnd().getX(), line.getEnd().getY());
                node.setPickable(false);
                node.setPaint(Color.red);
                node.setStrokePaint(Color.red);
                hullNode.addChild(node);
            }

            canvas.getLayer().addChild(hullNode);

            Encloser<Euclidean2D, Vector2D> encloser =
                    new WelzlEncloser<Euclidean2D, Vector2D>(1e-10, new DiskGenerator());
            EnclosingBall<Euclidean2D, Vector2D> ball = encloser.enclose(points);

            final double radius = ball.getRadius();
            PPath ballCenter =
                    PPath.createEllipse(ball.getCenter().getX() - 1, ball.getCenter().getY() - 1, 2, 2);
            ballCenter.setStrokePaint(Color.blue);
            ballCenter.setPaint(Color.blue);
            canvas.getLayer().addChild(0, ballCenter);

            PPath ballNode =
                    PPath.createEllipse(ball.getCenter().getX() - radius, ball.getCenter().getY() - radius,
                                        radius * 2, radius * 2);
            ballNode.setTransparency(1.0f);
            ballNode.setStrokePaint(Color.blue);
            canvas.getLayer().addChild(0, ballNode);
        }
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.