Package diva.canvas.connector

Examples of diva.canvas.connector.StraightTerminal


     */
    public void createTerminals(IconFigure iconFigure) {
        FigureLayer layer = graphicsPane.getForegroundLayer();

        // NORTH
        StraightTerminal north = new StraightTerminal();

        //Site connectNorth = north.getConnectSite();
        Blob blobNorth = new Blob();
        blobNorth.setSizeUnit(5.0);
        north.setEnd(blobNorth);
        iconFigure.addTerminal(north, SwingConstants.NORTH, 50);

        // SOUTH
        StraightTerminal south = new StraightTerminal();

        //Site connectSouth = south.getConnectSite();
        Blob blobSouth = new Blob();
        blobSouth.setStyle(Blob.BLOB_DIAMOND);
        blobSouth.setSizeUnit(5.0);
        blobSouth.setFilled(false);
        south.setEnd(blobSouth);
        iconFigure.addTerminal(south, SwingConstants.SOUTH, 50);

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


        /** Create a collection of terminals an an icon
         */
        public void createTerminals(IconFigure icon) {
            // NORTH
            StraightTerminal north = new StraightTerminal();

            //Site connectNorth = north.getConnectSite();
            Blob blobNorth = new Blob();
            blobNorth.setSizeUnit(5.0);
            north.setEnd(blobNorth);
            icon.addTerminal(north, SwingConstants.NORTH, 50);

            // SOUTH
            StraightTerminal south = new StraightTerminal();

            //Site connectSouth = south.getConnectSite();
            Blob blobSouth = new Blob();
            blobSouth.setStyle(Blob.BLOB_DIAMOND);
            blobSouth.setSizeUnit(5.0);
            blobSouth.setFilled(false);
            south.setEnd(blobSouth);
            icon.addTerminal(south, SwingConstants.SOUTH, 50);

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

        BoundsGeometry _geometry = new BoundsGeometry(square, square
                .getBounds());

        // Create a set of terminals, one by one
        // NORTH
        StraightTerminal north = new StraightTerminal(_geometry.getN());

        //Site connectNorth = north.getConnectSite();
        Blob blobNorth = new Blob();
        blobNorth.setSizeUnit(5.0);
        north.setEnd(blobNorth);
        layer.add(north);

        // SOUTH
        StraightTerminal south = new StraightTerminal(_geometry.getS());

        //Site connectSouth = south.getConnectSite();
        Blob blobSouth = new Blob();
        blobSouth.setStyle(Blob.BLOB_DIAMOND);
        blobSouth.setSizeUnit(5.0);
        blobSouth.setFilled(false);
        south.setEnd(blobSouth);
        layer.add(south);

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

TOP

Related Classes of diva.canvas.connector.StraightTerminal

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.