Package org.eclipse.uml2.uml

Examples of org.eclipse.uml2.uml.ActivityNode


    {
        // TODO: Be sure it works with RSM / MD11.5
        Collection templateParameters = new ArrayList();
        if (this.metaObject instanceof TemplateableElement)
        {
            TemplateableElement templateableElement = (TemplateableElement)this.metaObject;
            TemplateSignature templateSignature = templateableElement.getOwnedTemplateSignature();
            if (templateSignature != null)
            {
                templateParameters.addAll(templateSignature.getParameters());
            }
        }
View Full Code Here


                    type,
                    MetafacadeConstants.NAMESPACE_SCOPE_OPERATOR,
                    true);
            if (modelElement instanceof Type)
            {
                Type element = (Type)modelElement;
                final Property property = umlClass.createOwnedAttribute(
                        name,
                        element,
                        1,
                        1);
View Full Code Here

        }
        boolean isEntityAssociation = true;
        for (Iterator ends = ((Association)this.metaObject).getMemberEnds().iterator(); ends.hasNext();)
        {
            final Property prop = (Property)ends.next();
            final Type propertyType = prop.getType();
            if (propertyType == null || !UmlUtilities.containsStereotype(
                    propertyType,
                    UMLProfile.STEREOTYPE_ENTITY))
            {
                isEntityAssociation = false;
View Full Code Here

        if (tagValue != null)
        {
            valueAsString = tagValue.toString();
            if (tagValue instanceof ValueSpecification)
            {
                ValueSpecification literal = (ValueSpecification)tagValue;
                valueAsString = literal.stringValue();
            }
            else if (tagValue instanceof InstanceSpecification)
            {
                InstanceSpecification instance = (InstanceSpecification)tagValue;
                valueAsString = instance.getName();
View Full Code Here

                final Property property = umlClass.createOwnedAttribute(
                        name,
                        element,
                        1,
                        1);
                VisibilityKind kind = VisibilityKind.PUBLIC_LITERAL;
                if (visibility.equalsIgnoreCase("package"))
                {
                    kind = VisibilityKind.PACKAGE_LITERAL;
                }
                if (visibility.equalsIgnoreCase("private"))
View Full Code Here

    protected java.lang.String handleGetVisibility()
    {
        if (this.metaObject instanceof NamedElement)
        {
            final NamedElement element = (NamedElement)this.metaObject;
            final VisibilityKind kind = element.getVisibility();
            String visibility = null;
            if (kind.equals(VisibilityKind.PACKAGE_LITERAL))
            {
                visibility = "package";
            }
            if (kind.equals(VisibilityKind.PRIVATE_LITERAL))
            {
                visibility = "private";
            }
            if (kind.equals(VisibilityKind.PROTECTED_LITERAL))
            {
                visibility = "protected";
            }
            if (kind.equals(VisibilityKind.PUBLIC_LITERAL))
            {
                visibility = "public";
            }
            final TypeMappings languageMappings = this.getLanguageMappings();
            if (languageMappings != null)
View Full Code Here

   * @return an inmodifiable ActivityPath instance representing the found path
   * @see ActivityPath
   */
  protected static ActivityPath findPath(Activity activity) {
    EList<ActivityNode> nodes = activity.getOwnedNodes();
    ActivityNode currentNode = null;
    ActivityPath path = new ActivityPath();
    out("there are " + nodes.size() //$NON-NLS-1$
        + " Nodes in the activity"); //$NON-NLS-1$
    try {
      // find an initial Node in the activity
      for (ActivityNode n : nodes) {
        if (n instanceof InitialNode) {
          currentNode = (InitialNode) n;
          path.setStartNode((InitialNode) n);
        }
        break;
      }
      // initial node found?
      if (currentNode == null) {
        err("No Initial Node Found in Activity"); //$NON-NLS-1$
        System.exit(-1);
      }
      // print Path
      out("A valid path through the activity is:");
      do {
        // node and its linked constraints
        out("Node: " + currentNode.getLabel()); //$NON-NLS-1$
        if (constraintMap.get(currentNode) != null) {
          for (Constraint c : constraintMap.get(currentNode)) {
            out(c.toString());
            for (EObject o : c.getOwnedElements()) {
              out("\t" + o); //$NON-NLS-1$
              String expression = new String();
              for (String s : ((OpaqueExpression) o).getBodies()) {
                expression = expression.concat(s);
              }
              out(expression);
            }
          }
        }

        // edge and its guard conditions
        for (ActivityEdge edge : currentNode.getOutgoings()) {
          if (edge instanceof ControlFlow) {
            path.add((ControlFlow) edge);
            out("Edge: " + edge.getName()); //$NON-NLS-1$
            for (EObject e : edge.eContents()) {
              out(e.toString());
View Full Code Here

   * @return an inmodifiable ActivityPath instance representing the found path
   * @see ActivityPath
   */
  protected static ActivityPath findPath(Activity activity) {
    EList<ActivityNode> nodes = activity.getOwnedNodes();
    ActivityNode currentNode = null;
    ActivityPath path = new ActivityPath();
    out("there are " + nodes.size() //$NON-NLS-1$
        + " Nodes in the activity"); //$NON-NLS-1$
    try {
      // find an initial Node in the activity
      for (ActivityNode n : nodes) {
        if (n instanceof InitialNode) {
          currentNode = (InitialNode) n;
          path.setStartNode((InitialNode) n);
        }
        break;
      }
      // initial node found?
      if (currentNode == null) {
        err(Messages.getString("Error.INITIAL_NODE_NOT_FOUND")); //$NON-NLS-1$
        System.exit(-1);
      }
      // print Path
      out("A valid path through the activity is:");
      do {
        // node and its linked constraints
        out("Node: " + currentNode.getLabel()); //$NON-NLS-1$
        if (constraintMap.get(currentNode) != null) {
          for (Constraint c : constraintMap.get(currentNode)) {
            out(c.toString());
            for (EObject o : c.getOwnedElements()) {
              out("\t" + o); //$NON-NLS-1$
              String expression = new String();
              for (String s : ((OpaqueExpression) o).getBodies()) {
                expression = expression.concat(s);
              }
              out(expression);
            }
          }
        }

        // edge and its guard conditions
        for (ActivityEdge edge : currentNode.getOutgoings()) {
          if (edge instanceof ControlFlow) {
            path.add((ControlFlow) edge);
            out("Edge: " + edge.getName()); //$NON-NLS-1$
            for (EObject e : edge.eContents()) {
              out(e.toString());
View Full Code Here

  public void translate() throws TranslationException {
    // for now only one start node is admitted
    if (startNodes.size() == 0) throw new TranslationException(this, "No initial node defined for activity");
    if (startNodes.size() > 1) throw new TranslationException(this, "Multiple initial nodes are not supported");
   
    ActivityNode node = startNodes.iterator().next();
   
    if (parentTranslator != null) { // we need to create the start transition
      openGuard();
      createGuardCondition("state_1 = " + getParentTranslator().getStateNumber(parentForkNode));
      addGuardCondition(stateVarName + " = 2" );
View Full Code Here

  private void visitNode(InitialNode node) throws TranslationException {
    // InitNodes should have just one out transition
    checkSingleOutgoingTransition(node);
   
    ActivityEdge edge = node.getOutgoing(null);
    ActivityNode target = edge.getTarget();
   
    // jump it
    this.forceStateNumber(node, START_STATE);
   
    this.createGuard(node, true, true);
View Full Code Here

TOP

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

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.