Exemplo n.º 1
0
        public MainWindow()
        {
            InitializeComponent();

            //ui_line.Start = new Point(0, 0);
            //ui_line.End = new Point(50, 50);

            //测试数据
            actor = new Actor(diagram) { acName = "abc" };
            Activity activity = new Activity(actor) { ActivityName = "ddd", Pos = 100  };
            actor.AddAactivity(activity);

            Actor act = new Actor(diagram) { acName = "cba" };
            Activity activity1 = new Activity(act) { ActivityName = "1231", Pos = 300 };
            act.AddAactivity(activity1);
            diagram.AddActors(actor);
            diagram.AddActors(act);

            Transfer transtar = new Transfer(activity,activity1);
            diagram.AddTransfer(transtar);

            ui_Diagram.DataContext = diagram;
            //ui_ActorListBox.ItemsSource = diagram.Actors;
            //ui_Transfer.ItemsSource = diagram.Transfer;
        }
Exemplo n.º 2
0
 public Activity(Actor actor)
 {
     this.actor = actor;
 }
Exemplo n.º 3
0
 //获得执行者y坐标
 public double GetY(Actor actor)
 {
     int pos = actors.IndexOf(actor)+1;
     double y = pos * 50 - 30;
     return y;
 }
Exemplo n.º 4
0
 //删除执行者
 public void DelActors(Actor actor)
 {
     actors.Remove(actor);
 }
Exemplo n.º 5
0
 //添加执行者
 public void AddActors(Actor actor)
 {
     actors.Add(actor);
 }
Exemplo n.º 6
0
 private void ui_NewActor_Click(object sender, RoutedEventArgs e)
 {
     //tool = "添加执行者";
     Actor act = new Actor(diagram) { acName = "1231" };
     diagram.AddActors(act);
 }