public void Point_AttributeChanged(object sender, AttributeChangedArgs a)
 {
     switch (a.AttributeType)
     {
         case RepAttributes.InnerColor:
             FrontEnd.SetRepInnerColor(a.RepresentationID, (Color)a.NewAttributeValue);
             break;
         case RepAttributes.OuterColor:
             FrontEnd.SetRepOuterColor(a.RepresentationID, (Color)a.NewAttributeValue);
             break;
         case RepAttributes.Position:
             FrontEnd.SetRepPosition(a.RepresentationID, (Point)a.NewAttributeValue);
             break;
         case RepAttributes.Mobility:
             FrontEnd.ShowMobility(a.RepresentationID, (bool)a.NewAttributeValue);
             break;
     }
 }
예제 #2
0
 void EllipseClick(object sender, MouseButtonEventArgs e)
 {
     int key = int.Parse(((Ellipse)sender).Name);
     AttributeChangedArgs ac = new AttributeChangedArgs(key, RepAttributes.Mobility, null);
     EllipseMobilityToggle(this, ac);
 }
예제 #3
0
 void Point_ToggleMobile(object sender, AttributeChangedArgs e)
 {
     MainGraph.ToggleMobility(e.RepresentationID);
 }
예제 #4
0
 public void MoveTo(int x, int y)
 {
     if (IsMobile)
     {
         this.X = x;
         this.Y = y;
         AttributeChangedArgs aca = new AttributeChangedArgs(this.ID, RepAttributes.Position, new Point(X, Y));
         if (AttributeChanged != null)
         { AttributeChanged(this, aca); }
     }
 }
예제 #5
0
 public void ToggleMobility()
 {
     IsMobile = !IsMobile;
     AttributeChangedArgs ac = new AttributeChangedArgs(this.ID, RepAttributes.Mobility, IsMobile);
     if (AttributeChanged != null)
         AttributeChanged(this, ac);
 }
예제 #6
0
 public void SetInnerColor(Color newColor, RepAttributes colorType)
 {
     RepInnerColor = newColor;
     AttributeChangedArgs aca;
     if (colorType == RepAttributes.InnerColor)
         aca = new AttributeChangedArgs(this.ID, RepAttributes.InnerColor, newColor);
     else
         aca = new AttributeChangedArgs(this.ID, RepAttributes.InnerColor, newColor);
     if (AttributeChanged != null)
     { AttributeChanged(this, aca); }
 }