Package org.drools.eclipse.flow.common.editor.core

Examples of org.drools.eclipse.flow.common.editor.core.ElementConnection


        return ((PolylineConnection) ((ElementConnectionEditPart) getHost()).getFigure());
    }

    protected Command getDeleteCommand(GroupRequest request) {
        DeleteConnectionCommand cmd = new DeleteConnectionCommand();
        ElementConnection connection = (ElementConnection) getHost().getModel();
        cmd.setAntecedentTaskConnection(connection);
        cmd.setSource(connection.getSource());
        cmd.setTarget(connection.getTarget());
        return cmd;
    }
View Full Code Here


        if (connection.getTarget().equals(newSource))
            return false;
           
        List connections = newSource.getOutgoingConnections();
        for (int i = 0; i < connections.size(); i++) {
            ElementConnection connection = ((ElementConnection)(connections.get(i)));
            if (connection.getTarget().equals(target) && !connection.getSource().equals(oldSource))
                return false;
        }
        return newSource.acceptsOutgoingConnection(connection, target); //XXX   
    }
View Full Code Here

    private List outgoingConnections = new ArrayList();
   
   
    private void deleteConnections(ElementWrapper element) {
        for (Iterator it = element.getIncomingConnections().iterator(); it.hasNext(); ) {
            ElementConnection connection = (ElementConnection) it.next();
            incomingElementWrappers.add(connection.getSource());
            incomingConnections.add(connection);
        }
        for (Iterator it = element.getOutgoingConnections().iterator(); it.hasNext(); ) {
            ElementConnection connection = (ElementConnection) it.next();
            outgoingElementWrappers.add(connection.getTarget());
            outgoingConnections.add(connection);
        }
        for (Iterator it = incomingConnections.iterator(); it.hasNext(); ) {
            ElementConnection connection = (ElementConnection) it.next();
            connection.disconnect();
        }
        for (Iterator it = outgoingConnections.iterator(); it.hasNext(); ) {
            ElementConnection connection = (ElementConnection) it.next();
            connection.disconnect();
        }
    }
View Full Code Here

    }

    private void restoreConnections() {
        int i = 0;
        for (Iterator it = incomingConnections.iterator(); it.hasNext(); ) {
            ElementConnection connection = (ElementConnection) it.next();
            connection.connect((ElementWrapper) incomingElementWrappers.get(i), child);
            i++;
        }
        i = 0;
        for (Iterator it = outgoingConnections.iterator(); it.hasNext(); ) {
            ElementConnection connection = (ElementConnection) it.next();
            connection.connect(child, (ElementWrapper) outgoingElementWrappers.get(i));
            i++;
        }
        incomingConnections.clear();
        incomingElementWrappers.clear();
        outgoingConnections.clear();
View Full Code Here

        if (connection.getSource().equals(newTarget))
            return false;
           
        List connections = newTarget.getIncomingConnections();
        for (Iterator it = connections.iterator(); it.hasNext(); ) {
            ElementConnection connection = (ElementConnection) it.next();
            if (connection.getSource().equals(source) && !connection.getTarget().equals(oldTarget))
                return false;
        }
        return newTarget.acceptsIncomingConnection(connection, source);
    }
View Full Code Here

        }
       
        // Check for existence of connection already
        List connections = source.getOutgoingConnections();
        for (Iterator it = connections.iterator(); it.hasNext(); ) {
            ElementConnection conn = (ElementConnection) it.next();
            if (conn.getTarget().equals(target)) {
                return false;
            }
        }
        return source.acceptsOutgoingConnection(connection, target)
            && target != null && target.acceptsIncomingConnection(connection, source);
View Full Code Here

TOP

Related Classes of org.drools.eclipse.flow.common.editor.core.ElementConnection

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.