Example #1
0
        public FindPathButton(int width, int height, int positionX, int positionY
                              , GraphRepresentation.AdjacencyList adList, List <EdgeDraw> edgeDraws
                              , InputCountBox startVertex, InputCountBox endVertex
                              , StartForm.DrawForm drawForm, InfoTextLabel infoText)
        {
            Size = new System.Drawing.Size(width, height);

            Location = new System.Drawing.Point(positionX, positionY);

            Text = "Find path";

            Click += new EventHandler(ButtonClick);

            this.adList = adList;

            this.edgeDraws = edgeDraws;

            this.startVertex = startVertex;

            this.endVertex = endVertex;

            this.drawForm = drawForm;

            this.infoText = infoText;

            path = null;
        }
        public ShortestPathPanel(int width, int height, int positionX, int positionY
                                 , GraphRepresentation.AdjacencyList adList, List <EdgeDraw> edgeDraws
                                 , StartForm.DrawForm drawForm)
        {
            Size = new System.Drawing.Size(width, height);

            Location = new System.Drawing.Point(positionX, positionY);

            BorderStyle = BorderStyle.Fixed3D;

            Anchor = (AnchorStyles.Top | AnchorStyles.Left);

            Visible = false;

            this.adList = adList;

            this.edgeDraws = edgeDraws;

            infoText = new InfoTextLabel(180, 20, 10, 20, "Path: ");

            Controls.Add(infoText);

            startVertexText = new InfoTextLabel(65, 20, 0, 60, "From:");

            Controls.Add(startVertexText);

            endVertexText = new InfoTextLabel(45, 20, Size.Width - 100, 60, "To:");

            Controls.Add(endVertexText);

            startVertex = new InputCountBox(20, 20, 65, 60);

            Controls.Add(startVertex);

            endVertex = new InputCountBox(20, 20, Size.Width - 55, 60);

            Controls.Add(endVertex);

            findPathButton = new FindPathButton(95, 30, Size.Width / 2 - 45, Size.Height - 60, adList, edgeDraws
                                                , startVertex, endVertex, drawForm, infoText);

            Controls.Add(findPathButton);
        }