Package org.openbp.core.model.item.process

Examples of org.openbp.core.model.item.process.MultiSocketNode


        }
        else
        {
          if (mo instanceof MultiSocketNode)
          {
            MultiSocketNode node = (MultiSocketNode) mo;

            // If we edit an activity node, create a configuration bean if not already there
            // in order to be able to edit the settings in the property browser.
            // The bean will be removed if it contains the default values only when saving the activity node again
            // (see plugin_propertybrowser_executesave () in the ModelerEventModule)
            if (node.getConfigurationBean() == null)
            {
              // We create a new configuration bean (if defined by the underlying activity)
              if (referencedItem != null)
              {
                node.setConfigurationBean(referencedItem.createConfigurationBean());
              }
            }
          }
        }
View Full Code Here


        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);
View Full Code Here

    // Make sure all subordinate objects refer to this object
    orig.maintainReferences(0);

    if (orig instanceof MultiSocketNode)
    {
      MultiSocketNode node = (MultiSocketNode) orig;

      // If we edit an action node and the configuration bean contains default values only, we remove it
      // so it won't be persisted to the XML file.
      if (node.getConfigurationBean() != null && node.getConfigurationBean().hasDefaultValues())
      {
        node.setConfigurationBean(null);
      }
    }

    modeler.getDrawing().updateFigure();
View Full Code Here

    }

    ConfigurationBean configurationBean = null;
    if (node instanceof MultiSocketNode)
    {
      MultiSocketNode msNode = (MultiSocketNode) node;

      // Determine the item the figure element references to
      Item referencedItem = null;
      if (node instanceof SubprocessNode)
      {
        referencedItem = ((SubprocessNode) node).getSubprocess();
      }
      else if (node instanceof ActivityNode)
      {
        // TODO Feature 4 Configuration bean not supported currently due to removal of ActivityNode->ActivityItem reference
        // referencedItem = ((ActivityNode) node).getActivity();
      }

      // Check if we shall display the settings in the wizard or not
      // (applies only for new nodes, i. e. if refering to the default entry socket)
      if (socketName == null && referencedItem != null && ! referencedItem.isHideSettingsInWizard())
      {
        // Create a configuration bean if not already there
        // in order to be able to edit the settings in the property browser.
        // The bean will be removed if it contains the default values only when saving the activity node again
        // (see plugin_propertybrowser_executesave () in the ConfigurationBeanPage)
        configurationBean = msNode.getConfigurationBean();
        if (configurationBean == null)
        {
          // We create a new configuration bean (if defined by the underlying activity)
          if (referencedItem != null)
          {
View Full Code Here

          if (entry.getName().equals(((FinalNode) node).getJumpTarget()))
            foundReferences.add(node);
        }
        else if (node instanceof MultiSocketNode)
        {
          MultiSocketNode socketNode = (MultiSocketNode) node;
          Iterator exitSockets = socketNode.getSockets(false);
          while (exitSockets.hasNext())
          {
            NodeSocket exit = (NodeSocket) exitSockets.next();
            if (! exit.hasControlLinks() && exit.getName().equals(entry.getName()))
              foundReferences.add(exit);
View Full Code Here

  {
    String customImagePath = null;

    if (node instanceof MultiSocketNode)
    {
      MultiSocketNode msNode = (MultiSocketNode) node;

      // Try the underlying item first

      if (msNode.getImagePath() != null)
      {
        customImagePath = msNode.getImagePath();
      }
    }

    return customImagePath;
  }
View Full Code Here

    setIconOverlayFigure(overlayFigure);
  }

  protected void initTextFigure(String textPosition)
  {
    MultiSocketNode msNode = (MultiSocketNode) node;
    String customImagePath = msNode.getImagePath();
    if (customImagePath != null)
    {
      // Position the text to the east if it is in the center and we have a custom icon
      if (textPosition == null || textPosition.equals("c"))
        textPosition = "e";
View Full Code Here

    if (super.importData(regionId, data, p))
      return true;

    p = SwingUtil.convertFromGlassCoords(p, getDrawing().getView());

    MultiSocketNode msNode = (MultiSocketNode) node;

    try
    {
      if (data.isDataFlavorSupported(ClientFlavors.NODE_SOCKET))
      {
        getDrawing().getEditor().startUndo("Add Socket");

        NodeSocket other = (NodeSocket) data.getTransferData(ClientFlavors.NODE_SOCKET);

        String name = other.isEntrySocket() ? CoreConstants.SOCKET_IN : CoreConstants.SOCKET_OUT;
        NodeSocket toAdd = msNode.createSocket(name);

        // Make sure there is a workflow task parameter
        if (msNode instanceof WorkflowNode)
        {
          ProcessElementFactory.getInstance().ensureWorkflowTaskParameter(toAdd);
        }

        toAdd.setEntrySocket(other.isEntrySocket());
        boolean hasDefault = msNode.getDefaultSocket(other.isEntrySocket()) != null;
        if (! hasDefault)
          toAdd.setDefaultSocket(true);

        // add the socket to the node
        msNode.addSocket(toAdd);

        // Add a new socketFigure to the node.
        SocketFigure socketFigure = this.addSocket(toAdd);

        // Set the angle according to the drop position.
View Full Code Here

TOP

Related Classes of org.openbp.core.model.item.process.MultiSocketNode

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.