Package diva.canvas

Examples of diva.canvas.Figure


     * other useful predefined figure classes, is contained in the
     * package <b>diva.canvas.toolbox</b>.
     */
    public void createBasicRectangle() {
        FigureLayer layer = graphicsPane.getForegroundLayer();
        Figure rectangle = new BasicRectangle(50, 50, 80, 80, Color.blue);
        layer.add(rectangle);
    }
View Full Code Here


        path.moveTo(120, 240);
        path.lineTo(240, 240);
        path.quadTo(180, 120, 120, 240);
        path.closePath();

        Figure semi = new BasicFigure(path, Color.green);
        layer.add(semi);
    }
View Full Code Here

        path.lineTo(280, 180);
        path.lineTo(240, 200);
        path.lineTo(280, 220);
        path.lineTo(240, 240);

        Figure line = new BasicFigure(path);
        layer.add(line);
    }
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

    /**
     * Return the bounds of the figure associated with the given node
     * in the target's view.
     */
    public Rectangle2D getBounds(Object node) {
        Figure f = _controller.getFigure(node);
        return f.getBounds();
    }
View Full Code Here

    /**
     * Return whether or not the given node is actually
     * visible in the view.
     */
    public boolean isNodeVisible(Object node) {
        Figure nf = _controller.getFigure(node);
        return ((nf != null) && nf.isVisible() && (nf.getParent() != null));
    }
View Full Code Here

        final GraphModel model = _controller.getGraphModel();
        ZList zlist = getGraphicsPane().getForegroundLayer().getFigures();
        Iterator i = zlist.getIntersectedFigures(r).figuresFromFront();
        Iterator j = new FilteredIterator(i, new Filter() {
            public boolean accept(Object o) {
                Figure f = (Figure) o;
                return (model.isNode(f.getUserObject()));
            }
        });

        return new ProxyIterator(j) {
            public Object next() {
                Figure nf = (Figure) super.next();
                return nf.getUserObject();
            }
        };
    }
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

     * called when the object is in the model but does not yet have a
     * figure associated with it.
     */
    public Figure drawEdge(Object edge) {
        EdgeController ec = getEdgeController(edge);
        Figure f = ec.drawEdge(edge);
        return f;
    }
View Full Code Here

     * figure associated with it.  The location of the figure should be
     * set if some location is appropriate for it.
     */
    public Figure drawNode(Object node) {
        NodeController nc = getNodeController(node);
        Figure f = nc.drawNode(node);
        return f;
    }
View Full Code Here

TOP

Related Classes of diva.canvas.Figure

Copyright © 2018 www.massapicom. 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.