/**
  * 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);
 }
Exemple #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;
  }
  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());
      }
    }
  }
  @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;
  }