Exemplo n.º 1
0
		public Origin(Shape shape)
		{
			SuspendEvents = true;
			Shape = shape;
			AllowMove = true;
			SuspendEvents = false;
		}
Exemplo n.º 2
0
		public Link(Shape start,Shape end) : base(start,end)
		{
			SuspendEvents = true;

			End.Marker = new Arrow(false);

			SuspendEvents = false;		
		}
Exemplo n.º 3
0
		public ComplexLine(Shape start,Shape end): base(start,end)
		{
			mSegments = new Segments();
			Segment segment = new Segment(Start,End);
			Segments.Add(segment);
			segment.SegmentInvalid += new EventHandler(segment_SegmentInvalid);

			AllowExpand = true;
		}
Exemplo n.º 4
0
		public Connector(Shape start,Shape end) : base(start,end)
		{
			SuspendEvents = true;

			Avoid = true;
			Padding = new SizeF(20,20);
			SmoothingMode = SmoothingMode.None;

			SuspendEvents = false;		
		}
Exemplo n.º 5
0
		public Line(Shape start,Shape end)
		{
			SuspendEvents = true;

			AllowMove = true;
			DrawSelected = true;
			Start = new Origin(start);
			End = new Origin(end);
			Interaction = UserInteraction.BringToFront;
			Ports = new Elements(typeof(Port),"Port");

			SuspendEvents = false;
		}
Exemplo n.º 6
0
		public virtual Connector AddConnector(string key, Port start, Shape end)
		{
			Connector line = Runtime.CreateConnector();
			line.Start.Port = start;
			line.End.Shape = end;
			Runtime.ActiveContainer.Lines.Add(key,line);
			return line;
		}
Exemplo n.º 7
0
		public virtual Connector AddConnector(Shape start, Shape end)
		{
			Connector line = Runtime.CreateConnector();
			line.Start.Shape = start;
			line.End.Shape = end;
			Runtime.ActiveContainer.Lines.Add(Runtime.ActiveContainer.Lines.CreateKey(),line);
			return line;
		}
Exemplo n.º 8
0
		public virtual Line AddLine(string key, Shape start, Shape end)
		{
			Line line = Runtime.CreateLine();
			line.Start.Shape = start;
			line.End.Shape = end;
			Runtime.ActiveContainer.Lines.Add(key,line);
			return line;
		}
Exemplo n.º 9
0
		public virtual Shape CreateShape(PointF start,SizeF size)
		{
			Shape shape = new Shape();
			shape.Location = start;
			if (! size.IsEmpty) shape.Size = size;

			OnCreateElement(shape);
			return shape;
		}
Exemplo n.º 10
0
		public virtual Shape CreateShape()
		{
			Shape shape = new Shape();

			OnCreateElement(shape);
			return shape;
		}
Exemplo n.º 11
0
		public Curve(Shape start,Shape end): base(start,end)
		{
			mCurveType = CurveType.Spline;
			mTension = 0.5F;
			CreateControlPoints();
		}
Exemplo n.º 12
0
		private void ResetLines(Shape shape)
		{
			Suspend();

			//Loop through each line and create a remove list
			foreach (Line line in Lines.Values)
			{
				if (line.Start.DockedElement != null && line.Start.DockedElement == shape) line.Start.Location = line.FirstPoint;
				if (line.End.DockedElement != null && line.End.DockedElement == shape) line.End.Location = line.LastPoint;
			}

			Resume();
		}
Exemplo n.º 13
0
		public Shape(Shape prototype): base(prototype)
		{
			mAllowMove = prototype.AllowMove;
			mAllowScale = prototype.AllowScale;
			mAllowRotate = prototype.AllowRotate;
			mDrawSelected = prototype.DrawSelected;
			mDirection = prototype.Direction;
			mInteraction = prototype.Interaction;
			
			mMaximumSize = prototype.MaximumSize;
			mMinimumSize = prototype.MinimumSize;
			mKeepAspect = prototype.KeepAspect;

			//Copy ports
			Ports = new Elements(typeof(Port),"Port");
			foreach (Port port in prototype.Ports.Values)
			{
				Port clone = (Port) port.Clone();
				Ports.Add(port.Key,clone);
				
				clone.SuspendValidation();
				clone.Location = port.Location;
				clone.ResumeValidation();
			}

			if (prototype.Animation != null) mAnimation = (Animation) prototype.Animation.Clone();
		}