Exemplo n.º 1
0
 /* (non-Javadoc)
  * @see nl.adaptivity.process.processModel.ProcessModel#getNode(java.lang.String)
  */
 @Override
 public final T getNode(final Identifiable nodeId) {
   if (nodeId instanceof ProcessNode) {
     return (T) nodeId;
   }
   return mProcessNodes.get(nodeId);
 }
Exemplo n.º 2
0
 public boolean addNode(T node) {
   if (mProcessNodes.add(node)) {
     node.setOwnerModel(this.asM());
     return true;
   }
   return false;
 }
Exemplo n.º 3
0
 public T setNode(final int pos, final T newValue) {
   final T oldValue = mProcessNodes.set(pos, newValue);
   newValue.setOwnerModel(asM());
   oldValue.setSuccessors(Collections.<Identifiable>emptySet());
   oldValue.setPredecessors(Collections.<Identifiable>emptySet());
   oldValue.setOwnerModel(null);
   newValue.resolveRefs();
   for (Identifiable pred : newValue.getPredecessors()) {
     getNode(pred).addSuccessor(newValue);
   }
   for (Identifiable suc : newValue.getSuccessors()) {
     getNode(suc).addPredecessor(newValue);
   }
   return oldValue;
 }
Exemplo n.º 4
0
 public ProcessModelBase(final Collection<? extends T> processNodes) {
   mProcessNodes = IdentifyableSet.processNodeSet(processNodes);
 }
Exemplo n.º 5
0
 public T getNode(final int pos) {
   return mProcessNodes.get(pos);
 }
Exemplo n.º 6
0
 public boolean removeNode(T node) {
   return mProcessNodes.remove(node);
 }
Exemplo n.º 7
0
 /**
  * Set the process nodes for the model. This will actually just retrieve the {@link EndNodeImpl}s
  * and sets the model accordingly. This does mean that only passing {@link EndNodeImpl}s will have
  * the same result, and the other nodes will be pulled in.
  *
  * @param processNodes The process nodes to base the model on.
  */
 public void setModelNodes(@NotNull final Collection<? extends T> processNodes) {
   mProcessNodes = IdentifyableSet.processNodeSet(processNodes);
 }
Exemplo n.º 8
0
 public T removeNode(final int nodePos) {
   return mProcessNodes.remove(nodePos);
 }