Exemple #1
0
        I_Layout LayoutGenerate(List <I_Node> node_list, LayoutEnum layout_enum)
        {
            var pos_list = new List <Position>();

            int width_nodes = (int)Math.Round(Math.Sqrt(node_list.Count));

            var wide_count   = 0;
            var height_count = 0;

            foreach (var node in node_list)
            {
                if (wide_count < width_nodes)
                {
                    wide_count++;
                }
                else
                {
                    wide_count = 1;
                    height_count++;
                }
                pos_list.Add(new Position(wide_count, height_count));
            }

            return(new BaseLayout(pos_list, layout_enum));
        }
Exemple #2
0
        protected override void ParseAttribute(XmlNode attr)
        {
            base.ParseAttribute(attr);
            switch (attr.Name.ToLower())
            {
            case "visible":
                _visible = bool.Parse(attr.InnerText);
                break;

            case "style":
                _style = new Style(attr, this);
                break;

            case "position":
                _position = (PositionEnum)Enum.Parse(typeof(PositionEnum), attr.InnerText, true);
                break;

            case "layout":
                _layout = (LayoutEnum)Enum.Parse(typeof(LayoutEnum), attr.InnerText, true);
                break;

            case "insideplotarea":
                _insidePlotArea = bool.Parse(attr.InnerText);
                break;

            default:
                break;
            }
        }
Exemple #3
0
 /// <summary>
 /// Creates a <see cref="DirectedGraph"/> with the specified parameters.
 /// </summary>
 /// <param name="layout">The layout of the directed graph.</param>
 /// <param name="graphDirection">The direction of the graph.</param>
 /// <returns>The directed graph configured with the specified parameters.</returns>
 public static DirectedGraph Create(LayoutEnum layout, GraphDirectionEnum graphDirection)
 => new DirectedGraph
 {
     Layout                  = layout,
     LayoutSpecified         = true,
     GraphDirection          = graphDirection,
     GraphDirectionSpecified = true,
 };
 /// <summary>
 /// Creates a <see cref="DirectedGraph"/> with the specified parameters.
 /// </summary>
 /// <param name="layout">The layout of the directed graph.</param>
 /// <param name="graphDirection">The direction of the graph.</param>
 /// <returns>The directed graph configured with the specified parameters.</returns>
 public DirectedGraph Create(LayoutEnum layout, GraphDirectionEnum graphDirection)
 {
     var graph = new DirectedGraph();
     graph.Layout = layout;
     graph.LayoutSpecified = true;
     graph.GraphDirection = graphDirection;
     graph.GraphDirectionSpecified = true;
     return graph;
 }
 public ContentPopupEx(FrameworkElement element, LayoutEnum layout = LayoutEnum.Center) : this()
 {
     this._rootFramework = element;
     this._layout        = layout;
 }
Exemple #6
0
        public I_Layout Generate(List <string[]> raw_pos_list, List <I_Node> node_list, LayoutEnum layout_enum)
        {
            var pos_list = new List <Position>();

            foreach (var node in node_list)
            {
                var id   = node.NodeID;
                var posX = 0.0;
                var posY = 0.0;

                if (id >= raw_pos_list.Count)
                {
                    posX = 0;
                    posY = 0;
                    pos_list.Add(new Position());
                }
                else
                {
                    posX = double.Parse(raw_pos_list[id][1]);
                    posY = double.Parse(raw_pos_list[id][2]);
                    pos_list.Add(new Position(posX, posY));
                }
            }
            return(new BaseLayout(pos_list, layout_enum));
        }
 public ContentPopupEx(FrameworkElement element,LayoutEnum layout=LayoutEnum.Center) : this()
 {
     this._rootFramework = element;
     this._layout = layout;
 }
Exemple #8
0
 public Layout(List <Vector2> pos_list, LayoutEnum layout_enum)
 {
     this.MyLayoutEnum = layout_enum;
     this.PosList      = pos_list;
 }
Exemple #9
0
 public BaseLayout(List <Position> pos_list, LayoutEnum layout_enum)
 {
     this.MyLayoutEnum = layout_enum;
     this.PosList      = pos_list;
 }