public Region ( Model model , ElementWrapper redefinedElement , global::EA.Diagram masterDiagram , global::EA.Partition partition , short regionPos = 0 ) : base(model,redefinedElement.wrappedElement) { this.redefinedElement = redefinedElement; this.masterDiagram = masterDiagram; this.partition = partition; this._regionPos = regionPos; if(redefinedElement is UML.StateMachines.BehaviorStateMachines.StateMachine) { _stateMachine = redefinedElement as UML.StateMachines.BehaviorStateMachines.StateMachine; } else if(redefinedElement is UML.StateMachines.BehaviorStateMachines.State) { _state = redefinedElement as UML.StateMachines.BehaviorStateMachines.State; } else { throw new ArgumentException("Only StateMachine or State instances are allowed as owners.","owningElement"); } if(partition != null) { if(!string.IsNullOrEmpty(partition.Name) && partition.Name != "<anonymous>") { _name = partition.Name; } else { _name = base.name + "Region" + regionPos.ToString(); } } else { _name = base.name + "Region"; } }
createBehaviourStateMachineRegions(ElementWrapper elementWrapper) { HashSet <UML.StateMachines.BehaviorStateMachines.Region> newRegions = new HashSet <UML.StateMachines.BehaviorStateMachines.Region>(); // Get the owning element ElementWrapper owningElement = getOwningElement(elementWrapper); global::EA.Diagram masterDiagram = null; if (owningElement != null) { // Get the master state diagram from the owning element if available masterDiagram = getMasterStateDiagram(owningElement, elementWrapper.wrappedElement); } if (masterDiagram == null) { // Get the master state diagram from the current element if available masterDiagram = getMasterStateDiagram(elementWrapper, elementWrapper.wrappedElement); } if (elementWrapper.wrappedElement.Partitions.Count == 0) { // Check if the wrapped element contains any sub states if (elementWrapper.wrappedElement.IsComposite || elementWrapper.wrappedElement.Type == "StateMachine") { // Create an implicit default region UML.StateMachines.BehaviorStateMachines.Region defaultRegion = new BehaviorStateMachines.Region(this.model as Model, elementWrapper, masterDiagram, null); newRegions.Add(defaultRegion); } } else { // Create a region for all partitions of the wrapped element short regionPos = 0; foreach (global::EA.Partition partition in elementWrapper.wrappedElement.Partitions) { UML.StateMachines.BehaviorStateMachines.Region newRegion = new BehaviorStateMachines.Region(this.model as Model, elementWrapper, masterDiagram, partition, regionPos); newRegions.Add(newRegion); ++regionPos; } } return(newRegions); }
public Region (Model model , ElementWrapper redefinedElement , global::EA.Diagram masterDiagram , global::EA.Partition partition , short regionPos = 0 ) : base(model, redefinedElement.wrappedElement) { this.redefinedElement = redefinedElement; this.masterDiagram = masterDiagram; this.partition = partition; this._regionPos = regionPos; if (redefinedElement is UML.StateMachines.BehaviorStateMachines.StateMachine) { _stateMachine = redefinedElement as UML.StateMachines.BehaviorStateMachines.StateMachine; } else if (redefinedElement is UML.StateMachines.BehaviorStateMachines.State) { _state = redefinedElement as UML.StateMachines.BehaviorStateMachines.State; } else { throw new ArgumentException("Only StateMachine or State instances are allowed as owners.", "owningElement"); } if (partition != null) { if (!string.IsNullOrEmpty(partition.Name) && partition.Name != "<anonymous>") { _name = partition.Name; } else { _name = base.name + "Region" + regionPos.ToString(); } } else { _name = base.name + "Region"; } }
public override UML.Diagrams.Diagram createDiagram(object diagramToWrap) { Diagram newDiagram = null; global::EA.Diagram eaDiagramToWrap = diagramToWrap as global::EA.Diagram; if (eaDiagramToWrap != null) { switch (eaDiagramToWrap.Type) { case "Sequence": newDiagram = new SequenceDiagram(this.model as Model, eaDiagramToWrap); break; default: newDiagram = new Diagram(this.model as Model, eaDiagramToWrap); break; } } return(newDiagram); }
/// <summary> /// creates a diagram based on the given EA.Diagram object /// </summary> /// <param name="diagramToWrap">the EA.Diagram object to wrap</param> /// <returns>a diagram wrapping the given EA.Diagram object</returns> public override UML.Diagrams.Diagram createDiagram(object diagramToWrap) { Diagram newDiagram = null; global::EA.Diagram eaDiagramToWrap = diagramToWrap as global::EA.Diagram; if (eaDiagramToWrap != null) { switch (eaDiagramToWrap.Type) { case "Sequence": newDiagram = new SequenceDiagram(this.model as Model, eaDiagramToWrap); break; case "Collaboration": newDiagram = new CommunicationDiagram(this.model as Model, eaDiagramToWrap); break; case "Activity": newDiagram = new ActivityDiagram(this.model as Model, eaDiagramToWrap); break; case "Logical": newDiagram = new ClassDiagram(this.model as Model, eaDiagramToWrap); break; case "Component": newDiagram = new ComponentDiagram(this.model as Model, eaDiagramToWrap); break; case "CompositeStructure": newDiagram = new CompositeStructureDiagram(this.model as Model, eaDiagramToWrap); break; case "Deployment": newDiagram = new DeploymentDiagram(this.model as Model, eaDiagramToWrap); break; case "InteractionOverview": newDiagram = new InteractionOverviewDiagram(this.model as Model, eaDiagramToWrap); break; case "Object": newDiagram = new ObjectDiagram(this.model as Model, eaDiagramToWrap); break; case "Package": newDiagram = new PackageDiagram(this.model as Model, eaDiagramToWrap); break; case "Statechart": newDiagram = new StateMachineDiagram(this.model as Model, eaDiagramToWrap); break; case "Timing": newDiagram = new TimingDiagram(this.model as Model, eaDiagramToWrap); break; case "Use Case": newDiagram = new UseCaseDiagram(this.model as Model, eaDiagramToWrap); break; // TODO add creation of profile diagram default: newDiagram = new Diagram(this.model as Model, eaDiagramToWrap); break; } } return(newDiagram); }
public InteractionOverviewDiagram(Model model, global::EA.Diagram wrappedDiagram) : base(model, wrappedDiagram) { }
public StateMachineDiagram(Model model, global::EA.Diagram wrappedDiagram) : base(model, wrappedDiagram) { }
public Diagram(Model model, global::EA.Diagram wrappedDiagram) { this.model = model; this.wrappedDiagram = wrappedDiagram; }
public TimingDiagram(Model model, global::EA.Diagram wrappedDiagram) : base(model, wrappedDiagram) { }
public ComponentDiagram(Model model, global::EA.Diagram wrappedDiagram) : base(model, wrappedDiagram) { }
public ClassDiagram(Model model, global::EA.Diagram wrappedDiagram) : base(model, wrappedDiagram) { }
public ActivityDiagram(Model model, global::EA.Diagram wrappedDiagram) : base(model, wrappedDiagram) { }
public DeploymentDiagram(Model model, global::EA.Diagram wrappedDiagram) : base(model, wrappedDiagram) { }
public CompositeStructureDiagram(Model model, global::EA.Diagram wrappedDiagram) : base(model, wrappedDiagram) { }
public ProfileDiagram(Model model, global::EA.Diagram wrappedDiagram) : base(model, wrappedDiagram) { }
public CommunicationDiagram(Model model, global::EA.Diagram wrappedDiagram) : base(model, wrappedDiagram) { }
public UseCaseDiagram(Model model, global::EA.Diagram wrappedDiagram) : base(model, wrappedDiagram) { }
public SequenceDiagram(Model model, global::EA.Diagram wrappedDiagram) : base(model, wrappedDiagram) { }
public ObjectDiagram(Model model, global::EA.Diagram wrappedDiagram) : base(model, wrappedDiagram) { }