Package org.eclipse.uml2.uml

Examples of org.eclipse.uml2.uml.Vertex


  {
    ArrayList<Vertex> colCompleteVertices = new ArrayList<Vertex>();
    for(Vertex oVertex : m_colVertices)
    {
      colCompleteVertices.add(oVertex);
      Vertex oSuperVertex = oVertex.getContainer().getState();
      while(oSuperVertex != null)
      {
        if(!colCompleteVertices.contains(oSuperVertex))
          colCompleteVertices.add(oSuperVertex);
        oSuperVertex = oSuperVertex.getContainer().getState();
      }
    }
    return colCompleteVertices;
  }
View Full Code Here


          {
            Pseudostate oPseudostate = (Pseudostate)oRunVertex;
            if(oPseudostate.getKind().equals(PseudostateKind.SHALLOW_HISTORY_LITERAL) ||
              oPseudostate.getKind().equals(PseudostateKind.DEEP_HISTORY_LITERAL))
            {
              Vertex oFirstVertex = m_oHistory.findTheLastUsedOf(oRegion.getSubvertices());
              if((oFirstVertex == null) || (oPseudostate.equals(oFirstVertex)))
              {
                oFirstVertex = oPseudostate.getOutgoings().get(0).getTarget();
              }
              // recursive search for sub regions
              colVertices.addAll(getAtomicSubVertices(oFirstVertex));
             
            }
            else if(oPseudostate.getKind().equals(PseudostateKind.INITIAL_LITERAL))
            {
              Vertex oFirstVertex = oPseudostate.getOutgoings().get(0).getTarget();
              // recursive search for sub regions
              colVertices.addAll(getAtomicSubVertices(oFirstVertex));
            }
          }
        }
View Full Code Here

 
  private boolean firstVertexIsSuperStateOfSecondVertex(Vertex in_oFirstVertex, Vertex in_oSecondVertex)
  {
    if(in_oFirstVertex == in_oSecondVertex)
      return false;
    Vertex oContainerVertex = in_oSecondVertex.getContainer().getState();
    while(oContainerVertex != null)
    {
      if(oContainerVertex == in_oFirstVertex)
      {
        return true;
      }
      oContainerVertex = oContainerVertex.getContainer().getState();
    }
    return false;
  }
View Full Code Here

  /*
   * if selected transition is outgoing transition of super state then all sub states are final
   */
  public boolean ifSourceSuperStateThenAllSubFinal(Transition in_oTransition)
  {
    Vertex oVertex = in_oTransition.getSource();
    for(Vertex oCurrentVertex : m_colVertices)
    {
      if(firstVertexIsSuperStateOfSecondVertex(oVertex, oCurrentVertex))
      {
        if(!(oCurrentVertex instanceof FinalState))
View Full Code Here

  {
    ArrayList<Vertex> colCompleteVertices = new ArrayList<Vertex>();
    for(Vertex oVertex : m_colVertices)
    {
      colCompleteVertices.add(oVertex);
      Vertex oSuperVertex = oVertex.getContainer().getState();
      while(oSuperVertex != null)
      {
        if(!colCompleteVertices.contains(oSuperVertex))
          colCompleteVertices.add(oSuperVertex);
        oSuperVertex = oSuperVertex.getContainer().getState();
      }
    }
    return colCompleteVertices;
  }
View Full Code Here

          {
            Pseudostate oPseudostate = (Pseudostate)oRunVertex;
            if(oPseudostate.getKind().equals(PseudostateKind.SHALLOW_HISTORY_LITERAL) ||
              oPseudostate.getKind().equals(PseudostateKind.DEEP_HISTORY_LITERAL))
            {
              Vertex oFirstVertex = m_oHistory.findTheLastUsedOf(oRegion.getSubvertices());
              if((oFirstVertex == null) || (oPseudostate.equals(oFirstVertex)))
              {
                oFirstVertex = oPseudostate.getOutgoings().get(0).getTarget();
              }
              // recursive search for sub regions
              colVertices.addAll(getAtomicSubVertices(oFirstVertex));
             
            }
            else if(oPseudostate.getKind().equals(PseudostateKind.INITIAL_LITERAL))
            {
              Vertex oFirstVertex = oPseudostate.getOutgoings().get(0).getTarget();
              // recursive search for sub regions
              colVertices.addAll(getAtomicSubVertices(oFirstVertex));
            }
          }
        }
View Full Code Here

 
  private boolean firstVertexIsSuperStateOfSecondVertex(Vertex in_oFirstVertex, Vertex in_oSecondVertex)
  {
    if(in_oFirstVertex == in_oSecondVertex)
      return false;
    Vertex oContainerVertex = in_oSecondVertex.getContainer().getState();
    while(oContainerVertex != null)
    {
      if(oContainerVertex == in_oFirstVertex)
      {
        return true;
      }
      oContainerVertex = oContainerVertex.getContainer().getState();
    }
    return false;
  }
View Full Code Here

  /*
   * if selected transition is outgoing transition of super state then all sub states are final
   */
  public boolean ifSourceSuperStateThenAllSubFinal(Transition in_oTransition)
  {
    Vertex oVertex = in_oTransition.getSource();
    for(Vertex oCurrentVertex : m_colVertices)
    {
      if(firstVertexIsSuperStateOfSecondVertex(oVertex, oCurrentVertex))
      {
        if(!(oCurrentVertex instanceof FinalState))
View Full Code Here

  }
 
  public static List<Transition> getSourceStateTransitionsTriggeredByTheSameEvent(
      Transition in_oTransition) {
    List<Transition> colRetValue = new ArrayList<Transition>();
    Vertex oSource = in_oTransition.getSource();
    for(Transition oOutgoingTransition : oSource.getOutgoings()) {
      if(!oOutgoingTransition.equals(in_oTransition)) {
        if(bothTransitionsHaveOverlappingTrigger(in_oTransition, oOutgoingTransition))
          if(!colRetValue.contains(oOutgoingTransition))
            colRetValue.add(oOutgoingTransition);
      }
View Full Code Here

 
  private String createElseGuardCondition(Transition in_oTransition) throws Exception
  {
    StringBuffer sElseGuard = new StringBuffer();
    // find all other outgoing transitions
    Vertex oSourceState = in_oTransition.getSource();
    for(Transition oOutgoingTransition : oSourceState.getOutgoings()) {
     
      // only consider transitions that are not the current one (in_oTransition)
      if(oOutgoingTransition.equals(in_oTransition)) {
        continue;
      }
     
      // transition has to have the same trigger as the original transition!
      if(oOutgoingTransition.getTriggers().isEmpty()) {
        if(!in_oTransition.getTriggers().isEmpty()) {
          continue;
        }
      }
      else {
        if(in_oTransition.getTriggers().isEmpty()) {
          continue;
        }
        else {
          boolean bOverlap = false;
          // check overlapping of trigger events
          for(Trigger oOutgoingTrigger : oOutgoingTransition.getTriggers()) {
            for(Trigger oInTrigger : in_oTransition.getTriggers()) {
              if(oOutgoingTrigger.getEvent().equals(oInTrigger.getEvent()))
                bOverlap = true;
            }
          }
          if(bOverlap == false)
            continue;
        }
      }
     
      // model validation: no other empty guard and no other "else"
      String sOutgoingGuard = ((LiteralString)oOutgoingTransition.getGuard().getSpecification()).getValue();
      if(sOutgoingGuard.compareTo("else") == 0) {
        throw new Exception("too many else conditions from node >" + oSourceState.getQualifiedName() + "<");
      }
      else if(sOutgoingGuard.isEmpty()) {
        throw new Exception("one empty guard and one else guard together are not allowed from node >" + oSourceState.getQualifiedName() + "<");
      }
     
      // negate all other guards of transitions triggered by the same event and conjoin them at the else-guard
      if(sElseGuard.length() > 0) {
        sElseGuard.append(" and ");
View Full Code Here

TOP

Related Classes of org.eclipse.uml2.uml.Vertex

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.