Beispiel #1
0
 public PortModel(NodeModel parent, PortAlignment alignment = PortAlignment.BOTTOM, Point?position = null, Size?size = null)
 {
     Parent    = parent;
     Alignment = alignment;
     Position  = position ?? Point.Zero;
     Size      = size ?? Size.Zero;
 }
Beispiel #2
0
        public Port(Port prototype) : base(prototype)
        {
            SuspendEvents = true;

            Label       = null;
            StencilItem = null;

            mAlignment   = prototype.Alignment;
            mOffset      = prototype.Offset;
            mAllowMove   = prototype.AllowMove;
            mAllowRotate = prototype.AllowRotate;
            mDirection   = prototype.Direction;
            mInteraction = prototype.Interaction;
            Label        = null;
            mPortStyle   = prototype.Style;
            Cursor       = prototype.Cursor;

            mPercent     = prototype.Percent;
            mOrientation = prototype.Orientation;

            //Needed for action mvoe
            mParent = prototype.Parent;

            SuspendEvents = false;
        }
Beispiel #3
0
 public PortModel(string id, NodeModel parent, PortAlignment alignment = PortAlignment.Bottom,
                  Point?position = null, Size?size = null) : base(id)
 {
     Parent    = parent;
     Alignment = alignment;
     Position  = position ?? Point.Zero;
     Size      = size ?? Size.Zero;
 }
 private static Point GetOriginSpot(Point p, PortAlignment alignment, double shapeMargin)
 {
     return(alignment switch
     {
         PortAlignment.Top => p.Add(0, -shapeMargin),
         PortAlignment.Right => p.Add(shapeMargin, 0),
         PortAlignment.Bottom => p.Add(0, shapeMargin),
         PortAlignment.Left => p.Add(-shapeMargin, 0),
         _ => throw new NotImplementedException()
     });
Beispiel #5
0
		public Port(Port prototype): base(prototype)
		{
			SuspendEvents = true;

			Label = null;
			StencilItem = null;

			mAlignment = prototype.Alignment;				
			mOffset = prototype.Offset;
			mAllowMove = prototype.AllowMove;
			mAllowRotate = prototype.AllowRotate;
			mDirection = prototype.Direction;
			mInteraction = prototype.Interaction;
			Label = null;
			mPortStyle = prototype.Style;
			Cursor = prototype.Cursor;

			mPercent = prototype.Percent;
			mOrientation = prototype.Orientation;
			
			//Needed for action mvoe
			mParent = prototype.Parent;

			SuspendEvents = false;
		}
Beispiel #6
0
 public void AddPort(Column column, PortAlignment alignment) => AddPort(new ColumnPort(this, column, alignment));
Beispiel #7
0
 public ColoredPort(NodeModel parent, PortAlignment alignment, bool isRed) : base(parent, alignment, null, null)
 {
     IsRed = isRed;
 }
 public ColumnPort(NodeModel parent, Column column, PortAlignment alignment = PortAlignment.Bottom)
     : base(parent, alignment, null, null)
 {
     Column = column;
 }