//public UMLControlPointGroup (UMLNode group) : base ((CanvasGroup) group)
        public UMLControlPointGroup(UMLElement group)
            : base((CanvasGroup) group)
        {
            _element = group;
            _p = new UMLControlPoint [4];
            _frame = new CanvasRect (this);
            _frame.OutlineColor = DEFAULT_OUTLINE_COLOR;
            _frame.FillColorRgba = 0xfbfbfb15;
            _frame.WidthUnits = 1;
            _frame.Show ();

            for (int i = 0; i < ((int) Location.Total); i++)
            {
                _p[i] = new UMLControlPoint (this);
                _p[i].Moved += PointMoved;
            }
            Redraw ();
        }
Esempio n. 2
0
		private void ButtonReleaseEventCb (object obj, ButtonReleaseEventArgs args)
		{		
			_selector.StopSelection (_elements);
			_is_nodeentry_moved = false;
			
			if (_dragging_association)
			{
				_dragging_association = false;
				//TODO: Fix this
//				_current_edge.CalculateToElement ();			
			}
			if (_cp_motioned != null)
			{
				_cp_motioned.ForceRelease (args);
				_cp_motioned = null;
				_umledge = null;
			}
		}
Esempio n. 3
0
		public void EnableControlPointMotion (UMLEdge e, UMLControlPoint cp)
		{
			_cp_motioned = cp;
			_umledge = e;
		}
Esempio n. 4
0
 public void EnableControlPointMotion(UMLEdge edge, UMLControlPoint cp)
 {
     _canvas.EnableControlPointMotion (edge, cp);
 }
Esempio n. 5
0
 // creates one control point for each internal line break
 // that is, it will create 0..N control points.
 private void CreateControlPoints()
 {
     UMLControlPoint cp;
     DI.Point waypoint;
     _control_points.Clear ();
     IList wps = _graphEdge.Waypoints;
     for (int i = 0; i < wps.Count; i ++)
     {
         waypoint = (DI.Point)wps[i];
         cp = new UMLControlPoint (_ownerDiagram.CanvasRoot);
         cp.Moveable = true;
         cp.X = waypoint.X;
         cp.Y = waypoint.Y;
         cp.ButtonReleased += new UMLElementButtonEventHandler (CPButtonReleased);
         cp.Moved += new MovedHandler (CPMoved);
         _control_points.Add (cp);
     }
 }
Esempio n. 6
0
 private void BreakSegment(CanvasLine segment, double x, double y)
 {
     // if there is another control point near, don't break the line
     UMLControlPoint cp = null;
     DI.Point wp;
     for(int i = 0; i < _graphEdge.Waypoints.Count; i ++)
     {
         wp = (DI.Point) _graphEdge.Waypoints [i];
         if( Math.Abs (wp.X - x) < 3 && Math.Abs (wp.Y - y) < 3)
         {
             cp = (UMLControlPoint) _control_points [i];
             break;
         }
     }
     if (cp == null)
     {
         int pos = _line_segments.IndexOf (segment) + 1;
         // creates a new line segment
         CanvasLine newSegment = CreateLine ();
         _line_segments.Insert (pos, newSegment);
         // creates a new way point
         _graphEdge.Waypoints.Insert (pos, new DI.Point (x, y));
         // creates a new control point
         cp = new UMLControlPoint (_ownerDiagram.CanvasRoot);
         cp.Moveable = true;
         cp.X = x;
         cp.Y = y;
         cp.ButtonReleased += new UMLElementButtonEventHandler (CPButtonReleased);
         cp.Moved += new MovedHandler (CPMoved);
         cp.Show ();
         cp.Raise (1);
         _control_points.Insert (pos, cp);
         base.UMLControlPoint = true;
     }
     // Redraw the edge
     cp.SetPressed ();
     ForceRedraw ();
     _ownerDiagram.EnableControlPointMotion (this, cp);
 }