Blame mono/Diagram/Test.cs

777717
/*
777717
    ......... 2015 Ivan Mahonin
777717
777717
    This program is free software: you can redistribute it and/or modify
777717
    it under the terms of the GNU General Public License as published by
777717
    the Free Software Foundation, either version 3 of the License, or
777717
    (at your option) any later version.
777717
777717
    This program is distributed in the hope that it will be useful,
777717
    but WITHOUT ANY WARRANTY; without even the implied warranty of
777717
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
777717
    GNU General Public License for more details.
777717
777717
    You should have received a copy of the GNU General Public License
777717
    along with this program.  If not, see <http: licenses="" www.gnu.org="">.</http:>
777717
*/
777717
777717
using System;
8cb222
using System.Drawing;
8cb222
8cb222
namespace Diagram {
8cb222
    public class Test {
8cb222
        public static Diagram buildTestDiagram() {
8cb222
            return new Diagram()
8cb222
                .addBlock(
8cb222
                    "b1",
8cb222
                    "Block Number One",
8cb222
                    "Very cool block, with the best number One. Important thing."
8cb222
                )
8cb222
                .addBlock(
8cb222
                    "b2",
8cb222
                    "Block Number Two",
8cb222
                    "Very cool block, with the best number Two. Important thing."
8cb222
                )
8cb222
                .addBlock(
8cb222
                    "b3",
8cb222
                    "Block Number Three",
8cb222
                    "Very cool block, with the best number Three. Important thing.",
8cb222
                    Color.Red
8cb222
                )
8cb222
                .addBlock(
8cb222
                    "b4",
8cb222
                    "Block Number Four",
8cb222
                    "Very cool block, with the best number Four. Important thing."
8cb222
                )
8cb222
                .addBlock(
8cb222
                    "b5",
8cb222
                    "Block Number Five",
8cb222
                    "Very cool block, with the best number Five. Important thing."
8cb222
                )
8cb222
                .addLink("b1", "b3")
8cb222
                .addLink("b1", "b4")
8cb222
                .addLink("b2", "b3")
8cb222
                .addLink("b3", "b4")
8cb222
                .addLink("b4", "b5");
8cb222
        }
8cb222
8cb222
        public static ActiveDiagram buildTestActiveDiagram(Diagram diagram) {
8cb222
            ActiveDiagram d = new ActiveDiagram();
8cb222
8cb222
            d.diagram = diagram;
8cb222
8cb222
            d.captionFont = new Font(FontFamily.GenericSansSerif, 12f, FontStyle.Bold);
8cb222
            d.textFont = new Font(FontFamily.GenericSansSerif, 10f);
8cb222
            d.margin = d.captionFont.GetHeight();
8cb222
            d.padding = d.textFont.GetHeight();
8cb222
            d.arrowSize = new SizeF(10f, 15f);
8cb222
            d.pen = new Pen(Brushes.Black, 3f);
8cb222
            d.brush = Brushes.White;
8cb222
8cb222
            d.reloadDiagram();
8cb222
8cb222
            return d;
8cb222
        }
8cb222
8cb222
        public static ActiveDiagram buildTestActiveDiagram() {
8cb222
            return buildTestActiveDiagram(buildTestDiagram());
8cb222
        }
8cb222
    }
8cb222
}
8cb222