Examples of Arrowhead


Examples of diva.canvas.connector.Arrowhead

        // Add the circle and arrowhead to it
        Blob blob = new Blob(a.getX(), a.getY(), a.getNormal(),
                Blob.BLOB_CIRCLE);
        connectorA.setTailEnd(blob);

        Arrowhead arrow = new Arrowhead(b.getX(), b.getY(), b.getNormal());
        connectorA.setHeadEnd(arrow);

        // Add it to the layer
        layer.add(connectorA);
View Full Code Here

Examples of diva.canvas.connector.Arrowhead

        Site b = target.getHeadSite(figureB, 0.0, 0.0);
        connectorA = new StraightConnector(a, b);
        layer.add(connectorA);

        // Add an arrowhead to it
        Arrowhead arrow = new Arrowhead(b.getX(), b.getY(), b.getNormal());
        connectorA.setHeadEnd(arrow);

        // Create the second connector with an arrowhead
        a = target.getTailSite(figureB, 0.0, 0.0);
        b = target.getHeadSite(figureC, 0.0, 0.0);
        connectorB = new ArcConnector(a, b);
        layer.add(connectorB);
        arrow = new Arrowhead(b.getX(), b.getY(), b.getNormal());
        connectorB.setHeadEnd(arrow);

        // Create the third connector with an arrowhead
        a = target.getTailSite(figureB, 0.0, 0.0);
        b = target.getHeadSite(figureC, 0.0, 0.0);
        connectorC = new ArcConnector(a, b);

        // Swap the direction
        connectorC.setAngle(-connectorC.getAngle());
        layer.add(connectorC);
        arrow = new Arrowhead(b.getX(), b.getY(), b.getNormal());
        connectorC.setHeadEnd(arrow);

        // Create a fourth connector with an arrowhead, which is a "self-loop"
        a = target.getTailSite(figureB, 0.0, 0.0);
        b = target.getHeadSite(figureB, 0.0, 0.0);
        connectorD = new ArcConnector(a, b);
        connectorD.setSelfLoop(true);

        // Swap the direction
        // connectorD.setAngle(-connectorD.getAngle());
        // connectorD.setAngle(-0.1);
        layer.add(connectorD);
        arrow = new Arrowhead(b.getX(), b.getY(), b.getNormal());
        connectorD.setHeadEnd(arrow);
    }
View Full Code Here

Examples of diva.canvas.connector.Arrowhead

            // WEST
            StraightTerminal west = new StraightTerminal();

            //Site connectWest = west.getConnectSite();
            Arrowhead arrowWest = new Arrowhead();
            west.setEnd(arrowWest);
            icon.addTerminal(west, SwingConstants.WEST, 50);

            // EAST
            StraightTerminal east = new StraightTerminal();

            //Site connectEast = east.getConnectSite();
            Arrowhead arrowEast = new Arrowhead();
            arrowEast.setFlipped(true);
            east.setEnd(arrowEast);
            icon.addTerminal(east, SwingConstants.EAST, 50);
        }
View Full Code Here

Examples of diva.canvas.connector.Arrowhead

        // WEST
        StraightTerminal west = new StraightTerminal(_geometry.getW());

        //Site connectWest = west.getConnectSite();
        Arrowhead arrowWest = new Arrowhead();
        west.setEnd(arrowWest);
        layer.add(west);

        // EAST
        StraightTerminal east = new StraightTerminal(_geometry.getE());

        //Site connectEast = east.getConnectSite();
        Arrowhead arrowEast = new Arrowhead();
        arrowEast.setFlipped(true);
        east.setEnd(arrowEast);
        layer.add(east);

        // Make sure it's clean now
        layer.repaint();
View Full Code Here

Examples of diva.canvas.connector.Arrowhead

            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

Examples of diva.canvas.connector.Arrowhead

    /** Render a visual representation of the given edge.
     */
    public Connector render(Object edge, Site tailSite, Site headSite) {
        // FIXME: Find a way to set the curvature (the third argument).
        ArcConnector c = new ArcConnector(tailSite, headSite);
        Arrowhead arrow = new Arrowhead(headSite.getX(), headSite.getY(),
                headSite.getNormal());
        c.setHeadEnd(arrow);

        Object p = "edge"; //edge.getProperty("label");
        String label = (p == null) ? "#" : (String) p;
View Full Code Here

Examples of diva.canvas.connector.Arrowhead

         */
        public Connector render(Object edge, Site tailSite, Site headSite) {
            StraightConnector c = new StraightConnector(tailSite, headSite);

            // Create an arrow at the head
            Arrowhead headArrow = new Arrowhead(headSite.getX(), headSite
                    .getY(), headSite.getNormal());
            c.setHeadEnd(headArrow);
            c.setUserObject(edge);
            return c;
        }
View Full Code Here

Examples of diva.canvas.connector.Arrowhead

         */
        public Connector render(Object edge, Site tailSite, Site headSite) {
            StraightConnector c = new StraightConnector(tailSite, headSite);

            // Create an arrow at the head
            Arrowhead headArrow = new Arrowhead(headSite.getX(), headSite
                    .getY(), headSite.getNormal());
            c.setHeadEnd(headArrow);

            // Create an arrow at the tail
            Arrowhead tailArrow = new Arrowhead(tailSite.getX(), tailSite
                    .getY(), tailSite.getNormal());
            c.setTailEnd(tailArrow);

            c.setUserObject(edge);
            return c;
View Full Code Here

Examples of diva.canvas.connector.Arrowhead

     */
    public class LinkRenderer implements EdgeRenderer {
        /** Render a visual representation of the given edge. */
        public Connector render(Object edge, Site tailSite, Site headSite) {
            ArcConnector c = new ArcConnector(tailSite, headSite);
            Arrowhead arrowhead = new Arrowhead();
            c.setHeadEnd(arrowhead);
            c.setLineWidth((float) 2.0);
            c.setUserObject(edge);

            Arc arc = (Arc) edge;
            Transition transition = (Transition) arc.getRelation();

            // When first dragging out a transition, the relation
            // may still be null.
            if (transition != null) {
                // Use a larger, unfilled arrowhead for a reset transition.
                try {
                    if (((BooleanToken) transition.reset.getToken())
                            .booleanValue()) {
                        arrowhead.setFilled(false);
                    }
                } catch (IllegalActionException e) {
                    // Ignore erroneous parameter value.
                }
                if (transition.isPreemptive()) {
View Full Code Here

Examples of diva.canvas.connector.Arrowhead

        // WEST
        StraightTerminal west = new StraightTerminal();

        //Site connectWest = west.getConnectSite();
        Arrowhead arrowWest = new Arrowhead();
        west.setEnd(arrowWest);
        iconFigure.addTerminal(west, SwingConstants.WEST, 50);

        // EAST
        StraightTerminal east = new StraightTerminal();

        //Site connectEast = east.getConnectSite();
        Arrowhead arrowEast = new Arrowhead();
        arrowEast.setFlipped(true);
        east.setEnd(arrowEast);
        iconFigure.addTerminal(east, SwingConstants.EAST, 50);

        // Make sure it's clean now
        layer.repaint();
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.