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

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


   *
   * @return The new {@link PlaceholderNode}
   */
  public Node toNode(ProcessItem process, int syncFlags)
  {
    PlaceholderNode result = new PlaceholderNodeImpl();

    result.setProcess(process);
    result.copyFromItem(this, syncFlags);

    return result;
  }
View Full Code Here


   */
  public void executeModelObject(ModelObject mo, EngineExecutor ee)
  {
    TokenContext context = ee.getTokenContext();
    NodeSocket entrySocket = context.getCurrentSocket();
    PlaceholderNode node = (PlaceholderNode) entrySocket.getNode();

    NodeSocket nextSocket = node.getDefaultExitSocket();
    if (nextSocket == null)
    {
      String msg = LogUtil.error(getClass(), "No default exit socket present for placeholder node $0. [{1}]", node.getQualifier(), context);
      throw new EngineException("NoDefaultExitSocket", msg);
    }
    context.setCurrentSocket(nextSocket);
  }
View Full Code Here

  public boolean handleEvent(VisualElementEvent event)
  {
    if (event.type == VisualElementEvent.DOUBLE_CLICK)
    {
      PlaceholderNode placeholderNode = (PlaceholderNode) node;

      if (placeholderNode.getReferencePath() == null)
      {
        // Double-clicking a placeholder w/o reference path means creating a reference to a process or process element.
        // We may either create a new one or choose an existing one.
        // Ask the user what he wants:

        ResourceCollection res = getDrawing().getEditor().getPluginResourceCollection();
        String title = res.getRequiredString("placeholder.referencedialog.title");
        String text = res.getRequiredString("placeholder.referencedialog.text");

        JMsgBox msgBox = new JMsgBox(null, title, text, JMsgBox.TYPE_YESNOCANCEL);
        msgBox.setResource(res);
        msgBox.setResourcePrefix("placeholder.referencedialog.");

        msgBox.initDialog();
        SwingUtil.show(msgBox);

        int choice = msgBox.getUserChoice();

        Model model = node.getOwningModel();

        if (choice == JMsgBox.TYPE_YES)
        {
          // Yes means create a new process
          final Item item = ItemCreationUtil.createItem(model, placeholderNode.getName(), placeholderNode.getDisplayName(), ItemTypes.PROCESS, null);
          if (item != null)
          {
            assignPlaceholderReference(item);

            // Open the new process
View Full Code Here

    ProcessDrawing drawing = getDrawing();

    drawing.getEditor().startUndo("Create placeholder reference");

    // Assign the object reference to the placeholder
    PlaceholderNode placeholderNode = (PlaceholderNode) node;
    placeholderNode.setReferencePath(referencePath);

    // Make the skin reflect the change
    updateFigure();

    // Redisplay the placeholder properties
View Full Code Here

    // Try to connect the control and data links from/to the placeholder to the new node

    // If the orientation of the new node figure and the drawing don't match,
    // rotate the figure
    PlaceholderNode plNode = (PlaceholderNode) getNode();

    // Try to connect

    // Iterate all sockets of the placeholder
    for (Iterator itSockets = plNode.getSockets(); itSockets.hasNext();)
    {
      // TODO Feature 6 NodeSocket plSocket = (NodeSocket) itSockets.next();
    }

    // Reinitialize the drawing
View Full Code Here

TOP

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

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.