Package diva.canvas

Examples of diva.canvas.Figure.translate()


    /** Utility function to add the "ports" to the composite figure.
     */
    public void addPorts(CompositeFigure tc) {
        Figure p1 = new BasicEllipse(150.0, 100.0, 20.0, 20.0, Color.red);
        p1.translate(-10, -10);

        Figure p2 = new BasicEllipse(200.0, 150.0, 20.0, 20.0, Color.blue);
        p2.translate(-10, -10);

        Figure p3 = new BasicEllipse(150.0, 200.0, 20.0, 20.0, Color.yellow);
View Full Code Here


    public void addPorts(CompositeFigure tc) {
        Figure p1 = new BasicEllipse(150.0, 100.0, 20.0, 20.0, Color.red);
        p1.translate(-10, -10);

        Figure p2 = new BasicEllipse(200.0, 150.0, 20.0, 20.0, Color.blue);
        p2.translate(-10, -10);

        Figure p3 = new BasicEllipse(150.0, 200.0, 20.0, 20.0, Color.yellow);
        p3.translate(-10, -10);

        Figure p4 = new BasicEllipse(100.0, 150.0, 20.0, 20.0, Color.magenta);
View Full Code Here

        Figure p2 = new BasicEllipse(200.0, 150.0, 20.0, 20.0, Color.blue);
        p2.translate(-10, -10);

        Figure p3 = new BasicEllipse(150.0, 200.0, 20.0, 20.0, Color.yellow);
        p3.translate(-10, -10);

        Figure p4 = new BasicEllipse(100.0, 150.0, 20.0, 20.0, Color.magenta);
        p4.translate(-10, -10);

        tc.add(p1);
View Full Code Here

        Figure p3 = new BasicEllipse(150.0, 200.0, 20.0, 20.0, Color.yellow);
        p3.translate(-10, -10);

        Figure p4 = new BasicEllipse(100.0, 150.0, 20.0, 20.0, Color.magenta);
        p4.translate(-10, -10);

        tc.add(p1);
        tc.add(p2);
        tc.add(p3);
        tc.add(p4);
View Full Code Here

    public void translate(LayerEvent e, double x, double y) {
        Iterator i = targets();

        while (i.hasNext()) {
            Figure t = (Figure) i.next();
            t.translate(x, y);
        }
    }
}
View Full Code Here

     * Translate the figure associated with the given node in the
     * target's view by the given delta.
     */
    public void translate(Object node, double dx, double dy) {
        Figure f = _controller.getFigure(node);
        f.translate(dx, dy);
    }
}
View Full Code Here

                // FIXME: This isn't right for scaling canvases... so I
                // doubt it is right for composite nodes.
                // TransformContext tc = t.getParent().getTransformContext();
                // tc.getInverseTransform().deltaTransform(pt, localpt);
                //t.translate(localpt.x,localpt.y);
                t.translate(x, y);
            }
        }

        edgeSet.addAll(GraphUtilities.edgeSet(model.getRoot(), model));
View Full Code Here

                                - originalUpperLeftY;

                        if ((translationX != 0.0) || (translationY != 0.0)) {
                            // The translate method supposedly handles the required
                            // repaint.
                            figure.translate(translationX, translationY);

                            // Reroute edges linked to this figure.
                            GraphModel model = getGraphModel();
                            Object userObject = figure.getUserObject();
View Full Code Here

                // Note that we don't use CanvasUtilities.translateTo because
                // we want to only get the bounds of the background of the
                // port figure.
                double x = site.getX() - portBounds.getCenterX();
                double y = site.getY() - portBounds.getCenterY();
                portFigure.translate(x, y);

                // If the actor contains a variable named "_showRate",
                // with value true, then visualize the rate information.
                // NOTE: Showing rates only makes sense for IOPorts.
                Attribute showRateAttribute = port.getAttribute("_showRate");
View Full Code Here

        if (_slaves != null) {
            ListIterator it = _slaves.listIterator(0);
            while (it.hasNext()) {
                Figure fig = (Figure) it.next();
                fig.translate(x, y);
            }
        }
    }

    /**
 
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.