コード例 #1
0
        public InputCountVertexForm(StartForm.StartForm startForm)
        {
            InitializeComponent();

            StartPosition = FormStartPosition.CenterScreen;

            Text = "GraphVizualizer / Matrix";

            this.BackColor = Color.DarkGray;

            matrixPanel = new MatrixWeightTablePanel(350, 290, Width / 2 - 190, 155);

            matrixGraph = new MatrixGraph(matrixPanel);

            inputBox = new InputCountBox(300, 20, 200, 100);
            Controls.Add(inputBox);

            infoText = new InfoTextLabel(300, 30, 200, 80);
            Controls.Add(infoText);

            confirmButton = new ConfirmButton(100, 30, 500, 100, inputBox, matrixGraph);
            Controls.Add(confirmButton);

            backToMenuOfInputButton = new BackToMenuFromInputButton(matrixGraph, this);
            Controls.Add(backToMenuOfInputButton);

            drawVertexButton = new DrawVertexButton(100, 30, 600, 100, this, matrixGraph, startForm);
            Controls.Add(drawVertexButton);

            Controls.Add(matrixPanel);
        }
コード例 #2
0
        public DrawVertexButton(int width, int height, int positionX, int positionY, InputCountVertexForm inputCountForm
                                , MatrixGraph matrixGraph, StartForm.StartForm startForm, string buttonText = "Create vertexes")
        {
            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)));

            FlatStyle = System.Windows.Forms.FlatStyle.Popup;

            this.Text = buttonText;

            this.Size = new System.Drawing.Size(width, height);

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

            this.inputCountForm = inputCountForm;

            this.matrixGraph = matrixGraph;

            vertexDraws = new List <VertexDraw>();

            edgeDraws = new List <EdgeDraw>();

            initialGraph = new InitialGraph(vertexDraws, edgeDraws, matrixGraph);

            matrix = new List <List <CellBox> >();

            Click += new EventHandler(ButtonClick);

            this.startForm = startForm;
        }
コード例 #3
0
        public override void ButtonClick(object sender, EventArgs e)
        {
            matrixGraph.DeleteMatrix();

            StartForm.StartForm startForm = new StartForm.StartForm();

            inputCountVertexForm.Hide();

            startForm.ShowDialog();

            inputCountVertexForm.Close();
        }
コード例 #4
0
        public override void ButtonClick(object sender, EventArgs e)
        {
            adjacencyList.adjacencyList.Clear();
            vertexDraws.Clear();
            edgeDraws.Clear();
            matrix.Clear();
            cells.Clear();

            adjacencyListPanel.Controls.Clear();
            weightTable.Controls.Clear();

            StartForm.StartForm startForm = new StartForm.StartForm();
            drawForm.Hide();
            startForm.ShowDialog();
            drawForm.Close();
        }
コード例 #5
0
        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();
        }
コード例 #6
0
        public StartButton(StartForm.StartForm startForm)
        {
            this.startForm = startForm;

            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)));

            FlatStyle = System.Windows.Forms.FlatStyle.Popup;

            Text = "Create new graph";

            Location = new System.Drawing.Point(350, 160);

            Size = new System.Drawing.Size(100, 50);

            Anchor = (AnchorStyles.Bottom | AnchorStyles.Right); // anchorage to place

            Click += new EventHandler(ButtonClick);
        }
コード例 #7
0
        public BackToInputFromDrawButton(AdjacencyList adjacencyList, List <VertexDraw> vertexDraws,
                                         List <EdgeDraw> edgeDraws, StartForm.DrawForm drawForm, AdjacencyListPanel adjacencyListPanel,
                                         WeightTable weightTable, List <List <CellBox> > matrix, List <List <CellAdjacencyList> > cells,
                                         InputCountVertexForm inputCountVertexForm, MatrixGraph matrixGraph, StartForm.StartForm startForm, string buttonText = "Matrix") : base(buttonText)
        {
            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)));

            FlatStyle = System.Windows.Forms.FlatStyle.Popup;

            Text = buttonText;

            Location = new System.Drawing.Point(400, 410);

            this.adjacencyList = adjacencyList;

            this.vertexDraws = vertexDraws;

            this.edgeDraws = edgeDraws;

            this.drawForm = drawForm;

            this.weightTable = weightTable;

            this.adjacencyListPanel = adjacencyListPanel;

            this.matrix = matrix;

            this.cells = cells;

            this.inputCountVertexForm = inputCountVertexForm;

            this.matrixGraph = matrixGraph;

            this.startForm = startForm;
        }