Exemple #1
0
 @Override
 public Fifo getFifoIded(String id) {
   for (Fifo fifo : this.getFifos()) {
     if (fifo.getId().equals(id)) {
       return fifo;
     }
   }
   return null;
 }
 /**
  * Retrieve the {@link PictogramElement} of the {@link Diagram} corresponding to the given {@link
  * Fifo}.
  *
  * @param diagram the {@link Diagram} containing the {@link PictogramElement}
  * @param fifo the {@link Fifo} whose {@link PictogramElement} is searched.
  * @return the {@link PictogramElement} of the {@link Fifo}.
  * @throws RuntimeException if no {@link PictogramElement} could be found in this {@link Diagram}
  *     for this {@link Fifo}.
  */
 public static ContainerShape getDelayPE(Diagram diagram, Fifo fifo) throws RuntimeException {
   // Get all delays with identical attributes (may not be the
   // right delay is several delays have the same properties.)
   List<PictogramElement> pes =
       Graphiti.getLinkService().getPictogramElements(diagram, fifo.getDelay());
   PictogramElement pe = null;
   for (PictogramElement p : pes) {
     if (p instanceof ContainerShape
         && Graphiti.getLinkService().getBusinessObjectForLinkedPictogramElement(p)
             == fifo.getDelay()) {
       pe = p;
     }
   }
   // if PE is still null.. something is deeply wrong with this
   // graph !
   if (pe == null) {
     throw new RuntimeException(
         "Pictogram element associated to delay of Fifo " + fifo.getId() + " could not be found.");
   }
   return (ContainerShape) pe;
 }