public void Setup() { vertexDraws = new List <VertexDraw>(); collisionVertex = new CollisionVertex(); float x = 30.5f; float y = 20.7f; vertexDraw = new VertexDraw(BrushColor.Orange, BrushColor.Green, x, y, (float)VertexParameters.Width, (float)VertexParameters.Height, "", vertexDraws.Count); }
public InitialGraph(List <VertexDraw> vertexDraws, List <EdgeDraw> edgeDraws, MatrixGraph matrixGraph) { this.vertexDraws = vertexDraws; this.edgeDraws = edgeDraws; this.matrixGraph = matrixGraph; collisionVertex = new CollisionVertex(); converter = new Converter(); }
public LoadFileButton(StartForm.StartForm startForm) { Text = "Load file"; this.left = left; FlatStyle = System.Windows.Forms.FlatStyle.Popup; ForeColor = Color.Black; this.BackColor = Color.Orange; Font = new System.Drawing.Font("Comic Sans MS", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(204))); Location = new System.Drawing.Point(350, 220); Size = new System.Drawing.Size(100, 50); Anchor = (AnchorStyles.Bottom | AnchorStyles.Right); // anchorage to place vertexDraws = new List <VertexDraw>(); this.startForm = startForm; edgeDraws = new List <EdgeDraw>(); Click += new EventHandler(ButtonClick); deserializeGraph = new DeserializeGraph(); converter = new DrawForm.Converter(); ofd = new OpenFileDialog(); ofd.Filter = "Json files (*.json)|*.json"; ofd.CheckFileExists = true; collisionVertex = new CollisionVertex(); }
public DrawForm(List <VertexDraw> vertexDraws, List <EdgeDraw> edgeDraws, List <List <CellBox> > matrix, StartForm startForm, InputCountVertexForm inputCountVertexForm, MatrixGraph matrixGraph, AdjacencyList adjacencyList) { InitializeComponent(); StartPosition = FormStartPosition.CenterScreen; Text = "GraphVizualizer / Draw"; this.BackColor = Color.DarkGray; DoubleBuffered = true; this.vertexDraws = vertexDraws; this.edgeDraws = edgeDraws; collisionVertex = new CollisionVertex(); newEdgeDefinition = new NewEdgeDefinition(); drawingEdges = new DrawingEdges(); MouseDown += new MouseEventHandler(MouseClickDrawForm); vertexBrush = new SolidBrush(Color.Black); vertexStringFormat = new StringFormat(); vertexStringFormat.Alignment = StringAlignment.Center; vertexStringFormat.LineAlignment = StringAlignment.Center; vertexTextFont = new Font("Times New Roman", 12, FontStyle.Bold); pen = new Pen(Brushes.Black, 5); weightTable = new WeightTable(200, 200, Size.Width - 200, 0); matrixWeightPanel = new MatrixWeightPanel(weightTable, matrix); matrixWeightPanel.DrawingMatrix(); Controls.Add(weightTable); converter = new Converter(); this.adjacencyList = adjacencyList; adListPanel = new AdjacencyListPanel(200, 200, Size.Width - 200, 0, adjacencyList); Controls.Add(adListPanel); Controls.Add(adListPanel); shortestPathPanel = new ShortestPathPanel(200, 200, 150, 0, adjacencyList, edgeDraws, this); Controls.Add(shortestPathPanel); toolPanel = new ToolPanel(0, 100, weightTable, this.edgeDraws , adjacencyList, this, adListPanel, this.vertexDraws, matrix , adListPanel.AdListTable.Cells, shortestPathPanel); Controls.Add(toolPanel); pen.EndCap = LineCap.ArrowAnchor; arrow = new Arrow(); brushes = new Brush[2]; brushes[(int)BrushColor.Orange] = Brushes.Orange; brushes[(int)BrushColor.Black] = Brushes.Black; backToMenuOfDrawButton = new BackToMenuFromDrawButton(adjacencyList, vertexDraws, edgeDraws, this, adListPanel, weightTable, matrix, adListPanel.AdListTable.Cells); backToInputFromDrawButton = new BackToInputFromDrawButton(adjacencyList, vertexDraws, edgeDraws, this, adListPanel, weightTable, matrix, adListPanel.AdListTable.Cells, inputCountVertexForm, matrixGraph, startForm); Controls.Add(backToInputFromDrawButton); Controls.Add(backToMenuOfDrawButton); }