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

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


    return false;
  }

  private void autoAdjustPlaceholderName()
  {
    Node sourceNode = sourceSocketFigure.getNodeSocket().getNode();
    Node targetNode = targetSocketFigure.getNodeSocket().getNode();
    if (sourceNode instanceof VisualNode && targetNode instanceof PlaceholderNode)
    {
      String socketName = sourceSocketFigure.getNodeSocket().getName();
      String socketDisplayName = sourceSocketFigure.getNodeSocket().getDisplayName();

      // We have two connection points.
      modeler.startUndo("Auto-adjust placeholder name");

      targetNode.setName(NamedObjectCollectionUtil.createUniqueId(sourceNode.getProcess().getNodeList(), socketName));
      targetNode.setDisplayName(socketDisplayName);

      newNodeFigure.updateFigure();

      modeler.endUndo();
    }
View Full Code Here


    Iterator itNodes = ((FinalNode) o).getProcess().getNodes();

    while (itNodes.hasNext())
    {
      Node node = (Node) itNodes.next();

      if (!(node instanceof InitialNode))
        continue;

      String name = node.getName();
      map.put(name, name);
    }

    selectionField.addItem(null);
    selectionField.addItem(CoreConstants.JUMPTARGET_DEFAULT_PROCESS);
View Full Code Here

          qualifiers.add(socket.getQualifier());
        }
        else if (o instanceof NodeFigure)
        {
          // Node selected; add the Qualifiers of all of its sockets
          Node node = ((NodeFigure) o).getNode();
          for (Iterator itSockets = node.getSockets(); itSockets.hasNext();)
          {
            NodeSocket socket = (NodeSocket) itSockets.next();
            qualifiers.add(socket.getQualifier());
          }
        }
View Full Code Here

    TreeMap map = new TreeMap();

    Iterator itNodes = ((InitialNode) o).getProcess().getNodes();
    while (itNodes.hasNext())
    {
      Node node = (Node) itNodes.next();

      if (!(node instanceof FinalNode))
        continue;

      FinalNode finalNode = (FinalNode) node;
      if (finalNode.getJumpTarget() != null)
      {
        // We skip exit-continue nodes
        continue;
      }

      String name = node.getName();
      map.put(name, name);
    }

    selectionField.addItem(null);
    for (Iterator itGroups = map.keySet().iterator(); itGroups.hasNext();)
View Full Code Here

   * true: There are parameters or setting values that can be edited by the wizard.<br>
   * false: No wizard hints have been defined for the parameters and there is no setting object to edit.
   */
  public static boolean isParameterValueWizardApplyable(Modeler modeler, NodeFigure nodeFigure, String socketName)
  {
    Node node = nodeFigure.getNode();

    NodeSocket socket = null;
    if (socketName != null)
    {
      socket = node.getSocketByName(socketName);
    }
    else
    {
      socket = node.getDefaultEntrySocket();
    }

    if (socket == null)
      return false;

View Full Code Here

   * @param socketName Name of the socket to edit or null for the default entry socket
   * @param paramName Name of the parameter to display by default or null for the first parameter
   */
  public static void displayParameterValueWizard(Modeler modeler, NodeFigure nodeFigure, String socketName, String paramName)
  {
    Node node = nodeFigure.getNode();

    NodeSocket socket = null;
    if (socketName != null)
    {
      socket = node.getSocketByName(socketName);
    }
    else
    {
      socket = node.getDefaultEntrySocket();
    }

    // Check if there are parameters we might assign a value
    List valueParams = null;

View Full Code Here

          return false;
        }

        editor.startUndo("Add Node");

        Node node = nodeFigure.getNode();
        process.addNode(node);
        node.maintainReferences(ModelObject.SYNC_GLOBAL_REFNAMES | ModelObject.SYNC_LOCAL_REFNAMES);

        nodeFigure.displayBox(new Rectangle(p));
        add(nodeFigure);
        addedFigure = nodeFigure;
      }
View Full Code Here

        syncFlags |= ItemSynchronization.SYNC_HIDE_PRIVATE_ENTRIES;
      }
    }

    // Create a node referencing the item
    Node node = np.toNode(process, syncFlags);

    node.setProcess(process);

    // Make sure that the nodename is unique
    node.setName(process.createUniqueNodeName(node.getName()));

    NodeFigure nodeFigure = createNodeFigure(node);
    if (isSkeleton)
    {
      nodeFigure.setCreatedFromScratch(true);
View Full Code Here

    return socket;
  }

  public ProcessObject getReferredProcessElement()
  {
    Node node = socket.getNode();
    if (node instanceof InitialNode || node instanceof FinalNode)
      // Entry and final node socket figures return their parent node as referred object.
      return node;

    // All other socket figures return the socket.
View Full Code Here

   * to all exit sockets of the node the target socket belongs to)
   * @param context Token context
   */
  static void copySocketParameters(NodeSocket sourceSocket, NodeSocket targetSocket, TokenContext context)
  {
    Node node = sourceSocket.getNode();

    // Iterate all parameters of the exit socket
    for (Iterator itParam = sourceSocket.getParams(); itParam.hasNext();)
    {
      Param sourceParam = (Param) itParam.next();
      String paramName = sourceParam.getName();

      if (targetSocket != null)
      {
        Param targetParam = targetSocket.getParamByName(paramName);
        if (targetParam == null)
          continue;

        Object value = TokenContextUtil.getParamValue(context, sourceParam);
        TokenContextUtil.setParamValue(context, targetParam, value);
      }
      else
      {
        boolean haveValue = false;
        Object value = null;

        for (Iterator itSocket = node.getSockets(); itSocket.hasNext();)
        {
          NodeSocket socket = (NodeSocket) itSocket.next();

          if (! socket.isExitSocket())
            continue;
View Full Code Here

TOP

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

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.