public override bool CreateConnectionPoints() { try { ConnectionPoint conn1 = new ConnectionPoint(rectangleBig, this, false, new Point(rectangleBig.X+22,rectangleBig.Y+5)); listOfConnectionPoints.Add(conn1); return true; } catch { return false; } }
public override bool CreateConnectionPoints() { try { ConnectionPoint connLeftUp = new ConnectionPoint(rectangleSmallLeftUp, this, false, new Point(rectangleBig.X + 2, rectangleBig.Y+5)); ConnectionPoint connLeftDown = new ConnectionPoint(rectangleSmallLeftDown, this, false, new Point(rectangleBig.X + 4, rectangleBig.Y+35)); ConnectionPoint connRightComb = new ConnectionPoint(rectangleCombRight, this, true, new Point(rectangleBig.X+45, rectangleBig.Y + 20)); listOfConnectionPoints.Add(connLeftUp); listOfConnectionPoints.Add(connLeftDown); listOfConnectionPoints.Add(connRightComb); return true; } catch { return false; } }
private bool IsMakingCircularFlow(ConnectionPoint cp) { foreach (ConnectionPoint conPon in cp.ComponentDrawnBelong.GiveMeYourOutputConnectionPoints()) { if (conPon.PipeConnection != null) { ComponentDrawn end = conPon.PipeConnection.GetEndConnectionPoint().ComponentDrawnBelong; ComponentDrawn start = cp.PipeConnection.GetStartConnectionPoint().ComponentDrawnBelong; if (end == start) { MessageBox.Show("Making circular flow!"); return true; } } } return false; }
private void DrawConnectionPointLimits(Brush color, ConnectionPoint cp) { //int width = cp.rectangle.Width; //int height = cp.rectangle.Height; //int x = cp.rectangle.X; //int y = cp.rectangle.Y; //Rectangle r = new Rectangle(new Point(x, y), new Size(width, 5)); //graphic.FillRectangle(color, r); //r = new Rectangle(new Point(x + width, y), new Size(5, height + 5)); //graphic.FillRectangle(color, r); //r = new Rectangle(new Point(x, y + height), new Size(width, 5)); //graphic.FillRectangle(color, r); //r = new Rectangle(new Point(x, y), new Size(5, height)); //graphic.FillRectangle(color, r); Pen myNewPen = new Pen(color, 2); graphic.DrawRectangle(myNewPen, cp.rectangle); //int width = cp.rectangle.Width / 2; //int height = cp.rectangle.Height / 2; //int x = cp.rectangle.X; //int y = cp.rectangle.Y; //Rectangle r = new Rectangle(new Point(x, y), new Size(width, 5)); //graphic.FillRectangle(color, r); //r = new Rectangle(new Point(x + width, y), new Size(5, height + 5)); //graphic.FillRectangle(color, r); ////r = new Rectangle(new Point(x, y + height), new Size(width, 5)); ////graphic.FillRectangle(color, r); ////r = new Rectangle(new Point(x, y), new Size(5, height)); ////graphic.FillRectangle(color, r); //if(cp.IsOutput) //{ // int width = cp.rectangle.Width / 2; // int height = cp.rectangle.Height / 2; // int x = cp.rectangle.X + width ; // int y = cp.rectangle.Y; // graphic.DrawRectangle(Pens.Black, x, y, width, height); // //int width = cp.rectangle.Width ; // //int height = cp.rectangle.Height; // //int x = cp.rectangle.X; // //int y = cp.rectangle.Y; // //graphic.DrawRectangle(Pens.Black, x, y, width, height); //} //else //{ // int width = cp.rectangle.Width / 2; // int height = cp.rectangle.Height / 2; // int x = cp.rectangle.X; // int y = cp.rectangle.Y + height / 2; // graphic.DrawRectangle(Pens.Black, x, y, width, height); //} }
public override bool CreateConnectionPoints() { try { //TODO check point 0,0 ConnectionPoint connLeft = new ConnectionPoint(rectanglePipeLeft, this, false, new Point(0,0)); ConnectionPoint connRight = new ConnectionPoint(rectanglePipeRight, this, true, new Point(0,0)); listOfConnectionPoints.Add(connLeft); listOfConnectionPoints.Add(connRight); return true; } catch { return false; } }
private void AddConnection(ConnectionPoint cp) { this.listOfConnectionPoints.Add(cp); }
internal void RemoveConnection(ConnectionPoint cp) { this.listOfConnectionPoints.Remove(cp); }
public void SetConnection(ConnectionPoint connection) { if (rectanglePipeRight == null) { rectanglePipeRight = connection.rectangle; } else { rectanglePipeLeft = connection.rectangle; } AddConnection(connection); }