Ejemplo n.º 1
0
        private static ILayout ChooseLayout(GraphLayoutType s)
        {
            EdgeDrawer ed = new EdgeDrawer();

            gd.EdgeDrawer = ed;
            ed.Color      = Color.Red;
            VertexDrawer vd = new VertexDrawer();

            gd.VertexDrawer = vd;
            vd.Shape        = VertexDrawer.VertexShape.Disk;
            ILayout fr = new FruchtermanReingoldLayout();

            switch (s)
            {
            case GraphLayoutType.Fruchterman_Reingold:
                fr = new FruchtermanReingoldLayout();
                break;

            case GraphLayoutType.Random:
                fr = new RandomLayout();
                break;

            case GraphLayoutType.Circle:
                fr = new CircleLayout();
                break;

            case GraphLayoutType.Kamada_Kawaii:
                fr = new KamadaKawaiiLayout();
                break;

            case GraphLayoutType.Grid:
                fr = new GridLayout();
                break;

            case GraphLayoutType.Sugiyama:
                SugiyamaEdgeDrawer eds = new SugiyamaEdgeDrawer();
                gd.EdgeDrawer = eds;
                eds.Color     = Color.Red;
                SugiyamaVertexDrawer vds = new SugiyamaVertexDrawer();
                gd.VertexDrawer = vds;
                vds.Shape       = VertexDrawer.VertexShape.Sphere;
                fr = new SugiyamaLayout();
                break;
            }
            return(fr);
        }
Ejemplo n.º 2
0
 private static ILayout ChooseLayout(GraphLayoutType s)
 {
     EdgeDrawer ed = new EdgeDrawer();
     gd.EdgeDrawer = ed;
     ed.Color = Color.Red;
     VertexDrawer vd = new VertexDrawer();
     gd.VertexDrawer = vd;
     vd.Shape = VertexDrawer.VertexShape.Disk;
     ILayout fr = new FruchtermanReingoldLayout();
     switch (s)
     {
         case GraphLayoutType.Fruchterman_Reingold:
             fr = new FruchtermanReingoldLayout();
             break;
         case GraphLayoutType.Random:
             fr = new RandomLayout();
             break;
         case GraphLayoutType.Circle:
             fr = new CircleLayout();
             break;
         case GraphLayoutType.Kamada_Kawaii:
             fr = new KamadaKawaiiLayout();
             break;
         case GraphLayoutType.Grid:
             fr = new GridLayout();
             break;
         case GraphLayoutType.Sugiyama:
             SugiyamaEdgeDrawer eds = new SugiyamaEdgeDrawer();
             gd.EdgeDrawer = eds;
             eds.Color = Color.Red;
             SugiyamaVertexDrawer vds = new SugiyamaVertexDrawer();
             gd.VertexDrawer = vds;
             vds.Shape = VertexDrawer.VertexShape.Sphere;
             fr = new SugiyamaLayout();
             break;
     }
     return fr;
 }