Package org.openbp.cockpit.modeler.figures.process

Examples of org.openbp.cockpit.modeler.figures.process.MultiSocketNodeFigure


      {
        Figure selection = fe.nextFigure();
        if (selection instanceof MultiSocketNodeFigure)
        {
          // Get the node figure to add the sockets to
          MultiSocketNodeFigure nodeFigure = (MultiSocketNodeFigure) selection;
          MultiSocketNode targetNode = (MultiSocketNode) nodeFigure.getNode();

          // Get the source node that contains the sockets
          ActivityNodeImpl node = (ActivityNodeImpl) source.getNodeByName("NodeDummy");

          workspaceView.clearSelection();

          // Add all sockets to the selected node
          List sockets = node.getSocketList();
          int n = sockets.size();
          for (int i = 0; i < n; ++i)
          {
            NodeSocket socket = (NodeSocket) sockets.get(i);

            socket = (NodeSocket) socket.clone();

            NamedObjectCollectionUtil.createUniqueName(socket, targetNode.getSocketList());

            targetNode.addSocket(socket);
            socket.maintainReferences(ModelObject.RESOLVE_GLOBAL_REFS | ModelObject.RESOLVE_LOCAL_REFS);

            // Add the corresponding socket figure and select it
            // TODO Feature 5: We should take care that an existing socket is not overlayed by the new socket
            SocketFigure socketFigure = nodeFigure.addSocket(socket);
            workspaceView.addToSelection(socketFigure);
          }

          return true;
        }
View Full Code Here

TOP

Related Classes of org.openbp.cockpit.modeler.figures.process.MultiSocketNodeFigure

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.