Package org.asem.eclipse.mii.model.abs

Examples of org.asem.eclipse.mii.model.abs.Connection


        if (newSource != null && !((IShape)newSource).canConnectTo(oldTarget))
            return false;

    // return false, if the connection exists already
    for (Iterator iter = newSource.getSourceConnections().iterator(); iter.hasNext();) {
      Connection conn = (Connection) iter.next();
      // return false if a newSource -> oldTarget connection exists
      // already
      // and it is a different instance than the connection-field
      if (conn.getTarget().equals(oldTarget) && !conn.equals(connection)) {
        return false;
      }
    }
    return true;
  }
View Full Code Here


            return false;
   
    // return false, if the connection exists already
    for (Iterator iter = newTarget.getTargetConnections().iterator(); iter
        .hasNext();) {
      Connection conn = (Connection) iter.next();
      // return false if a oldSource -> newTarget connection exists
      // already
      // and it is a differenct instance that the connection-field
      if (conn.getSource().equals(oldSource) && !conn.equals(connection)) {
        return false;
      }
    }
    return true;
  }
View Full Code Here

        if (source != null && !((IShape)source).canConnectTo(target))
            return false;

        // return false, if the source -> target connection exists already
        for (Iterator iter = source.getSourceConnections().iterator(); iter.hasNext();) {
            Connection conn = (Connection) iter.next();
            if (conn.getTarget().equals(target)) {
                return false;
            }
        }

        return true;
View Full Code Here

     *
     * @see org.eclipse.gef.commands.Command#execute()
     */
    public void execute() {
        // create a new connection between source and target
        connection = new Connection(source, target);
        // use the supplied line style
        connection.setLineStyle(lineStyle);
    }
View Full Code Here

             *
             * @see org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy# getReconnectSourceCommand
             * (org.eclipse.gef.requests.ReconnectRequest)
             */
            protected Command getReconnectSourceCommand(ReconnectRequest request) {
                Connection conn = (Connection) request.getConnectionEditPart().getModel();
                AbstractModelShape newSource = (AbstractModelShape) getHost().getModel();
                ConnectionReconnectCommand cmd = new ConnectionReconnectCommand(conn);
                cmd.setNewSource(newSource);
                return cmd;
            }

            /*
             * (non-Javadoc)
             *
             * @see org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy# getReconnectTargetCommand
             * (org.eclipse.gef.requests.ReconnectRequest)
             */
            protected Command getReconnectTargetCommand(ReconnectRequest request) {
                Connection conn = (Connection) request.getConnectionEditPart().getModel();
                AbstractModelShape newTarget = (AbstractModelShape) getHost().getModel();
                ConnectionReconnectCommand cmd = new ConnectionReconnectCommand(conn);
                cmd.setNewTarget(newTarget);
                return cmd;
            }
View Full Code Here

     * @param connections
     *            a non-null List of connections
     */
    private void addConnections(List connections) {
        for (Iterator iter = connections.iterator(); iter.hasNext();) {
            Connection conn = (Connection) iter.next();
            conn.reconnect();
        }
    }
View Full Code Here

     * @param connections
     *            a non-null List of connections
     */
    private void removeConnections(List connections) {
        for (Iterator iter = connections.iterator(); iter.hasNext();) {
            Connection conn = (Connection) iter.next();
            conn.disconnect();
        }
    }
View Full Code Here

TOP

Related Classes of org.asem.eclipse.mii.model.abs.Connection

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.