Package diva.canvas.connector

Examples of diva.canvas.connector.AbstractConnector


public class BasicEdgeRenderer implements EdgeRenderer {
    /**
     * Render a visual representation of the given edge.
     */
    public Connector render(Object edge, Site tailSite, Site headSite) {
        AbstractConnector c;
        Figure tf = tailSite.getFigure();
        Figure hf = headSite.getFigure();

        //if the edge is a self loop, create an ArcConnector instead!
        if ((tf != null) && (hf != null) && (tf == hf)) {
            c = new ArcConnector(tailSite, headSite);
        } else {
            c = new StraightConnector(tailSite, headSite);
        }

        Arrowhead arrow = new Arrowhead(headSite.getX(), headSite.getY(),
                headSite.getNormal());
        c.setHeadEnd(arrow);
        return c;
    }
View Full Code Here

TOP

Related Classes of diva.canvas.connector.AbstractConnector

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.