Package org.openbp.core.model.item.activity

Examples of org.openbp.core.model.item.activity.ActivityItem


      process.setNodeGeometry("size:" + size);
    }
    else if (item instanceof ActivityItem)
    {
      // Adjust the size of the node according to the number of sockets
      ActivityItem action = (ActivityItem) item;

      additionalSockets = action.getNumberOfSockets() - 2;
      if (additionalSockets > 0)
      {
        int size = ModelerGraphics.DEFAULT_NODE_SIZE;
        size += additionalSockets / 2 * size;
      }
 
View Full Code Here


        fireEvent(jEvent);
      }
      else if (qualifier.getItemType().equals(ItemTypes.ACTIVITY) || qualifier.getItemType().equals(ItemTypes.WEBSERVICE) || qualifier.getItemType().equals(ItemTypes.VISUAL) || qualifier.getItemType().equals(ItemTypes.ACTOR))
      {
        // Open the activity in the component editor
        ActivityItem activity = getActivity(mo);
        OpenEvent event = new OpenEvent(this, "global.edit.edit", activity);
        fireEvent(event);
      }
      else if (qualifier.getItemType().equals(ItemTypes.TYPE))
      {
View Full Code Here

    referencePath = src.referencePath;
  }

  public void copyFromItem(Item item, int syncFlags)
  {
    ActivityItem ai = (ActivityItem) item;

    // Make node name unique
    String newName = ai.getName();
    if (getProcess() != null)
    {
      newName = NamedObjectCollectionUtil.createUniqueId(getProcess().getNodeList(), newName);
    }
    setName(newName);
    setDisplayName(item.getDisplayName());
    setDescription(item.getDescription());

    // Copy the sockets
    clearSockets();
    for (Iterator it = ai.getSockets(); it.hasNext();)
    {
      ActivitySocket activitySocket = (ActivitySocket) it.next();

      NodeSocket nodeSocket = new NodeSocketImpl();
      nodeSocket.copyFromActivitySocket(activitySocket, syncFlags);
      addSocket(nodeSocket);
    }

    // Copy description and display name
    ItemSynchronization.syncDisplayObjects(this, ai, syncFlags);

    setGeometry(ai.getGeometry());

    if (item instanceof PlaceholderItem)
    {
      referencePath = ((PlaceholderItem) item).getReferencePath();
    }
View Full Code Here

    }
  }

  public void copyToItem(Item item, int syncFlags)
  {
    ActivityItem ai = (ActivityItem) item;

    if (ai.getName() != null)
    {
      ai.setName(getName());
    }
    ai.setDisplayName(getDisplayName());
    ai.setDescription(getDescription());

    // Copy the sockets
    ai.clearSockets();
    for (Iterator it = getSockets(); it.hasNext();)
    {
      NodeSocket nodeSocket = (NodeSocket) it.next();

      ActivitySocket activitySocket = new ActivitySocketImpl();
      nodeSocket.copyToActivitySocket(activitySocket, syncFlags);
      ai.addSocket(activitySocket);
    }

    ai.setGeometry(getGeometry());

    if (item instanceof PlaceholderItem)
    {
      ((PlaceholderItem) item).setReferencePath(referencePath);
    }
View Full Code Here

    activityHandlerDefinition.setOwner(this);
  }

  public void copyFromItem(Item item, int syncFlags)
  {
    ActivityItem ai = (ActivityItem) item;

    // Make node name unique
    String newName = ai.getName();
    if (getProcess() != null)
    {
      newName = NamedObjectCollectionUtil.createUniqueId(getProcess().getNodeList(), newName);
    }
    setName(newName);

    if (ai instanceof JavaActivityItem)
    {
      setActivityHandlerDefinition(new HandlerDefinition());
      try
      {
        activityHandlerDefinition.copyFrom(((JavaActivityItem) ai).getHandlerDefinition(), Copyable.COPY_DEEP);
      }
      catch (CloneNotSupportedException e)
      {
        // Doesn't happen
      }
      activityHandlerDefinition.setOwner(this);
    }

    // Copy the sockets
    clearSockets();
    for (Iterator it = ai.getSockets(); it.hasNext();)
    {
      ActivitySocket activitySocket = (ActivitySocket) it.next();

      NodeSocket nodeSocket = new NodeSocketImpl();
      nodeSocket.copyFromActivitySocket(activitySocket, syncFlags);
      addSocket(nodeSocket);
    }

    // Copy description and display name
    ItemSynchronization.syncDisplayObjects(this, ai, syncFlags);

    setGeometry(ai.getGeometry());
  }
View Full Code Here

    setGeometry(ai.getGeometry());
  }

  public void copyToItem(Item item, int syncFlags)
  {
    ActivityItem ai = (ActivityItem) item;

    if (item.getName() == null)
    {
      item.setName(getName());
    }
    if (ai instanceof JavaActivityItem)
    {
      HandlerDefinition aiHandler = new HandlerDefinition();
      ((JavaActivityItem) ai).setHandlerDefinition(aiHandler);
      try
      {
        aiHandler.copyFrom(getActivityHandlerDefinition(), Copyable.COPY_DEEP);
      }
      catch (CloneNotSupportedException e)
      {
        // Doesn't happen
      }
      aiHandler.setOwner(ai);
    }

    // Copy the sockets
    ai.clearSockets();
    for (Iterator it = getSockets(); it.hasNext();)
    {
      NodeSocket nodeSocket = (NodeSocket) it.next();

      ActivitySocket activitySocket = new ActivitySocketImpl();
      nodeSocket.copyToActivitySocket(activitySocket, syncFlags);
      ai.addSocket(activitySocket);
    }

    ai.setGeometry(getGeometry());
  }
View Full Code Here

    // Search all Activity items
    Iterator activityItems = model.getItems(ItemTypes.ACTIVITY);
    while (activityItems.hasNext())
    {
      ActivityItem activity = (ActivityItem) activityItems.next();
      Iterator sockets = activity.getSockets();
      while (sockets.hasNext())
      {
        ActivitySocket activitySocket = (ActivitySocket) sockets.next();
        foundModelObjects.addAll(findInActivitySocket(activitySocket, item));
      }
View Full Code Here

TOP

Related Classes of org.openbp.core.model.item.activity.ActivityItem

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.