/**
  * Returns a {@link RectangularNodeIcon} for nodes with type of 'task' and a {@link OvalNodeIcon}
  * for all other nodes.
  *
  * @see com.googlecode.sarasvati.visual.GraphToImageMap#iconForNode(com.googlecode.sarasvati.Node)
  */
 @Override
 public Icon iconForNode(Node node) {
   if (getTaskType().equalsIgnoreCase(node.getType())) {
     return new RectangularNodeIcon(node, null);
   } else if (node.getType().equals("end")) {
     return new SmallCircleNodeIcon();
   }
   return new OvalNodeIcon(node, null);
 }
Ejemplo n.º 2
0
  @Override
  public List<Node> getStartNodes() {
    List<Node> startNodes = new LinkedList<Node>();

    for (Node node : nodes) {
      if (node.isStart()) {
        startNodes.add(node);
      }
    }

    return startNodes;
  }
Ejemplo n.º 3
0
  private void executeArc(GraphProcess process, ArcToken token) {
    if (token.isPending()) {
      token.markProcessed(this);
      process.addActiveArcToken(token);

      Node targetNode = token.getArc().getEndNode();
      JoinResult result = targetNode.getJoinStrategy().performJoin(this, process, token);

      if (result.isJoinComplete()) {
        completeExecuteArc(process, targetNode, result.getArcTokensCompletingJoin());
      }
    }
  }
Ejemplo n.º 4
0
  @Override
  public Node importNode(final HibGraph graph, final Node node, final External external) {
    HibNodeRef nodeRef = (HibNodeRef) node;

    HibNodeRef origNode = node.getExternal() == null ? null : (HibNodeRef) node;

    HibNodeRef newRef = new HibNodeRef(graph, nodeRef.getNode(), origNode, (HibExternal) external);
    session.save(newRef);
    graph.getNodes().add(newRef);

    return newRef;
  }